PMU: battery charge information totally wrong

Richard Hughes hughsient at gmail.com
Tue May 8 08:59:36 PDT 2007


On Mon, 2007-05-07 at 21:46 +0200, Johannes Berg wrote:
> Hi,
> 
> g-p-m now displays a lot of statistics on the battery so when I looked
> at it I noticed that my powerbook is supposed to use less than 2W which
> is not quite reasonable :)

That's because of the excellent power saving of g-p-m ;-)

> The code says:
> 
>                 /* we don't know the unit here :-/ */
>                 /*hal_device_property_set_string (d, "battery.charge_level.unit", "percent");*/
> 
> Actually, looking at the kernel code and the proc output, it's quite
> clear that the unit is mA and mV, so the charge_level.rate would be easy
> to calculate as (voltage*amperage)/1000 [mW].

If you are totally sure, a patch would kick ass. :-)

I still want to revisit this code in a few weeks, and do a big tidyup of
the pmu/apm/acpi code like I suggested a few months ago.

Richard.




More information about the hal mailing list