From patchwork Tue Jun 14 10:05:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Weitzel X-Patchwork-Id: 878652 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5EA6CJs014999 for ; Tue, 14 Jun 2011 10:06:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755945Ab1FNKGI (ORCPT ); Tue, 14 Jun 2011 06:06:08 -0400 Received: from mail.phytec.co.uk ([217.6.246.34]:37885 "EHLO root.phytec.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755908Ab1FNKGH (ORCPT ); Tue, 14 Jun 2011 06:06:07 -0400 Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id EB0A9BF0D9; Tue, 14 Jun 2011 12:08:59 +0200 (CEST) Received: from numalfix.phytec.de ([127.0.0.1]) by idefix.phytec.de (Lotus Domino Release 8.5.2FP2) with ESMTP id 2011061412060432-71240 ; Tue, 14 Jun 2011 12:06:04 +0200 Received: by numalfix.phytec.de (Postfix, from userid 1002) id 8C3F01A1861; Tue, 14 Jun 2011 12:06:04 +0200 (CEST) From: Jan Weitzel 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 Subject: [RFC] ARM: OMAP2+ i2c NACK without STP Date: Tue, 14 Jun 2011 12:05:59 +0200 Message-Id: <1308045959-24269-1-git-send-email-j.weitzel@phytec.de> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <87oc30t81u.fsf@ti.com> References: <87oc30t81u.fsf@ti.com> X-MIMETrack: Itemize by SMTP Server on Idefix/Phytec(Release 8.5.2FP2|March 22, 2011) at 14.06.2011 12:06:04, Serialize by Router on Idefix/Phytec(Release 8.5.2FP2|March 22, 2011) at 14.06.2011 12:06:04, Serialize complete at 14.06.2011 12:06:04 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 14 Jun 2011 10:06:13 +0000 (UTC) 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 Acked-by: Tony Lindgren --- 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;