Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755839Ab2FNKYz (ORCPT ); Thu, 14 Jun 2012 06:24:55 -0400 Received: from na3sys009aog112.obsmtp.com ([74.125.149.207]:47305 "EHLO na3sys009aog112.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755556Ab2FNKXf (ORCPT ); Thu, 14 Jun 2012 06:23:35 -0400 From: Felipe Balbi To: ben-linux@fluff.org Cc: Tony Lindgren , w.sang@pengutronix.de, Linux OMAP Mailing List , linux-i2c@vger.kernel.org, Linux ARM Kernel Mailing List , Linux Kernel Mailing List , Felipe Balbi Subject: [PATCH 13/17] i2c: omap: bus: add a receiver flag Date: Thu, 14 Jun 2012 13:20:46 +0300 Message-Id: <1339669250-9183-14-git-send-email-balbi@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1339669250-9183-1-git-send-email-balbi@ti.com> References: <1339669250-9183-1-git-send-email-balbi@ti.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1589 Lines: 50 that way we can ignore TX IRQs while in receiver mode and ignore RX IRQs while in transmitter mode. Signed-off-by: Felipe Balbi --- drivers/i2c/busses/i2c-omap.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 43d3289..fad5f6f 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -199,6 +199,7 @@ struct omap_i2c_dev { */ u8 rev; unsigned b_hw:1; /* bad h/w fixes */ + unsigned receiver:1; /* true when we're in receiver mode */ u16 iestate; /* Saved interrupt register */ u16 pscstate; u16 scllstate; @@ -538,6 +539,7 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap, init_completion(&dev->cmd_complete); dev->cmd_err = 0; + dev->receiver = !!(msg->flags & I2C_M_RD); w = OMAP_I2C_CON_EN | OMAP_I2C_CON_MST | OMAP_I2C_CON_STT; @@ -880,6 +882,13 @@ omap_i2c_isr(int this_irq, void *dev_id) stat = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG); stat &= bits; + /* If we're in receiver mode, ignore XDR/XRDY */ + if (dev->receiver) { + stat &= ~(OMAP_I2C_STAT_XDR | OMAP_I2C_STAT_XRDY); + } else { + stat &= ~(OMAP_I2C_STAT_RDR | OMAP_I2C_STAT_RRDY); + } + if (!stat) { /* my work here is done */ omap_i2c_complete_cmd(dev, err); -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/