[MTD] [OneNAND] OMAP3: add delay for GPIO

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Thu Aug 14 20:59:01 EDT 2008


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=782b7a367d81da005d93b28cb00f9ae086773c24
Commit:     782b7a367d81da005d93b28cb00f9ae086773c24
Parent:     bde86fec7c822b6009d3cfefc20b76b8d34716af
Author:     Adrian Hunter <ext-adrian.hunter at nokia.com>
AuthorDate: Thu Aug 14 14:00:12 2008 +0300
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Aug 15 01:25:30 2008 +0100

    [MTD] [OneNAND] OMAP3: add delay for GPIO
    
    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 at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.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 40153ac..34b4253 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) {



More information about the linux-mtd-cvs mailing list