summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/thinkpad_acpi.c
diff options
context:
space:
mode:
authorLaszlo Toth <laszlth@gmail.com>2018-02-24 10:20:15 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-02-27 17:17:11 +0100
commita20136a67a995cd5b74e8c0fcb3b2f2e5b2848dd (patch)
tree7daabf42ed2d71c9966492595148993b93810998 /drivers/platform/x86/thinkpad_acpi.c
parent514bcc5dfa69d64f7772cb6442721b9d1b83504d (diff)
ACPI: battery: do not export degraded capacity values over 100
With a degraded battery, full_charge_capacity can be less than design_capacity, however it's not sure that capacity_now's max will follow. Example from an affected machine: /sys/class/power_supply/BAT0/charge_full -> 4290000 /sys/class/power_supply/BAT0/charge_full_design -> 5900000 /sys/class/power_supply/BAT0/charge_now -> 5900000 /sys/class/power_supply/BAT0/capacity -> 137 The battery is a degraded one with a full charge, and charge_now is the value of charge_full_design instead of charge_full. Added a new quirk to test and correct this, and a new function to check if the battery is a degraded one or not. This keeps the possibility to be over 100 if it's really the case. Signed-off-by: Laszlo Toth <laszlth@gmail.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/platform/x86/thinkpad_acpi.c')
0 files changed, 0 insertions, 0 deletions