mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-01 09:13:37 +00:00
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>
This commit is contained in:
parent
77bd70e900
commit
4b57018dcd
1 changed files with 5 additions and 5 deletions
|
|
@ -150,12 +150,12 @@ static inline int __tps6586x_write(struct i2c_client *client,
|
||||||
static inline int __tps6586x_writes(struct i2c_client *client, int reg,
|
static inline int __tps6586x_writes(struct i2c_client *client, int reg,
|
||||||
int len, uint8_t *val)
|
int len, uint8_t *val)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret, i;
|
||||||
|
|
||||||
ret = i2c_smbus_write_i2c_block_data(client, reg, len, val);
|
for (i = 0; i < len; i++) {
|
||||||
if (ret < 0) {
|
ret = __tps6586x_write(client, reg + i, *(val + i));
|
||||||
dev_err(&client->dev, "failed writings to 0x%02x\n", reg);
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue