diff options
author | vwadekar@nvidia.com <vwadekar@nvidia.com> | 2011-02-23 23:48:13 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-03-02 04:57:50 -0500 |
commit | 4b57018dcd6418e18c08088c89f123da8a7bfc45 (patch) | |
tree | d45dcc4392a99546fc0e2dbd97b6219ff6d916a2 /drivers/mfd/tps6586x.c | |
parent | 77bd70e9009eab6dbdef3ee08afe87ab26df8dac (diff) |
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: Varun Wadekar <vwadekar@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/tps6586x.c')
-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 627cf577b16d..e9018d1394ee 100644 --- a/drivers/mfd/tps6586x.c +++ b/drivers/mfd/tps6586x.c | |||
@@ -150,12 +150,12 @@ static inline int __tps6586x_write(struct i2c_client *client, | |||
150 | static inline int __tps6586x_writes(struct i2c_client *client, int reg, | 150 | static inline int __tps6586x_writes(struct i2c_client *client, int reg, |
151 | int len, uint8_t *val) | 151 | int len, uint8_t *val) |
152 | { | 152 | { |
153 | int ret; | 153 | int ret, i; |
154 | 154 | ||
155 | ret = i2c_smbus_write_i2c_block_data(client, reg, len, val); | 155 | for (i = 0; i < len; i++) { |
156 | if (ret < 0) { | 156 | ret = __tps6586x_write(client, reg + i, *(val + i)); |
157 | dev_err(&client->dev, "failed writings to 0x%02x\n", reg); | 157 | if (ret < 0) |
158 | return ret; | 158 | return ret; |
159 | } | 159 | } |
160 | 160 | ||
161 | return 0; | 161 | return 0; |