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

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

CC: stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

Signed-off-by: Varun Wadekar <vwadekar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
v2: use stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org instead of stable-uzZzDNn8Jzk76Z2rM5mHXA@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] 3+ messages in thread

* Re: [PATCH v2] mfd: tps6586x: avoid burst writes
       [not found] ` <1298522893-2465-1-git-send-email-vwadekar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2011-02-28  1:23   ` Samuel Ortiz
  2011-02-28  5:03     ` Varun Wadekar
  0 siblings, 1 reply; 3+ messages in thread
From: Samuel Ortiz @ 2011-02-28  1:23 UTC (permalink / raw)
  To: vwadekar-DDmLM1+adcrQT0dZR+AlfA
  Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	ARitger-DDmLM1+adcrQT0dZR+AlfA, swarren-DDmLM1+adcrQT0dZR+AlfA,
	bnihalani-DDmLM1+adcrQT0dZR+AlfA, stable-DgEjT+Ai2ygdnm+yROfE0A

Hi,

On Thu, Feb 24, 2011 at 10:18:13AM +0530, vwadekar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org wrote:
> 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.

-- 
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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v2] mfd: tps6586x: avoid burst writes
  2011-02-28  1:23   ` Samuel Ortiz
@ 2011-02-28  5:03     ` Varun Wadekar
  0 siblings, 0 replies; 3+ messages in thread
From: Varun Wadekar @ 2011-02-28  5:03 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Andy Ritger,
	Stephen Warren, Bharat Nihalani,
	stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org


> Patch applied to my for-next and for-linus branches, thanks.
>
> Cheers,
> Samuel.
>
Thanks Samuel.
--
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	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-02-28  5:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-24  4:48 [PATCH v2] mfd: tps6586x: avoid burst writes vwadekar-DDmLM1+adcrQT0dZR+AlfA
     [not found] ` <1298522893-2465-1-git-send-email-vwadekar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-02-28  1:23   ` Samuel Ortiz
2011-02-28  5:03     ` Varun Wadekar

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