summaryrefslogtreecommitdiff
path: root/src/ec/purism/librem
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@gmail.com>2017-09-14 23:27:59 -0500
committerMartin Roth <martinroth@google.com>2017-09-19 14:11:07 +0000
commitf11d0c341490bd484c0e8afd6a0730ae9e0ac0b7 (patch)
tree7a0a8e24eed6acd35f4e0311a8ace67887c670f7 /src/ec/purism/librem
parentd7e0cb93ae8ead42aa20dd4dcafa137fc28653bc (diff)
downloadcoreboot-f11d0c341490bd484c0e8afd6a0730ae9e0ac0b7.tar.xz
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 <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/21545 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Youness Alaoui <snifikino@gmail.com>
Diffstat (limited to 'src/ec/purism/librem')
-rw-r--r--src/ec/purism/librem/acpi/battery.asl5
1 files changed, 5 insertions, 0 deletions
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