aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
authorHector Martin <hector@marcansoft.com>2009-08-06 15:57:48 -0700
committerLen Brown <len.brown@intel.com>2009-08-29 21:39:54 -0400
commitbc76f90b8a5cf4aceedf210d08d5e8292f820cec (patch)
tree70f5a96bd5b901a4e275dc57ae3ca1d37663338b /drivers/acpi/scan.c
parent326ba5010a5429a5a528b268b36a5900d4ab0eba (diff)
ACPI battery: work around negative s16 battery current on Acer
Acer Aspire 8930G laptops (and possibly others) report 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. The patch also detects the valid 32-bit value -1, which indicates unknown status, and does not attempt the fix in that case (note that this does not conflict with 16-bit -1, which is 65535 as read normally and gets translated to 1mA). Signed-off-by: Hector Martin <hector@marcansoft.com> Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/scan.c')
0 files changed, 0 insertions, 0 deletions