[coreboot-gerrit] New patch to review for coreboot: ec/chromeec: correct ACPI battery data fed into ToString()
Matt DeVillier (matt.devillier@gmail.com)
gerrit at coreboot.org
Sat Dec 10 01:16:37 CET 2016
Matt DeVillier (matt.devillier at gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17782
-gerrit
commit 67ac4da8199b328d894138cf8e7f3abb0ce88afc
Author: Matt DeVillier <matt.devillier at gmail.com>
Date: Fri Dec 9 18:09:12 2016 -0600
ec/chromeec: correct ACPI battery data fed into ToString()
ToString() requires the input buffer data to be null-terminated,
but the data returned by the EC is not, leading Windows to fail
to report any battery data at all. Correct this by concatenating
a null terminator (0x00) to the end of the buffer data before
inputting to ToString()
Change-Id: I4fdbf97e9b75030374dffc99a954dd9faa6a5209
Signed-off-by: Matt DeVillier <matt.devillier at gmail.com>
---
src/ec/google/chromeec/acpi/battery.asl | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/ec/google/chromeec/acpi/battery.asl b/src/ec/google/chromeec/acpi/battery.asl
index f61e882..093ed95 100644
--- a/src/ec/google/chromeec/acpi/battery.asl
+++ b/src/ec/google/chromeec/acpi/battery.asl
@@ -114,9 +114,9 @@ Device (BAT0)
Store (Local2, Index (PBIF, 6))
// Get battery info from mainboard
- Store (ToString(BMOD), Index (PBIF, 9))
- Store (ToString(BSER), Index (PBIF, 10))
- Store (ToString(BMFG), Index (PBIF, 12))
+ Store (ToString(Concatenate(BMOD,0x00)), Index (PBIF, 9))
+ Store (ToString(Concatenate(BSER,0x00)), Index (PBIF, 10))
+ Store (ToString(Concatenate(BMFG,0x00)), Index (PBIF, 12))
Return (PBIF)
}
@@ -145,9 +145,9 @@ Device (BAT0)
Store (BTCC, Index (PBIX, 8))
// Get battery info from mainboard
- Store (ToString(BMOD), Index (PBIX, 16))
- Store (ToString(BSER), Index (PBIX, 17))
- Store (ToString(BMFG), Index (PBIX, 19))
+ Store (ToString(Concatenate(BMOD,0x00)), Index (PBIX, 16))
+ Store (ToString(Concatenate(BSER,0x00)), Index (PBIX, 17))
+ Store (ToString(Concatenate(BMFG,0x00)), Index (PBIX, 19))
Return (PBIX)
}
More information about the coreboot-gerrit
mailing list