Skip to content

Commit

Permalink
mfd: Avoid tps6586x burst writes
Browse files Browse the repository at this point in the history
tps6586 does not support burst writes. i2c writes have to be
1 byte at a time.

Cc: [email protected]
Signed-off-by: Varun Wadekar <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
  • Loading branch information
[email protected] authored and Samuel Ortiz committed Mar 2, 2011
1 parent 77bd70e commit 4b57018
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/mfd/tps6586x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4b57018

Please sign in to comment.