From 9e790983fff1c7978a850db09bdb21b82a950d0e Mon Sep 17 00:00:00 2001 From: Varun Wadekar Date: Mon, 7 Feb 2011 19:16:12 +0530 Subject: mfd: tps6586x: avoid burst writes tps6586 does not support burst writes. i2c writes have to be 1 byte at a time. Change-Id: Iaf4fd9a3c1b983a3bb9a1ef680e03b14a69d736b Signed-off-by: Varun Wadekar Reviewed-on: http://git-master/r/18561 Reviewed-by: Bharat Nihalani --- drivers/mfd/tps6586x.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c index e2d8c80bc02e..851049b38a6d 100644 --- a/drivers/mfd/tps6586x.c +++ b/drivers/mfd/tps6586x.c @@ -154,12 +154,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; -- cgit v1.2.3