Felix Held submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Paul Menzel: Looks good to me, but someone else must approve Angel Pons: Looks good to me, approved
ec/starlabs/merlin: Don't report a battery capacity higher than design capacity

If B1FC (Battery Full Capacity) is higher than B1DC (Battery Design
Capacity), only report the design capacity. This handles cases where
the battery calibration is incorrect, and the battery runs out before
the OS thinks it's empty.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: Ib3e4769c809b69e0a237b5f043e6c41c12d53752
Reviewed-on: https://review.coreboot.org/c/coreboot/+/62514
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
---
M src/ec/starlabs/merlin/acpi/battery.asl
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/ec/starlabs/merlin/acpi/battery.asl b/src/ec/starlabs/merlin/acpi/battery.asl
index abdcc5b..12aaa74 100644
--- a/src/ec/starlabs/merlin/acpi/battery.asl
+++ b/src/ec/starlabs/merlin/acpi/battery.asl
@@ -34,6 +34,9 @@
Method (_BIF, 0, Serialized)
{
BPKG[1] = B1DC
+ If (B1FC >= B1DC) {
+ B1FC = B1DC
+ }
BPKG[2] = B1FC
BPKG[4] = B1DV
If (B1FC)

To view, visit change 62514. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib3e4769c809b69e0a237b5f043e6c41c12d53752
Gerrit-Change-Number: 62514
Gerrit-PatchSet: 3
Gerrit-Owner: Sean Rhodes <sean@starlabs.systems>
Gerrit-Reviewer: Andy Pont <andy.pont@sdcsystems.com>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Felix Held <felix-coreboot@felixheld.de>
Gerrit-Reviewer: Paul Menzel <paulepanter@mailbox.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged