linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* PATCH: at91_nand rdy_pin fix
@ 2007-05-23 21:53 Ivan Kuten
  2007-05-24  7:47 ` Andrew Victor
  0 siblings, 1 reply; 5+ messages in thread
From: Ivan Kuten @ 2007-05-23 21:53 UTC (permalink / raw)
  To: linux-mtd

Hello,

The patch below fixes nand driver for AT91 boards which do not have NAND R/B signal
connected to gpio (rdy_pin is not connected).

Patch is against 2.6.22-rc1 + corresponding at91 patch from maxim.org.za

Best regards, Ivan

Signed-off-by: Ivan Kuten <ivan.kuten@promwad.com>

---

diff -urN linux.orig/drivers/mtd/nand/at91_nand.c linux/drivers/mtd/nand/at91_nand.c
--- linux.orig/drivers/mtd/nand/at91_nand.c     2007-05-24 00:19:57 +0300
+++ linux/drivers/mtd/nand/at91_nand.c  2007-05-24 00:10:01 +0300
@@ -128,7 +128,12 @@
        nand_chip->IO_ADDR_R = host->io_base;
        nand_chip->IO_ADDR_W = host->io_base;
        nand_chip->cmd_ctrl = at91_nand_cmd_ctrl;
-       nand_chip->dev_ready = at91_nand_device_ready;
+
+       if (host->board->rdy_pin)
+               nand_chip->dev_ready = at91_nand_device_ready;
+       else
+               nand_chip->dev_ready = NULL;
+
        nand_chip->ecc.mode = NAND_ECC_SOFT;    /* enable ECC */
        nand_chip->chip_delay = 20;             /* 20us command delay time */

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

* Re: PATCH: at91_nand rdy_pin fix
  2007-05-23 21:53 PATCH: at91_nand rdy_pin fix Ivan Kuten
@ 2007-05-24  7:47 ` Andrew Victor
  2007-05-24  8:14   ` Ivan Kuten
  2007-05-24 11:35   ` Ivan Kuten
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Victor @ 2007-05-24  7:47 UTC (permalink / raw)
  To: Ivan Kuten; +Cc: linux-mtd

hi Ivan,

> -       nand_chip->dev_ready = at91_nand_device_ready;
> +
> +       if (host->board->rdy_pin)
> +               nand_chip->dev_ready = at91_nand_device_ready;
> +       else
> +               nand_chip->dev_ready = NULL;

Patch looks correct.

Since the at91_nand_host structure is allocated with kzalloc(),
nand_chip->dev_ready is already initialized to NULL.
So we don't really need the "else" part.


Regards,
  Andrew Victor

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

* Re: PATCH: at91_nand rdy_pin fix
  2007-05-24  7:47 ` Andrew Victor
@ 2007-05-24  8:14   ` Ivan Kuten
  2007-05-24 11:35   ` Ivan Kuten
  1 sibling, 0 replies; 5+ messages in thread
From: Ivan Kuten @ 2007-05-24  8:14 UTC (permalink / raw)
  To: Andrew Victor; +Cc: linux-mtd

On 24 May 2007 09:47:08 +0200
Andrew Victor wrote:

Should I re-diff or you will apply it corrected?

BR, 
Ivan

> hi Ivan,
> 
> > -       nand_chip->dev_ready = at91_nand_device_ready;
> > +
> > +       if (host->board->rdy_pin)
> > +               nand_chip->dev_ready = at91_nand_device_ready;
> > +       else
> > +               nand_chip->dev_ready = NULL;
> 
> Patch looks correct.
> 
> Since the at91_nand_host structure is allocated with kzalloc(),
> nand_chip->dev_ready is already initialized to NULL.
> So we don't really need the "else" part.
> 
> 
> Regards,
>   Andrew Victor
> 
> 
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: PATCH: at91_nand rdy_pin fix
  2007-05-24  7:47 ` Andrew Victor
  2007-05-24  8:14   ` Ivan Kuten
@ 2007-05-24 11:35   ` Ivan Kuten
  1 sibling, 0 replies; 5+ messages in thread
From: Ivan Kuten @ 2007-05-24 11:35 UTC (permalink / raw)
  To: Andrew Victor, dwmw2; +Cc: linux-mtd

Hi again,

Corrected according to Andrew's comments:

The patch below fixes nand driver for AT91 boards which do not have NAND R/B signal
connected to gpio (rdy_pin is not connected).

Best regards, 
Ivan

Signed-off-by: Ivan Kuten <ivan.kuten@promwad.com>
Acked-by: Andrew Victor <andrew@sanpeople.com>

diff -urN linux-2.6.22-rc1-at91.orig/drivers/mtd/nand/at91_nand.c linux-2.6.22-rc1-at91/drivers/mtd/nand/at91_nand.c
--- linux-2.6.22-rc1-at91.orig/drivers/mtd/nand/at91_nand.c	2007-05-24 14:09:12 +0300
+++ linux-2.6.22-rc1-at91/drivers/mtd/nand/at91_nand.c	2007-05-24 14:09:42 +0300
@@ -128,7 +128,10 @@
 	nand_chip->IO_ADDR_R = host->io_base;
 	nand_chip->IO_ADDR_W = host->io_base;
 	nand_chip->cmd_ctrl = at91_nand_cmd_ctrl;
-	nand_chip->dev_ready = at91_nand_device_ready;
+
+	if (host->board->rdy_pin)
+		nand_chip->dev_ready = at91_nand_device_ready;
+
 	nand_chip->ecc.mode = NAND_ECC_SOFT;	/* enable ECC */
 	nand_chip->chip_delay = 20;		/* 20us command delay time */
 


On 24 May 2007 09:47:08 +0200
Andrew Victor wrote:

> hi Ivan,
> 
> > -       nand_chip->dev_ready = at91_nand_device_ready;
> > +
> > +       if (host->board->rdy_pin)
> > +               nand_chip->dev_ready = at91_nand_device_ready;
> > +       else
> > +               nand_chip->dev_ready = NULL;
> 
> Patch looks correct.
> 
> Since the at91_nand_host structure is allocated with kzalloc(),
> nand_chip->dev_ready is already initialized to NULL.
> So we don't really need the "else" part.
> 
> 
> Regards,
>   Andrew Victor
> 
> 
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* PATCH: at91_nand rdy_pin fix
@ 2007-06-28 19:14 Ivan Kuten
  0 siblings, 0 replies; 5+ messages in thread
From: Ivan Kuten @ 2007-06-28 19:14 UTC (permalink / raw)
  To: linux-mtd; +Cc: dwmw2


Hi,

Could you please apply a small fix for at91 nand driver in mtd-2.6.git. 
I posted it some time before 

http://article.gmane.org/gmane.linux.drivers.mtd/18354

but seems it get missed from patch queue.

Best regards,
Ivan

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

end of thread, other threads:[~2007-06-28 19:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-23 21:53 PATCH: at91_nand rdy_pin fix Ivan Kuten
2007-05-24  7:47 ` Andrew Victor
2007-05-24  8:14   ` Ivan Kuten
2007-05-24 11:35   ` Ivan Kuten
  -- strict thread matches above, loose matches on Subject: below --
2007-06-28 19:14 Ivan Kuten

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).