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: 1895 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:29 -0000 Delivered-To: patches@linaro.org Received: by 10.52.183.130 with SMTP id em2cs53283vdc; Tue, 14 Jun 2011 03:06:08 -0700 (PDT) Received: by 10.14.124.76 with SMTP id w52mr2744464eeh.201.1308045968097; Tue, 14 Jun 2011 03:06:08 -0700 (PDT) Received: from root.phytec.de (mail.phytec.de [217.6.246.34]) by mx.google.com with ESMTP id z9si6440716fan.57.2011.06.14.03.06.06; Tue, 14 Jun 2011 03:06:06 -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 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 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 --- 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;