Commit graph

5 commits

Author SHA1 Message Date
Anton Vorontsov
2a721dfc8c apm_power: calculate to_full/to_empty time using energy
This patch adds ability to calculate time using energy.
Needed to calculate time_to_full for PMU batteries.

Signed-off-by: Anton Vorontsov <cbou@mail.ru>
2007-10-05 01:05:00 +04:00
Anton Vorontsov
d385376f0d apm_power: improve battery finding algorithm
Prior to this patch, if use_for_apm unspecified, apm_power able
to choice batteries according to their charge only.

This patch adds ability to choice batteries according to their charge,
energy, use_for_apm flag, and fallback to any battery if it failed to
decide.

Patch is mandatory to report Apple PMU batteries through legacy
/proc/apm interface using power supply class.

Signed-off-by: Anton Vorontsov <cbou@mail.ru>
2007-10-05 01:05:00 +04:00
Anton Vorontsov
cd1ebcc0ef apm_power: fix obviously wrong logic for time reporting
Prior to this patch, apm_power was unable to report "to empty"/"to full"
time for batteries that hardware-report these values, such as
Apple PMU batteries.

Signed-off-by: Anton Vorontsov <cbou@mail.ru>
2007-10-05 01:04:59 +04:00
Anton Vorontsov
7b3d54a8c3 Power supply class and drivers: remove non obligatory return statements
Per Jeff Garzik request.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
2007-07-15 22:32:38 +04:00
Anton Vorontsov
3788ec932b [BATTERY] APM emulation driver for class batteries
Signed-off-by: Eugeny Boger <eugenyboger@dgap.mipt.ru>
Signed-off-by: Anton Vorontsov <cbou@mail.ru>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2007-07-10 11:26:08 +01:00