From: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Wolfram Sang <w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
Luotao Fu <l.fu-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
Kevin Wells <kevin.wells-3arQi8VN3Tc@public.gmane.org>,
Ben Dooks <ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>,
Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
Subject: [PATCH] i2c/pnx: Really fix start/stop issue
Date: Sun, 18 Apr 2010 12:21:10 +0200 [thread overview]
Message-ID: <1271586070-12266-1-git-send-email-w.sang@pengutronix.de> (raw)
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
next reply other threads:[~2010-04-18 10:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-18 10:21 Wolfram Sang [this message]
[not found] ` <1271586070-12266-1-git-send-email-w.sang-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2010-04-18 11:04 ` [PATCH] i2c/pnx: Really fix start/stop issue 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1271586070-12266-1-git-send-email-w.sang@pengutronix.de \
--to=w.sang-bicnvbalz9megne8c9+irq@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=kevin.wells-3arQi8VN3Tc@public.gmane.org \
--cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
--cc=l.fu-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).