diff options
author | vwadekar@nvidia.com <vwadekar@nvidia.com> | 2011-02-24 10:18:13 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-03-07 15:05:17 -0800 |
commit | 588a737af5a60c380136bb6e400ca29a6ad0e216 (patch) | |
tree | 136f27c1136180cba60531ade43e032c9d44ecbe /drivers | |
parent | 29b37a14b0197d9d62e1886adaefd16f83b5b5f5 (diff) |
mfd: Avoid tps6586x burst writes
commit 4b57018dcd6418e18c08088c89f123da8a7bfc45 upstream.
tps6586 does not support burst writes. i2c writes have to be
1 byte at a time.
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mfd/tps6586x.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c index b4931ab3492..31882f63225 100644 --- a/drivers/mfd/tps6586x.c +++ b/drivers/mfd/tps6586x.c @@ -152,12 +152,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; |