[ltp] Re: Generic battery interface

Marek Wawrzyczny linux-thinkpad@linux-thinkpad.org
Wed, 2 Aug 2006 17:46:13 +1000


On Wednesday 02 August 2006 17:18, Jean Delvare wrote:
> Hi Pavel,
>
> > > frequently it can read from the chip. And no hardware monitoring chip I
> > > know of can tell when the monitored value has changed - you have to
> > > read the chip registers to know.
> >
> > ACPI battery can tell when values change in significant way. (Like
> > battery becoming critical).
>
> Ah, good to know. But is there a practical use for this? I'd suspect
> that the user wants to know the battery charge% all the time anyway,
> critical or not.

Yes, the user may want to know the battery state all the time, but will not 
notice the difference between the system reporting battery changes every 100 
microseconds or every 10 seconds, unless the hardware eats its battery 
sources for breakfast? 

The system cares though, very much so in fact:

If the battery becomes critical the system should either shut down or suspend 
to disk (if this is supported). 
This obviously would be triggered by some sort of daemon (powersaved comes to 
mind).
Ideally the suspend to disk or shutdown event triggers another event that 
allows any desktop to save it's state or possibly unmount shares that could 
otherwise be corrupted.

This scenario is quite different to an application reading the battery level.


Marek Wawrzyczny