hal/hald/linux2 acpi.c,1.12,1.13 apm.c,1.5,1.6 pmu.c,1.6,1.7

David Zeuthen david at freedesktop.org
Wed Mar 2 13:51:58 PST 2005


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

Modified Files:
	acpi.c apm.c pmu.c 
Log Message:
2005-03-02  David Zeuthen  <davidz at redhat.com>

	* doc/spec/hal-spec.xml.in: Change this to remove the property
	battery.charge_level.maximum and introduce battery.charge_level.design
	and battery.charge_level.last_full instead

	* hald/linux2/addons/addon-hid-ups.c (ups_get_static): Update code
	to use new the new properties

	* hald/linux2/pmu.c (battery_refresh): Update code to use new the
	new properties

	* hald/linux2/apm.c (battery_refresh): Update code to use new the
	new properties

	* hald/linux2/acpi.c (battery_refresh): Update code to use new the
	new properties



Index: acpi.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/acpi.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- acpi.c	2 Mar 2005 21:30:40 -0000	1.12
+++ acpi.c	2 Mar 2005 21:51:55 -0000	1.13
@@ -104,6 +104,7 @@
 		hal_device_property_remove (d, "battery.charge_level.unit");
 		hal_device_property_remove (d, "battery.charge_level.current");
 		hal_device_property_remove (d, "battery.charge_level.maximum");
+		hal_device_property_remove (d, "battery.charge_level.design");
 		device_property_atomic_update_end ();		
 	} else {
 		device_property_atomic_update_begin ();
@@ -124,7 +125,9 @@
 		hal_util_set_int_elem_from_file (d, "battery.charge_level.current", path, 
 						 "state", "remaining capacity", 0, 10);
 
-		hal_util_set_int_elem_from_file (d, "battery.charge_level.maximum", path, 
+		hal_util_set_int_elem_from_file (d, "battery.charge_level.last_full", path, 
+						 "info", "last full capacity", 0, 10);
+		hal_util_set_int_elem_from_file (d, "battery.charge_level.design", path, 
 						 "info", "design capacity", 0, 10);
 		device_property_atomic_update_end ();
 	}

Index: apm.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/apm.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- apm.c	24 Feb 2005 16:50:35 -0000	1.5
+++ apm.c	2 Mar 2005 21:51:55 -0000	1.6
@@ -127,7 +127,8 @@
 		hal_device_property_remove (d, "battery.rechargeable.is_discharging");
 		hal_device_property_remove (d, "battery.charge_level.unit");
 		hal_device_property_remove (d, "battery.charge_level.current");
-		hal_device_property_remove (d, "battery.charge_level.maximum");
+		hal_device_property_remove (d, "battery.charge_level.last_full");
+		hal_device_property_remove (d, "battery.charge_level.design");
 		device_property_atomic_update_end ();		
 	} else {
 		device_property_atomic_update_begin ();
@@ -136,7 +137,8 @@
 		hal_device_property_set_int (d, "battery.charge_level", i.battery_percentage);
 		hal_device_property_set_string (d, "battery.charge_level.unit", "percent");
 
-		hal_device_property_set_int (d, "battery.charge_level.maximum", 100);
+		hal_device_property_set_int (d, "battery.charge_level.design", 100);
+		hal_device_property_set_int (d, "battery.charge_level.last_full", 100);
 
 		/* TODO: clean the logic below up; it appears my T41
 		 * with 2.6.10-1.1110_FC4 and acpi=off always report

Index: pmu.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/pmu.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- pmu.c	2 Mar 2005 19:22:10 -0000	1.6
+++ pmu.c	2 Mar 2005 21:51:55 -0000	1.7
@@ -96,7 +96,8 @@
 		}
 
 		hal_util_set_int_elem_from_file (d, "battery.charge_level.current", path, "", "charge", 0, 10);
-		hal_util_set_int_elem_from_file (d, "battery.charge_level.maximum", path, "", "max_charge", 0, 10);
+		hal_util_set_int_elem_from_file (d, "battery.charge_level.last_full", path, "", "max_charge", 0, 10);
+		hal_util_set_int_elem_from_file (d, "battery.charge_level.design", path, "", "max_charge", 0, 10);
 
 		device_property_atomic_update_end ();
 	} else {
@@ -106,7 +107,8 @@
 		hal_device_property_remove (d, "battery.rechargeable.is_discharging");
 		/*hal_device_property_remove (d, "battery.charge_level.unit");*/
 		hal_device_property_remove (d, "battery.charge_level.current");
-		hal_device_property_remove (d, "battery.charge_level.maximum");
+		hal_device_property_remove (d, "battery.charge_level.last_full");
+		hal_device_property_remove (d, "battery.charge_level.design");
 		device_property_atomic_update_end ();		
 	}
 




More information about the hal-commit mailing list