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>
This commit is contained in:
Matt DeVillier 2017-09-14 23:27:59 -05:00 committed by Martin Roth
parent d7e0cb93ae
commit f11d0c3414
1 changed files with 5 additions and 0 deletions

View File

@ -183,6 +183,11 @@ Device (BAT)
} Else { } Else {
And (Local1, 0x7FFF, Local0) And (Local1, 0x7FFF, Local0)
} }
If(LLess(Local0, 0x0352))
{
Store(0x0352, Local0)
}
Store (Local0, Index (PBST, 1))
/* /*
* 2: BATTERY REMAINING CAPACITY * 2: BATTERY REMAINING CAPACITY