]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ACPI battery: support percentage battery remaining capacity
authorZhang Rui <rui.zhang@intel.com>
Fri, 22 Oct 2010 02:02:06 +0000 (10:02 +0800)
committerAndi Kleen <ak@linux.intel.com>
Tue, 14 Dec 2010 22:40:14 +0000 (23:40 +0100)
commit1e8d602368391f61481052600a6174eb049582a9
tree1a59ec99b519aa261728a7d9243f38579ec3abd5
parente34d1f648f557f496649f35ca11663cad59e0cc2
ACPI battery: support percentage battery remaining capacity

commit 557d58687dcdee6bc00c1a8f1fd4e0eac8fefce9 upstream.

According to the ACPI spec, some kinds of primary battery can
report percentage battery remaining capacity directly to OS.

In this case, it reports the LastFullChargedCapacity == 100,
BatteryPresentRate = 0xFFFFFFFF, and BatteryRemaingCapacity a
percentage value, which actually means RemainingBatteryPercentage.

Now we found some battery follows this rule even if it's a rechargeable.
https://bugzilla.kernel.org/show_bug.cgi?id=15979

Handle these batteries correctly in ACPI battery driver
so that they won't break userspace.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Sitsofe Wheeler <sitsofe@yahoo.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
drivers/acpi/battery.c