summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2011-02-07 19:16:12 +0530
committerNiket Sirsi <nsirsi@nvidia.com>2011-02-07 18:15:21 -0800
commit9e790983fff1c7978a850db09bdb21b82a950d0e (patch)
tree200c8d713b36582e27c349f2f4ae6adce20ed0b2
parent36de5b7823f769116875b30f4bbef2aa8f31d747 (diff)
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 <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/18561 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--drivers/mfd/tps6586x.c10
1 files 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;