From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shubhrajyoti Datta Subject: Re: OMAP: send i2c message ignoring NAK Date: Tue, 17 Jul 2012 19:31:27 +0530 Message-ID: References: <20120703103221.62fcb7ae@endymion.delvare> <4FFDAF5A.8070205@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: In-Reply-To: Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Yegor Yefremov Cc: "Datta, Shubhrajyoti" , Jean Delvare , Linux I2C List-Id: linux-i2c@vger.kernel.org On Tue, Jul 17, 2012 at 3:01 PM, Yegor Yefremov wrote: > On Thu, Jul 12, 2012 at 7:24 AM, Datta, Shubhrajyoti > wrote: [...] >> On Wed, Jul 11, 2012 at 10:22 PM, Shubhrajyoti 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;