All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/1] i2c:OMAP3:Errata workaround for spurious RDR event
@ 2009-06-22 20:34 Ulrik Bech Hald
  2009-06-22 20:56 ` Kevin Hilman
  2009-06-23  1:16 ` Paul Walmsley
  0 siblings, 2 replies; 14+ messages in thread
From: Ulrik Bech Hald @ 2009-06-22 20:34 UTC (permalink / raw)
  To: linux-omap; +Cc: Ulrik Bech Hald, Jagadeesh Bhaskar Pakaravoor

Under certain rare conditions, I2C_STAT[13].RDR bit may be set,
and the corresponding interrupt fire, even when there is no
data in the receive FIFO, or the I2C data transfer is still
ongoing. These spurious RDR events must be ignored by the
software.

A check for OMAP_I2C_STAT_BB is introduced in the ISR to
prevent further processing of RDR interrupt, if the bus is busy.

Signed-off-by: Ulrik Bech Hald <ubh@ti.com>
Signed-off-by: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com>
---
 drivers/i2c/busses/i2c-omap.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index ece0125..88feea1 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -668,6 +668,15 @@ omap_i2c_isr(int this_irq, void *dev_id)
 			omap_i2c_complete_cmd(dev, err);
 		if (stat & (OMAP_I2C_STAT_RRDY | OMAP_I2C_STAT_RDR)) {
 			u8 num_bytes = 1;
+			/* 3430 I2C Errata 1.15
+			 * RDR could be set when the bus is busy, then
+			 * ignore the interrupt, and clear the bit.
+			 */
+			u8 stat2 = 0;
+			stat2 = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG);
+			if (stat2 & OMAP_I2C_STAT_BB)
+				return IRQ_HANDLED;
+
 			if (dev->fifo_size) {
 				if (stat & OMAP_I2C_STAT_RRDY)
 					num_bytes = dev->fifo_size;
-- 
1.5.4.3


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2009-07-02 11:39 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-22 20:34 [PATCH v2 1/1] i2c:OMAP3:Errata workaround for spurious RDR event Ulrik Bech Hald
2009-06-22 20:56 ` Kevin Hilman
2009-06-23  1:16 ` Paul Walmsley
2009-06-23  2:49   ` Pakaravoor, Jagadeesh
2009-06-23  3:20     ` Paul Walmsley
2009-06-23 16:34       ` Hald, Ulrik Bech
2009-06-23 18:05         ` Paul Walmsley
2009-06-23 20:26           ` Menon, Nishanth
2009-06-25 18:44             ` Hald, Ulrik Bech
2009-07-02  9:29               ` Paul Walmsley
2009-07-02 11:39                 ` Paul Walmsley
2009-06-23 21:17           ` Paul Walmsley
2009-06-25 18:45             ` Hald, Ulrik Bech
2009-06-23 21:29         ` Paul Walmsley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.