summaryrefslogtreecommitdiff
path: root/src/mainboard/51nb/x210
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@gmail.com>2020-02-26 13:10:17 -0600
committerPatrick Georgi <pgeorgi@google.com>2020-03-16 14:42:38 +0000
commit01b6b245f00a3fb498f43c8d59e144c86a51c84a (patch)
treebb49634be28aebd8c84a77bafcfa52a312126d36 /src/mainboard/51nb/x210
parent75afc79aae192629c66e0472a6f365f566be8412 (diff)
downloadcoreboot-01b6b245f00a3fb498f43c8d59e144c86a51c84a.tar.xz
mb/51nb/x210: correct battery ACPI
The X210 EC reports battery values in broken mAh. These have to be adjusted by 10000 * DGVO, as documented in https://github.com/torvalds/linux/blob/master/drivers/acpi/battery.c. Taken from https://github.com/harrykipper/coreboot, commits 2f68f138adb25605e5715896636cf33f6de5bd95 c1c72cc43708a6647f263a767c39cf3072908e20 Change-Id: Ie097272443b18b16c3937034f874d3b5a6bdd62a Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/39142 Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/51nb/x210')
-rw-r--r--src/mainboard/51nb/x210/acpi/battery.asl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mainboard/51nb/x210/acpi/battery.asl b/src/mainboard/51nb/x210/acpi/battery.asl
index 9064ad5cee..25a2b01928 100644
--- a/src/mainboard/51nb/x210/acpi/battery.asl
+++ b/src/mainboard/51nb/x210/acpi/battery.asl
@@ -38,16 +38,16 @@ Device (BAT)
Method (_BIF, 0, Serialized)
{
/* Design Capacity */
- Store (DGCP, Index (PBIF, 1))
+ Store (DGCP * 10000 / DGVO, Index (PBIF, 1))
/* Last Full Charge Capacity */
- Store (FLCP, Index (PBIF, 2))
+ Store (FLCP * 10000 / DGVO, Index (PBIF, 2))
/* Design Voltage */
Store (DGVO, Index (PBIF, 4))
/* Design Capacity of Warning */
- Store (BDW, Index (PBIF, 5))
+ Store (BDW * 10000 / DGVO, Index (PBIF, 5))
/* Design Capacity of Low */
Store (BDL, Index (PBIF, 6))
@@ -81,7 +81,7 @@ Device (BAT)
/*
* 2: BATTERY REMAINING CAPACITY
*/
- Store (BRC, Index (PBST, 2))
+ Store (BRC * 10000 / DGVO, Index (PBST, 2))
/*
* 3: BATTERY PRESENT VOLTAGE