* [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* Re: [PATCH] [MTD] OneNAND OMAP3: add delay for GPIO
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
0 siblings, 1 reply; 4+ messages in thread
From: Tony Lindgren @ 2008-08-18 12:33 UTC (permalink / raw)
To: Adrian Hunter; +Cc: linux-mtd@lists.infradead.org, linux-omap
* Adrian Hunter <ext-adrian.hunter@nokia.com> [080814 14:21]:
> 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
> 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
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] [MTD] OneNAND OMAP3: add delay for GPIO
2008-08-18 12:33 ` Tony Lindgren
@ 2008-08-18 12:36 ` Artem Bityutskiy
2008-08-18 12:41 ` Tony Lindgren
0 siblings, 1 reply; 4+ messages in thread
From: Artem Bityutskiy @ 2008-08-18 12:36 UTC (permalink / raw)
To: Tony Lindgren; +Cc: Adrian Hunter, linux-omap, linux-mtd@lists.infradead.org
On Mon, 2008-08-18 at 15:33 +0300, Tony Lindgren wrote:
> * Adrian Hunter <ext-adrian.hunter@nokia.com> [080814 14:21]:
> > 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
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] [MTD] OneNAND OMAP3: add delay for GPIO
2008-08-18 12:36 ` Artem Bityutskiy
@ 2008-08-18 12:41 ` Tony Lindgren
0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2008-08-18 12:41 UTC (permalink / raw)
To: Artem Bityutskiy; +Cc: Adrian Hunter, linux-omap, linux-mtd@lists.infradead.org
* Artem Bityutskiy <dedekind@infradead.org> [080818 15:38]:
>
> On Mon, 2008-08-18 at 15:33 +0300, Tony Lindgren wrote:
> > * Adrian Hunter <ext-adrian.hunter@nokia.com> [080814 14:21]:
> > > 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
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
^ permalink raw reply [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