Bug 13687
Summary: | [PATCH] Work around negative s16 battery current on Acer | ||
---|---|---|---|
Product: | ACPI | Reporter: | Hector Martin (marcan) |
Component: | Power-Battery | Assignee: | acpi_power-battery |
Status: | CLOSED CODE_FIX | ||
Severity: | normal | CC: | akpm, lenb, rui.zhang |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.29 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
Add battery quirk to interpret current as s16
Add battery quirk to interpret current as s16 |
Created attachment 22170 [details]
Add battery quirk to interpret current as s16
Add missing Signed-off-by.
erk, please don't send patches via bugzilla. Please email the patch as per Documentation/SubmittingPatches to Alexey Starikovskiy <astarikovskiy@suse.de> Len Brown <lenb@kernel.org> linux-acpi@vger.kernel.org Andrew Morton <akpm@linux-foundation.org> Thanks. My apologies. I had read the following page where it is mentioned that bugzilla is an option for submitting patches. http://www.lesswatts.org/projects/acpi/submitting-patches.php E-mail sent. Patch has been sent to acpi mail list commit bc76f90b8a5cf4aceedf210d08d5e8292f820cec Author: Hector Martin <hector@marcansoft.com> Date: Thu Aug 6 15:57:48 2009 -0700 ACPI battery: work around negative s16 battery current on Acer is in the acpi-test tree, staged for 2.6.32 shipped in 2.6.32-rc1 closed. |
Created attachment 22169 [details] Add battery quirk to interpret current as s16 My Acer Aspire 8930G laptop reports the battery current as a 16-bit signed negative when it is charging. It also reports it as 0x10000 when the current is 0. This patch adds a quirk for this which takes the absolute value of the reported current cast to an s16. This is a DSDT bug present in the latest BIOS revision (the EC register is 16 bits signed and the DSDT attempts to take the 16-bit two's complement of this, which works for discharge but not charge. It also breaks zero values because a 32-bit register is used and the high bits aren't thrown away). I've enabled this for all Acer systems which report in mA units. This should be safe since it won't break compliant systems unless they report a current above 32A, which is insane.