UPSTREAM: ec/ene932: 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() where needed

BUG=None
BRANCH=None
TEST=None

Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/17783
Tested-by: build bot (Jenkins)
Reviewed-by: Nico Huber <nico.h@gmx.de>

Change-Id: Ic86048d1d6354b9b0dac3c8957df318d0825c905
Reviewed-on: https://chromium-review.googlesource.com/421167
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
This commit is contained in:
Matt DeVillier 2016-12-09 18:14:57 -06:00 committed by chrome-bot
parent 034bb73b28
commit 79d89b1369

View file

@ -84,9 +84,9 @@ Device (BATX)
Multiply(Local1, 0x03, Local1)
Store (Local1, Index (PBIF, 6))
Store (ToString(BATD), Index (PBIF, 9)) // model
Store (ToString(Concatenate(BATD, 0x00)), Index (PBIF, 9)) // model
Store (ToHexString(BSN0), Index (PBIF, 10)) // serial
Store (ToString(BMFN), Index (PBIF, 12)) // venor
Store (ToString(BMFN), Index (PBIF, 12)) // vendor
Store(BDN0, BTNM) // Save the battery number