* [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[parent not found: <1297764222-29803-1-git-send-email-vwadekar-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] mfd: tps6586x: avoid burst writes [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> 0 siblings, 1 reply; 4+ messages in thread From: Mark Brown @ 2011-02-17 1:52 UTC (permalink / raw) To: vwadekar-DDmLM1+adcrQT0dZR+AlfA Cc: sameo-VuQAYsv1563Yd54FQh9/CA, linux-tegra-u79uwXL29TY76Z2rM5mHXA, ARitger-DDmLM1+adcrQT0dZR+AlfA, swarren-DDmLM1+adcrQT0dZR+AlfA, bnihalani-DDmLM1+adcrQT0dZR+AlfA On Tue, Feb 15, 2011 at 03:33:42PM +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. Don't know if there's ever block writes big enough to care but presumably some of the devices in this series do support this so perhaps the fallback to byte at a time should be conditional to avoid hurting those that can use block writes? -- 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] 4+ messages in thread
[parent not found: <20110217015216.GE5824-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>]
* Re: [PATCH] mfd: tps6586x: avoid burst writes [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> 0 siblings, 1 reply; 4+ messages in thread From: Varun Wadekar @ 2011-02-18 4:45 UTC (permalink / raw) To: Mark Brown Cc: sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Andy Ritger, Stephen Warren, Bharat Nihalani > Don't know if there's ever block writes big enough to care but > presumably some of the devices in this series do support this so perhaps > the fallback to byte at a time should be conditional to avoid hurting > those that can use block writes? Mark, confirmed with TI and they say that the entire tps6586x family has this behavior so this patch seems ok. The entire family has this limitation and so we have to write one byte at a time. -- 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] 4+ messages in thread
[parent not found: <4D5DF973.8080908-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH] mfd: tps6586x: avoid burst writes [not found] ` <4D5DF973.8080908-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> @ 2011-02-18 18:43 ` Mark Brown 0 siblings, 0 replies; 4+ messages in thread From: Mark Brown @ 2011-02-18 18:43 UTC (permalink / raw) To: Varun Wadekar Cc: sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Andy Ritger, Stephen Warren, Bharat Nihalani On Fri, Feb 18, 2011 at 10:15:39AM +0530, Varun Wadekar wrote: > Mark, confirmed with TI and they say that the entire tps6586x family has > this behavior so this patch seems ok. The entire family has this > limitation and so we have to write one byte at a time. OK, that's good to have confirmed - in that case this should go into 2.6.38 as a bugfix since clearly any device which tries to do a bulk operation is broken at the minute. -- 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] 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