UPSTREAM: ec/ene_kb3940q: 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
TEST: boot Windows on google/butterfly, observe battery data
reported correctly.
BUG=none
BRANCH=none
TEST=none
Change-Id: I4b79699fd993574addaf1a8cc0dfdb43e1f575b5
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: af4c0a431c
Original-Change-Id: I395cc7fbdf26c8cc816e47107e552c0533580fa1
Original-Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/19961
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://chromium-review.googlesource.com/523979
This commit is contained in:
parent
7ad8df0c30
commit
4341234ca4
1 changed files with 2 additions and 2 deletions
|
|
@ -90,9 +90,9 @@ Device (BATX)
|
|||
Store(Local0, Index(PBIF, 5))
|
||||
Multiply(Local1, 0x05, Local0)
|
||||
Store (Local0, Index (PBIF, 6))
|
||||
Store (ToString(BATD), Index (PBIF, 9)) // Model Number
|
||||
Store (ToString(Concatenate(BATD, 0x00)), Index (PBIF, 9)) // Model Number
|
||||
Store (ToDecimalString(BSN0), Index (PBIF, 10)) // Serial Number
|
||||
Store (ToString(BCHM), Index (PBIF, 11)) // Battery Type
|
||||
Store (ToString(Concatenate(BCHM, 0x00)), Index (PBIF, 11)) // Battery Type
|
||||
Store (\BATV, Index (PBIF, 12)) // OEM information
|
||||
|
||||
Return (PBIF)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue