public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: tps6586x: avoid burst writes
@ 2011-02-15 10:03 vwadekar-DDmLM1+adcrQT0dZR+AlfA
       [not found] ` <1297764222-29803-1-git-send-email-vwadekar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: vwadekar-DDmLM1+adcrQT0dZR+AlfA @ 2011-02-15 10:03 UTC (permalink / raw)
  To: sameo-VuQAYsv1563Yd54FQh9/CA
  Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	ARitger-DDmLM1+adcrQT0dZR+AlfA, swarren-DDmLM1+adcrQT0dZR+AlfA,
	bnihalani-DDmLM1+adcrQT0dZR+AlfA, Varun Wadekar

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

Signed-off-by: Varun Wadekar <vwadekar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 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 c937742..0aa9186 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -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;
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-18 18:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-15 10:03 [PATCH] mfd: tps6586x: avoid burst writes vwadekar-DDmLM1+adcrQT0dZR+AlfA
     [not found] ` <1297764222-29803-1-git-send-email-vwadekar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-02-17  1:52   ` Mark Brown
     [not found]     ` <20110217015216.GE5824-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2011-02-18  4:45       ` Varun Wadekar
     [not found]         ` <4D5DF973.8080908-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-02-18 18:43           ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox