Skip to content

Commit 782b7a3

Browse files
Adrian HunterDavid Woodhouse
authored andcommitted
[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@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent bde86fe commit 782b7a3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/mtd/onenand/omap2.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,13 @@ static int omap2_onenand_wait(struct mtd_info *mtd, int state)
141141

142142
/* Turn interrupts on */
143143
syscfg = read_reg(c, ONENAND_REG_SYS_CFG1);
144-
syscfg |= ONENAND_SYS_CFG1_IOBE;
145-
write_reg(c, syscfg, ONENAND_REG_SYS_CFG1);
144+
if (!(syscfg & ONENAND_SYS_CFG1_IOBE)) {
145+
syscfg |= ONENAND_SYS_CFG1_IOBE;
146+
write_reg(c, syscfg, ONENAND_REG_SYS_CFG1);
147+
if (cpu_is_omap34xx())
148+
/* Add a delay to let GPIO settle */
149+
syscfg = read_reg(c, ONENAND_REG_SYS_CFG1);
150+
}
146151

147152
INIT_COMPLETION(c->irq_done);
148153
if (c->gpio_irq) {

0 commit comments

Comments
 (0)