提交 e3f2396b 编写于 作者: S Sebastian Reichel 提交者: Sebastian Reichel

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: N"Milan P. Stanić" <mps@arvanta.net>
Reported-by: NVicente Bergas <vicencb@gmail.com>
CC: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Fixes: 7222bd60 ("power: supply: sbs-battery: add PEC support")
Tested-by: NVicente Bergas <vicencb@gmail.com>
Tested-by: N"Milan P. Stanić" <mps@arvanta.net>
Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
上级 9123e3a7
......@@ -280,6 +280,12 @@ static int sbs_update_presence(struct sbs_info *chip, bool is_present)
else
client->flags &= ~I2C_CLIENT_PEC;
if (of_device_is_compatible(client->dev.parent->of_node, "google,cros-ec-i2c-tunnel")
&& client->flags & I2C_CLIENT_PEC) {
dev_info(&client->dev, "Disabling PEC because of broken Cros-EC implementation\n");
client->flags &= ~I2C_CLIENT_PEC;
}
dev_dbg(&client->dev, "PEC: %s\n", (client->flags & I2C_CLIENT_PEC) ?
"enabled" : "disabled");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册