diff options
author | Hans de Goede <[email protected]> | 2018-08-12 12:53:20 +0200 |
---|---|---|
committer | Wolfram Sang <[email protected]> | 2018-08-20 14:08:59 +0200 |
commit | c463a158cb6c5d9a85b7d894cd4f8116e8bd6be0 (patch) | |
tree | 79409b9768a4d61566854458924ede06441b4198 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 0857f50807709ae109b9d11d7ca88c44dc7ca99f (diff) |
i2c: core: ACPI: Properly set status byte to 0 for multi-byte writes
acpi_gsb_i2c_write_bytes() returns i2c_transfer()'s return value, which
is the number of transfers executed on success, so 1.
The ACPI code expects us to store 0 in gsb->status for success, not 1.
Specifically this breaks the following code in the Thinkpad 8 DSDT:
ECWR = I2CW = ECWR /* \_SB_.I2C1.BAT0.ECWR */
If ((ECST == Zero))
{
ECRD = I2CR /* \_SB_.I2C1.I2CR */
}
Before this commit we set ECST to 1, causing the read to never happen
breaking battery monitoring on the Thinkpad 8.
This commit makes acpi_gsb_i2c_write_bytes() return 0 when i2c_transfer()
returns 1, so the single write transfer completed successfully, and
makes it return -EIO on for other (unexpected) return values >= 0.
Cc: [email protected]
Signed-off-by: Hans de Goede <[email protected]>
Acked-by: Mika Westerberg <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions