[ARM] 5400/1: Add support for inverted rdy_busy pin for Atmel nand device controller
authorGregory CLEMENT <gclement00@gmail.com>
Mon, 16 Feb 2009 20:21:47 +0000 (21:21 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 16 Feb 2009 21:40:39 +0000 (21:40 +0000)
Add support for inverted rdy_busy pin for Atmel nand device controller
It will fix building error on NeoCore926 board.

Acked-by: Andrew Victor <linux@maxim.org.za>
Acked-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Gregory CLEMENT <gclement@adeneo.adetelgroup.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-at91/include/mach/board.h
arch/avr32/mach-at32ap/include/mach/board.h
drivers/mtd/nand/atmel_nand.c

index fb51f0e0a83fb933b718c80960a46cd60b831ce8..0b3ae21b4565abb471fbedd59c15c96a3e4450f5 100644 (file)
@@ -93,6 +93,7 @@ struct atmel_nand_data {
        u8              enable_pin;     /* chip enable */
        u8              det_pin;        /* card detect */
        u8              rdy_pin;        /* ready/busy */
+       u8              rdy_pin_active_low;     /* rdy_pin value is inverted */
        u8              ale;            /* address line number connected to ALE */
        u8              cle;            /* address line number connected to CLE */
        u8              bus_width_16;   /* buswidth is 16 bit */
index aafaf7a78886951ed50017c6d414e6b5758cff05..cff8e84f78f21b64e580034a999cefc48d7536b1 100644 (file)
@@ -116,6 +116,7 @@ struct atmel_nand_data {
        int     enable_pin;     /* chip enable */
        int     det_pin;        /* card detect */
        int     rdy_pin;        /* ready/busy */
+       u8      rdy_pin_active_low;     /* rdy_pin value is inverted */
        u8      ale;            /* address line number connected to ALE */
        u8      cle;            /* address line number connected to CLE */
        u8      bus_width_16;   /* buswidth is 16 bit */
index c98c1570a40b1ef5f3f3931ab4e0512be0341406..47a33cec3793d4b3f1a8b512e3fcf95d5ca83aba 100644 (file)
@@ -139,7 +139,8 @@ static int atmel_nand_device_ready(struct mtd_info *mtd)
        struct nand_chip *nand_chip = mtd->priv;
        struct atmel_nand_host *host = nand_chip->priv;
 
-       return gpio_get_value(host->board->rdy_pin);
+       return gpio_get_value(host->board->rdy_pin) ^
+                !!host->board->rdy_pin_active_low;
 }
 
 /*