Skip to content

Commit e3f2396

Browse files
committed
power: supply: sbs-battery: chromebook workaround for PEC
Looks like the I2C tunnel implementation from Chromebook's embedded controller does not handle PEC correctly. Fix this by disabling PEC for batteries behind those I2C tunnels as a workaround. Note, that some Chromebooks actually have been reported to have working PEC support (with I2C tunnel). Since the problem has not yet been fully understood this simply reverts all Chromebooks to not use PEC for now. Reported-by: "Milan P. Stanić" <[email protected]> Reported-by: Vicente Bergas <[email protected]> CC: Enric Balletbo i Serra <[email protected]> Fixes: 7222bd6 ("power: supply: sbs-battery: add PEC support") Tested-by: Vicente Bergas <[email protected]> Tested-by: "Milan P. Stanić" <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 9123e3a commit e3f2396

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/power/supply/sbs-battery.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,12 @@ static int sbs_update_presence(struct sbs_info *chip, bool is_present)
280280
else
281281
client->flags &= ~I2C_CLIENT_PEC;
282282

283+
if (of_device_is_compatible(client->dev.parent->of_node, "google,cros-ec-i2c-tunnel")
284+
&& client->flags & I2C_CLIENT_PEC) {
285+
dev_info(&client->dev, "Disabling PEC because of broken Cros-EC implementation\n");
286+
client->flags &= ~I2C_CLIENT_PEC;
287+
}
288+
283289
dev_dbg(&client->dev, "PEC: %s\n", (client->flags & I2C_CLIENT_PEC) ?
284290
"enabled" : "disabled");
285291

0 commit comments

Comments
 (0)