hal: Branch 'master'
Richard Hughes
hughsient at kemper.freedesktop.org
Wed Nov 1 05:13:45 PST 2006
hald/linux/acpi.c | 11 +++++++++++
1 files changed, 11 insertions(+)
New commits:
diff-tree 72cef4fedb8ab245a09826f428bb429d8c7e0371 (from b4d7405bded1c621e73fe28826dbd7df6343b05f)
Author: Richard Hughes <hughsie at hughsie-laptop.(none)>
Date: Wed Nov 1 13:13:39 2006 +0000
ignore the special ACPI 'Ones' value for rate
As discovered in : http://bugzilla.gnome.org/show_bug.cgi?id=348201
ACPI gives out the special 'Ones' value for rate when it's unable to
calculate the true rate.
We should set the rate zero, and wait for the BIOS to stabilise for the
few BIOS's that give 0xffff as the very first entry after an AC state
change.
This patch has been tested to work by Pierre Ossman.
diff --git a/hald/linux/acpi.c b/hald/linux/acpi.c
index d1bbe9b..2c59fbf 100644
--- a/hald/linux/acpi.c
+++ b/hald/linux/acpi.c
@@ -132,6 +132,17 @@ battery_refresh_poll (HalDevice *d)
"battery.reporting.rate");
/*
+ * ACPI gives out the special 'Ones' value for rate when it's unable
+ * to calculate the true rate. We should set the rate zero, and wait
+ * for the BIOS to stabilise.
+ *
+ * full details here: http://bugzilla.gnome.org/show_bug.cgi?id=348201
+ */
+ if (reporting_rate == 0xffff) {
+ reporting_rate = 0;
+ }
+
+ /*
* We are converting the unknown units into mWh because of ACPI's nature
* of not having a standard "energy" unit.
*
More information about the hal-commit
mailing list