提交 4b57018d 编写于 作者: V vwadekar@nvidia.com 提交者: Samuel Ortiz

mfd: Avoid tps6586x burst writes

tps6586 does not support burst writes. i2c writes have to be
1 byte at a time.

Cc: stable@kernel.org
Signed-off-by: NVarun Wadekar <vwadekar@nvidia.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 77bd70e9
......@@ -150,12 +150,12 @@ static inline int __tps6586x_write(struct i2c_client *client,
static inline int __tps6586x_writes(struct i2c_client *client, int reg,
int len, uint8_t *val)
{
int ret;
int ret, i;
ret = i2c_smbus_write_i2c_block_data(client, reg, len, val);
if (ret < 0) {
dev_err(&client->dev, "failed writings to 0x%02x\n", reg);
return ret;
for (i = 0; i < len; i++) {
ret = __tps6586x_write(client, reg + i, *(val + i));
if (ret < 0)
return ret;
}
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册