From f11d0c341490bd484c0e8afd6a0730ae9e0ac0b7 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Thu, 14 Sep 2017 23:27:59 -0500 Subject: ec/purism/librem: fix battery present rate EC ACPI code is calculating the drain rate, but does not store it in the battery status package before returning it. Correct this omission, and set the drain rate to a preset minimum if calculated value is less. Taken from vendor firmware ACPI dump. Change-Id: I52837d5879112ab3103976bda28906fac8f880ec Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/21545 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Martin Roth Reviewed-by: Youness Alaoui --- src/ec/purism/librem/acpi/battery.asl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ec/purism/librem/acpi') diff --git a/src/ec/purism/librem/acpi/battery.asl b/src/ec/purism/librem/acpi/battery.asl index a090b7c2a8..5a4891ee87 100644 --- a/src/ec/purism/librem/acpi/battery.asl +++ b/src/ec/purism/librem/acpi/battery.asl @@ -183,6 +183,11 @@ Device (BAT) } Else { And (Local1, 0x7FFF, Local0) } + If(LLess(Local0, 0x0352)) + { + Store(0x0352, Local0) + } + Store (Local0, Index (PBST, 1)) /* * 2: BATTERY REMAINING CAPACITY -- cgit v1.2.3