hal/hald/linux2 acpi.c,1.40,1.41 pmu.c,1.16,1.17

Danny Kukawka dkukawka at freedesktop.org
Wed Nov 9 12:45:47 PST 2005


Update of /cvs/hal/hal/hald/linux2
In directory gabe:/tmp/cvs-serv11635/hald/linux2

Modified Files:
	acpi.c pmu.c 
Log Message:
2005-11-09  Danny Kukawka  <danny.kukawka at web.de>

        * doc/spec/hal-spec.xml.in: added battery.remaining_time.calculate_per_time

        * hald/linux2/acpi.c: (battery_refresh_poll): added check for new property
        battery.remaining_time.calculate_per_time for util_compute_time_remaining()

        * hald/linux2/pmu.c: (battery_refresh): added check for new property
        battery.remaining_time.calculate_per_time for util_compute_time_remaining()

        * hald/util.c (util_compute_time_remaining), hald/util.h: added slightly
        adopted and extended patch from Søren Hansen <sh at linux2go.dk> to fix
        calculation for machines which does not report current rate. This calculate
        the chargRate from time and chargeLevel.
        Added a new parameter to enable/disable the new calculation.



Index: acpi.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/acpi.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- acpi.c	25 Oct 2005 16:06:13 -0000	1.40
+++ acpi.c	9 Nov 2005 20:45:44 -0000	1.41
@@ -195,7 +195,8 @@
 
 	remaining_time = util_compute_time_remaining (d->udi, normalised_rate, normalised_current, normalised_lastfull,
 				hal_device_property_get_bool (d, "battery.rechargeable.is_discharging"),
-				hal_device_property_get_bool (d, "battery.rechargeable.is_charging"));
+				hal_device_property_get_bool (d, "battery.rechargeable.is_charging"),
+				hal_device_property_get_bool (d, "battery.remaining_time.calculate_per_time"));
 	remaining_percentage = util_compute_percentage_charge (d->udi, normalised_current, normalised_lastfull);
 	/*
 	 * Only set keys if no error (signified with negative return value)

Index: pmu.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/pmu.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- pmu.c	20 Sep 2005 15:30:39 -0000	1.16
+++ pmu.c	9 Nov 2005 20:45:45 -0000	1.17
@@ -126,7 +126,8 @@
 					current,
 					last_full,
 					hal_device_property_get_bool (d, "battery.rechargeable.is_discharging"),
-					hal_device_property_get_bool (d, "battery.rechargeable.is_charging"));
+					hal_device_property_get_bool (d, "battery.rechargeable.is_charging"),
+					hal_device_property_get_bool (d, "battery.remaining_time.calculate_per_time"));
 		remaining_percentage = util_compute_percentage_charge (d->udi, current, last_full);
 		/*
 		 * Only set keys if no error (signified with negative return value)




More information about the hal-commit mailing list