]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Correct the way remaining battery life is calculated
authorAllan Jude <allanjude@FreeBSD.org>
Tue, 21 May 2019 21:14:22 +0000 (21:14 +0000)
committerAllan Jude <allanjude@FreeBSD.org>
Tue, 21 May 2019 21:14:22 +0000 (21:14 +0000)
commit594d1c7235ecf666193b17396844f2ec235ba566
tree58f4a12c220615c488a18e6f9b721d9153564ae5
parentdaec92844e8fef4d0a629c70443043691e59530c
Correct the way remaining battery life is calculated

Previously, if a system had multiple batteries, the remaining life
percentage was calculated as the average of each battery's percent
remaining. This results in rather incorrect values when you consider the
case of the Thinkpad X270 that has a small 3 cell internally battery, and
a hot-swappable 9 cell battery that is used first. Battery 0 is at 100%,
but battery 1 is at 10%, you do not infact have 55% of your capacity
remaining.

The new method calculates the percentage based on remaining capacity
out of total capacity, giving a much more accurate reading.

PR: 229818
Submitted by: Keegan Drake H.P. <kd-dev@pm.me>
MFC after: 2 weeks
Sponsored by: Klara Systems
Event: Waterloo Hackathon 2019
sys/dev/acpica/acpi_battery.c