linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Weitzel <j.weitzel@phytec.de>
To: linux-omap@vger.kernel.org, b-cousson@ti.com,
	andy.green@linaro.org, patches@linaro.org
Cc: andy@warmcat.com, tony@atomide.com, peter.maydell@linaro.org,
	khilman@ti.com, Jan Weitzel <j.weitzel@phytec.de>
Subject: [RFC] ARM: OMAP2+ i2c NACK without STP
Date: Tue, 14 Jun 2011 12:05:59 +0200	[thread overview]
Message-ID: <1308045959-24269-1-git-send-email-j.weitzel@phytec.de> (raw)
In-Reply-To: <87oc30t81u.fsf@ti.com>

On OMAP4 OMAP_I2C_STAT_NACK is causing a timeout on the next access.
The isr cleans all flags in OMAP_I2C_CON_REG by setting OMAP_I2C_CON_STP
OMAP_I2C_CON_STP is also set in omap_i2c_xfer_msg on the last message.

According to the TI TSR the sequence for OMAP_I2C_STAT_NACK and
OMAP_I2C_STAT_AL are nearly the same.
Removing the OMAP_I2C_CON_STP part in the isr fix the problem.
Tested on OMAP4430 and OMAP3530 (here NACK was not a problem)

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
---
 drivers/i2c/busses/i2c-omap.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 58a58c7..670f2a2 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -836,11 +836,9 @@ complete:
 				~(OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR |
 				OMAP_I2C_STAT_XRDY | OMAP_I2C_STAT_XDR));
 
-		if (stat & OMAP_I2C_STAT_NACK) {
+		if (stat & OMAP_I2C_STAT_NACK)
 			err |= OMAP_I2C_STAT_NACK;
-			omap_i2c_write_reg(dev, OMAP_I2C_CON_REG,
-					   OMAP_I2C_CON_STP);
-		}
+
 		if (stat & OMAP_I2C_STAT_AL) {
 			dev_err(dev->dev, "Arbitration lost\n");
 			err |= OMAP_I2C_STAT_AL;
-- 
1.7.0.4


  reply	other threads:[~2011-06-14 10:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-21 11:47 [PATCH] ARM: omap4: i2c reset regs postidle Jan Weitzel
2011-04-21 12:13 ` Andy Green
2011-05-16  7:56   ` Jan Weitzel
2011-05-16  8:13     ` Andy Green
2011-05-16  9:18       ` [PATCH v2] " Jan Weitzel
2011-05-16 17:16         ` Cousson, Benoit
2011-05-17  9:26           ` [PATCH v3] " Jan Weitzel
2011-05-17 14:12             ` Kevin Hilman
2011-05-18 13:07               ` Jan Weitzel
2011-05-18 14:09                 ` Kevin Hilman
2011-06-14 10:05                   ` Jan Weitzel [this message]
2011-06-14 10:24                     ` [RFC] ARM: OMAP2+ i2c NACK without STP Tony Lindgren
     [not found]                       ` <20110614102409.GN3352-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
2011-06-14 10:54                         ` [PATCH] " Jan Weitzel
2011-12-27 14:48                           ` T Krishnamoorthy, Balaji
     [not found]                             ` <CANrkHUZ530H+0+YKy2QJPFbwUQ1zqD=OaSrF6ByTbpx6eU421Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-04  0:07                               ` Kevin Hilman

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=1308045959-24269-1-git-send-email-j.weitzel@phytec.de \
    --to=j.weitzel@phytec.de \
    --cc=andy.green@linaro.org \
    --cc=andy@warmcat.com \
    --cc=b-cousson@ti.com \
    --cc=khilman@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=tony@atomide.com \
    /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).