From patchwork Tue Jun 14 10:54:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Weitzel X-Patchwork-Id: 1899 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.47.109) by localhost6.localdomain6 with IMAP4-SSL; 14 Jun 2011 16:46:31 -0000 Delivered-To: patches@linaro.org Received: by 10.52.183.130 with SMTP id em2cs55364vdc; Tue, 14 Jun 2011 03:54:28 -0700 (PDT) Received: by 10.213.35.142 with SMTP id p14mr3364953ebd.116.1308048867929; Tue, 14 Jun 2011 03:54:27 -0700 (PDT) Received: from root.phytec.de (mail.phytec.de [217.6.246.34]) by mx.google.com with ESMTP id w1si6523964faj.69.2011.06.14.03.54.26; Tue, 14 Jun 2011 03:54:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of j.weitzel@phytec.de designates 217.6.246.34 as permitted sender) client-ip=217.6.246.34; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of j.weitzel@phytec.de designates 217.6.246.34 as permitted sender) smtp.mail=j.weitzel@phytec.de Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id 36350A30A2; Tue, 14 Jun 2011 12:57:19 +0200 (CEST) Received: from numalfix.phytec.de ([127.0.0.1]) by idefix.phytec.de (Lotus Domino Release 8.5.2FP2) with ESMTP id 2011061412542430-71355 ; Tue, 14 Jun 2011 12:54:24 +0200 Received: by numalfix.phytec.de (Postfix, from userid 1002) id 2BB101A1861; Tue, 14 Jun 2011 12:54:24 +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, ben-linux@fluff.org, linux-i2c@vger.kernel.org, Jan Weitzel Subject: [PATCH] ARM: OMAP2+ i2c NACK without STP Date: Tue, 14 Jun 2011 12:54:13 +0200 Message-Id: <1308048853-21911-1-git-send-email-j.weitzel@phytec.de> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <20110614102409.GN3352@atomide.com> References: <20110614102409.GN3352@atomide.com> X-MIMETrack: Itemize by SMTP Server on Idefix/Phytec(Release 8.5.2FP2|March 22, 2011) at 14.06.2011 12:54:24, Serialize by Router on Idefix/Phytec(Release 8.5.2FP2|March 22, 2011) at 14.06.2011 12:54:24, Serialize complete at 14.06.2011 12:54:24 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) Fixes also booting on 2430sdp. 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;