OneNAND OMAP3: add delay for GPIO
PATCH 1/1 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.
---drivers/mtd/onenand/omap2.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
drivers/mtd/onenand/omap2.c +0 -0
@@ -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) {Signature · 1 line
1.5.4.3
Quoted 3 lines · Adrian Hunter
On OMAP3, the driver was occasionally not seeing the GPIO interrupt. Adding a small delay of one register read eliminates the problem.
Pushing to linux-omap tree.
Tony
Quoted 31 lines
Signed-off-by Adrian Hunter <[email protected]>---
drivers/mtd/onenand/omap2.c| 9 +++++++--1 files changed, 7 insertions(+), 2 deletions(-)drivers/mtd/onenand/omap2.c +7
-2@@ -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) {Signature · 5 lines
1.5.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines · Tony Lindgren
Quoted 3 lines · Adrian Hunter
On OMAP3, the driver was occasionally not seeing the GPIO interrupt. Adding a small delay of one register read eliminates the problem.
Pushing to linux-omap tree.
Note, dwmw2 pushed this to mtd tree already:
http://git.infradead.org/mtd-2.6.git?a=commit;h=782b7a367d81da005d93b28cb00f9ae086773c24
Signature · 2 lines
Best regards, Artem Bityutskiy (Битюцкий Артём)
Quoted 7 lines · Artem Bityutskiy
Quoted 5 lines · Tony Lindgren
Quoted 3 lines · Adrian Hunter
On OMAP3, the driver was occasionally not seeing the GPIO interrupt. Adding a small delay of one register read eliminates the problem.
Quoted 5 lines
Quoted 1 line
Pushing to linux-omap tree.
Note, dwmw2 pushed this to mtd tree already:
http://git.infradead.org/mtd-2.6.git?a=commit;h=782b7a367d81da005d93b28cb00f9ae086773c24
OK good, I'll be using whatever drops down from mainline for MTD files.
So just pushing the fix to linux-omap to wait for it to drop down from mainline.
Regards,
Tony