From af4bac9e50ed7e5db76028c9efb914ca89fda6b0 Mon Sep 17 00:00:00 2001 From: Sean Rhodes Date: Wed, 2 Mar 2022 08:55:22 +0000 Subject: 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 Change-Id: Ib3e4769c809b69e0a237b5f043e6c41c12d53752 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62514 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Angel Pons --- src/ec/starlabs/merlin/acpi/battery.asl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ec/starlabs/merlin') diff --git a/src/ec/starlabs/merlin/acpi/battery.asl b/src/ec/starlabs/merlin/acpi/battery.asl index abdcc5b076..12aaa74945 100644 --- a/src/ec/starlabs/merlin/acpi/battery.asl +++ b/src/ec/starlabs/merlin/acpi/battery.asl @@ -34,6 +34,9 @@ Device (BAT0) Method (_BIF, 0, Serialized) { BPKG[1] = B1DC + If (B1FC >= B1DC) { + B1FC = B1DC + } BPKG[2] = B1FC BPKG[4] = B1DV If (B1FC) -- cgit v1.2.3