battery: don't assume we are fully charged when not charging or discharging
authorRichard Hughes <hughsient@gmail.com>
Sun, 25 Jan 2009 15:05:50 +0000 (15:05 +0000)
committerLen Brown <len.brown@intel.com>
Sat, 21 Feb 2009 17:36:19 +0000 (12:36 -0500)
commit56f382a08722186623400180adbb9d1be1721cee
tree04e50eb89f1927198e5de7b1aeeaa3f29816a66b
parente83102cab0fd95d4508361b061146c978b3abd60
battery: don't assume we are fully charged when not charging or discharging

On hardware like the T61 it can take a couple of seconds for the battery
to start charging after the power is connected, and we incorrectly tell
userspace that we are fully charged, and then go back to charging.

Only mark a battery as fully charged when the preset charge matches either
the last full charge, or the design charge.

http://bugzilla.kernel.org/show_bug.cgi?id=12632

Signed-off-by: Richard Hughes <hughsient@gmail.com>
Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/battery.c