Skip to contentSkip to conversation

mfd: tps6586x: avoid burst writes

PATCH In review [email protected] 2 participants 3 messages Feb 24, 2011 – Feb 28, 2011 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mfd: tps6586x: avoid burst writes

tps6586 does not support burst writes. i2c writes have to be 1 byte at a time.

---
v2: use [email protected] instead of [email protected]

 drivers/mfd/tps6586x.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/mfd/tps6586x.c +5 -5
index c937742..0aa9186 100644
@@ -150,12 +150,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;
Signature · 6 lines
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1298522893-2465-1-git-send-email-vwadekar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org

#2 lore raw

Hi,

Quoted 2 lines · On Thu, Feb 24, 2011 at 10:18:13AM +0530…

tps6586 does not support burst writes. i2c writes have to be 1 byte at a time.

Patch applied to my for-next and for-linus branches, thanks.

Cheers,
Samuel.

Signature · 6 lines
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html