linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c/pnx: Really fix start/stop issue
@ 2010-04-18 10:21 Wolfram Sang
       [not found] ` <1271586070-12266-1-git-send-email-w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Wolfram Sang @ 2010-04-18 10:21 UTC (permalink / raw)
  To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
  Cc: Wolfram Sang, Luotao Fu, Kevin Wells, Ben Dooks, Jean Delvare

The issue was truly solved by the second patch in this thread:

http://thread.gmane.org/gmane.linux.drivers.i2c/5436

Accidently, the first one was picked up. So, this patch adds the
remaining diff (and an additional newline).

Signed-off-by: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Luotao Fu <l.fu-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Cc: Kevin Wells <kevin.wells-3arQi8VN3Tc@public.gmane.org>
Cc: Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
Cc: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
---

Jean, can you pick this up, so it will be correct in 2.6.34?

 drivers/i2c/busses/i2c-pnx.c |    7 ++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
index 2471033..0853ee1 100644
--- a/drivers/i2c/busses/i2c-pnx.c
+++ b/drivers/i2c/busses/i2c-pnx.c
@@ -173,6 +173,10 @@ static int i2c_pnx_master_xmit(struct i2c_pnx_algo_data *alg_data)
 		/* We still have something to talk about... */
 		val = *alg_data->mif.buf++;
 
+		/* last byte of a message */
+		if (alg_data->mif.len == 1)
+			val |= stop_bit;
+
 		alg_data->mif.len--;
 		iowrite32(val, I2C_REG_TX(alg_data));
 
@@ -246,6 +250,9 @@ static int i2c_pnx_master_rcv(struct i2c_pnx_algo_data *alg_data)
 			__func__);
 
 		if (alg_data->mif.len == 1) {
+			/* Last byte, do not acknowledge next rcv. */
+			val |= stop_bit;
+
 			/*
 			 * Enable interrupt RFDAIE (data in Rx fifo),
 			 * and disable DRMIE (need data for Tx)
-- 
1.7.0

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

end of thread, other threads:[~2010-04-20 17:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-18 10:21 [PATCH] i2c/pnx: Really fix start/stop issue Wolfram Sang
     [not found] ` <1271586070-12266-1-git-send-email-w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-04-18 11:04   ` Jean Delvare
     [not found]     ` <20100418130457.0341efce-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2010-04-18 11:40       ` Wolfram Sang
     [not found]         ` <20100418114021.GA21364-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-04-18 16:53           ` Ben Dooks
     [not found]             ` <20100418165306.GB2234-SMNkleLxa3Z6Wcw2j4pizdi2O/JbrIOy@public.gmane.org>
2010-04-18 22:40               ` Wolfram Sang
2010-04-19 16:59               ` Kevin Wells
     [not found]                 ` <083DF309106F364B939360100EC290F80979C8121C-SIPbe8o7cfX8DdpCu65jn8FrZmdRls4ZQQ4Iyu8u01E@public.gmane.org>
2010-04-19 23:52                   ` Ben Dooks
2010-04-20  0:15           ` Ben Dooks
     [not found]             ` <20100420001536.GL32401-elnMNo+KYs3pIgCt6eIbzw@public.gmane.org>
2010-04-20  7:16               ` Wolfram Sang
     [not found]                 ` <20100420071629.GI19957-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-04-20 17:23                   ` Kevin Wells
2010-04-20  0:03   ` Ben Dooks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).