summaryrefslogtreecommitdiff
path: root/src/ec/google
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@gmail.com>2016-12-09 18:09:12 -0600
committerNico Huber <nico.h@gmx.de>2016-12-15 14:09:23 +0100
commite34c16f9157c0438e2ff42cd3b139397d3a7be24 (patch)
treedb099c5d3918ba2b8ca180312323960aae9bdbc3 /src/ec/google
parent31be2c969eed74510c3546bad0dbb9a7334f5843 (diff)
downloadcoreboot-e34c16f9157c0438e2ff42cd3b139397d3a7be24.tar.xz
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@gmail.com> Reviewed-on: https://review.coreboot.org/17782 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/ec/google')
-rw-r--r--src/ec/google/chromeec/acpi/battery.asl12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ec/google/chromeec/acpi/battery.asl b/src/ec/google/chromeec/acpi/battery.asl
index f61e8822cb..2ed4468999 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)
}