diff options
author | 2018-02-24 10:20:15 +0100 | |
---|---|---|
committer | 2018-02-27 17:17:11 +0100 | |
commit | a20136a67a995cd5b74e8c0fcb3b2f2e5b2848dd (patch) | |
tree | 7daabf42ed2d71c9966492595148993b93810998 /net/unix/af_unix.c | |
parent | ACPI: battery: make function __battery_hook_unregister() static (diff) | |
download | wireguard-linux-a20136a67a995cd5b74e8c0fcb3b2f2e5b2848dd.tar.xz wireguard-linux-a20136a67a995cd5b74e8c0fcb3b2f2e5b2848dd.zip |
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 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions