public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [MTD] OneNAND OMAP3: add delay for GPIO
@ 2008-08-14 11:00 Adrian Hunter
  2008-08-18 12:33 ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Hunter @ 2008-08-14 11:00 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org; +Cc: linux-omap

On OMAP3, the driver was occasionally not seeing the GPIO
interrupt.  Adding a small delay of one register read
eliminates the problem.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
---
 drivers/mtd/onenand/omap2.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c
index 2bd8746..bf6bba5 100644
--- a/drivers/mtd/onenand/omap2.c
+++ b/drivers/mtd/onenand/omap2.c
@@ -141,8 +141,13 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
 
 		/* Turn interrupts on */
 		syscfg = read_reg(c, ONENAND_REG_SYS_CFG1);
-		syscfg |= ONENAND_SYS_CFG1_IOBE;
-		write_reg(c, syscfg, ONENAND_REG_SYS_CFG1);
+		if (!(syscfg & ONENAND_SYS_CFG1_IOBE)) {
+			syscfg |= ONENAND_SYS_CFG1_IOBE;
+			write_reg(c, syscfg, ONENAND_REG_SYS_CFG1);
+			if (cpu_is_omap34xx())
+				/* Add a delay to let GPIO settle */
+				syscfg = read_reg(c, ONENAND_REG_SYS_CFG1);
+		}
 
 		INIT_COMPLETION(c->irq_done);
 		if (c->gpio_irq) {
-- 
1.5.4.3

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

end of thread, other threads:[~2008-08-18 12:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-14 11:00 [PATCH] [MTD] OneNAND OMAP3: add delay for GPIO Adrian Hunter
2008-08-18 12:33 ` Tony Lindgren
2008-08-18 12:36   ` Artem Bityutskiy
2008-08-18 12:41     ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox