linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shubhrajyoti Datta <omaplinuxkernel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Yegor Yefremov <yegorslists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
Cc: "Datta, Shubhrajyoti" <shubhrajyoti-l0cyMroinI0@public.gmane.org>,
	Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>,
	Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: OMAP: send i2c message ignoring NAK
Date: Tue, 17 Jul 2012 19:31:27 +0530	[thread overview]
Message-ID: <CAM=Q2ct_mfGiuKrX9KAuk7B+PA==FRL7DPOfge9fRAuFg6bA3Q@mail.gmail.com> (raw)
In-Reply-To: <CAGm1_ktYqq5HKt13RuQVL8axX0FUnZ_5a6va7BRuUschQRKERQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Tue, Jul 17, 2012 at 3:01 PM, Yegor Yefremov
<yegorslists-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
> On Thu, Jul 12, 2012 at 7:24 AM, Datta, Shubhrajyoti
> <shubhrajyoti-l0cyMroinI0@public.gmane.org> wrote:
[...]
>> On Wed, Jul 11, 2012 at 10:22 PM, Shubhrajyoti <shubhrajyoti-l0cyMroinI0@public.gmane.org> wrote:


>
> Thank you for the patch and sorry for delay. I tried the patch,

Thanks for the test.

> but it doesn't help. I still get timeouts only. I fear it is really a
> hardware feature,

I feel that could be unlikely.

> that OMAPs i2c stops if address is not acknowledged.
> At least this is my understanding of the reference manual.
>
> Here is the output from dmesg:


Another request. Can you disable the NACK interrupt on the ignore and
enable back?

Also let me know if you know of any of the panda or sdp peripherals
which could keep going on
NACK.

patch below.

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 801df60..82e52a5 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -523,6 +523,11 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
 	if (msg->len == 0)
 		return -EINVAL;

+	if (msg->flags == I2C_M_IGNORE_NAK) {
+		dev->iestate = dev->iestate &  ~OMAP_I2C_IE_NACK ;
+		omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
+	}
+
 	omap_i2c_write_reg(dev, OMAP_I2C_SA_REG, msg->addr);

 	/* REVISIT: Could the STB bit of I2C_CON be used with probing? */
@@ -584,6 +589,10 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
 	 */
 	r = wait_for_completion_timeout(&dev->cmd_complete,
 					OMAP_I2C_TIMEOUT);
+	if (msg->flags == I2C_M_IGNORE_NAK) {
+		dev->iestate = dev->iestate | OMAP_I2C_IE_NACK ;
+		omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
+	}
 	dev->buf_len = 0;
 	if (r < 0)
 		return r;

  parent reply	other threads:[~2012-07-17 14:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-03  8:12 OMAP: send i2c message ignoring NAK Yegor Yefremov
     [not found] ` <CAGm1_ktL96X7kF3tvKErtirwnL7FGU=zGe+EyhX4GcUkZUeSkQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-03  8:32   ` Jean Delvare
     [not found]     ` <20120703103221.62fcb7ae-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-07-10 14:59       ` Yegor Yefremov
     [not found]         ` <CAGm1_kvBerv_Ot-NX2+ozZT3y+h4ECzwb-MM0-v=3M9aRRznzA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-10 15:08           ` Shubhrajyoti Datta
     [not found]             ` <CAM=Q2cv2yCEaxjSL45PSpf8k8pgMuhr88TJ-RWc0OW1GL+n6Dg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-11 16:23               ` Yegor Yefremov
     [not found]                 ` <CAGm1_kvLwj3iFz5M6zc+pitS_45OYPYw=aBU4bv8TdOhH600NA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-11 16:52                   ` Shubhrajyoti
     [not found]                     ` <4FFDAF5A.8070205-l0cyMroinI0@public.gmane.org>
2012-07-12  5:24                       ` Datta, Shubhrajyoti
     [not found]                         ` <CANQgH-YxYY7M6o4Hxw0kq9=GSwF8TSgiobXLJoPnGhj=c3w4KQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-17  9:31                           ` Yegor Yefremov
     [not found]                             ` <CAGm1_ktYqq5HKt13RuQVL8axX0FUnZ_5a6va7BRuUschQRKERQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-17 14:01                               ` Shubhrajyoti Datta [this message]
     [not found]                                 ` <CAM=Q2ct_mfGiuKrX9KAuk7B+PA==FRL7DPOfge9fRAuFg6bA3Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-19 13:05                                   ` Yegor Yefremov
     [not found]                                     ` <CAGm1_ktVXmEBZz90_SMB+WmZGax5DwoXD5pr66Dja=8QW1QcGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-19 13:26                                       ` Shubhrajyoti
2012-07-11 16:52                   ` Shubhrajyoti

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='CAM=Q2ct_mfGiuKrX9KAuk7B+PA==FRL7DPOfge9fRAuFg6bA3Q@mail.gmail.com' \
    --to=omaplinuxkernel-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=shubhrajyoti-l0cyMroinI0@public.gmane.org \
    --cc=yegorslists-gM/Ye1E23mwN+BqQ9rBEUg@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).