Skip to content

Commit

Permalink
[ARM] 5400/1: Add support for inverted rdy_busy pin for Atmel nand de…
Browse files Browse the repository at this point in the history
…vice controller

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>
  • Loading branch information
Gregory CLEMENT authored and Russell King committed Feb 16, 2009
1 parent 2b768b6 commit 744f659
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions arch/arm/mach-at91/include/mach/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 1 addition & 0 deletions arch/avr32/mach-at32ap/include/mach/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
3 changes: 2 additions & 1 deletion drivers/mtd/nand/atmel_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand Down

0 comments on commit 744f659

Please sign in to comment.