diff options
author | Paul Mackerras <paulus@samba.org> | 2008-05-09 20:12:06 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-05-09 20:12:06 +1000 |
commit | 2a5f2e3e6cd1ce9fb3f8b186b6bc9aa1f1497a92 (patch) | |
tree | b2306840f227972a7c9d4a2b75e516fe81358ce8 /drivers/mtd/nand/at91_nand.c | |
parent | 02539d71fa98d5737bb668b02286c76241e4bac9 (diff) | |
parent | 78be76476a34a77f0ea9db2f78ba46a2b0fd5ab5 (diff) | |
download | blackbird-op-linux-2a5f2e3e6cd1ce9fb3f8b186b6bc9aa1f1497a92.tar.gz blackbird-op-linux-2a5f2e3e6cd1ce9fb3f8b186b6bc9aa1f1497a92.zip |
Merge branch 'for-2.6.26' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer/powerpc-4xx into merge
Diffstat (limited to 'drivers/mtd/nand/at91_nand.c')
-rw-r--r-- | drivers/mtd/nand/at91_nand.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/mtd/nand/at91_nand.c b/drivers/mtd/nand/at91_nand.c index 414ceaecdb3a..0adb287027a2 100644 --- a/drivers/mtd/nand/at91_nand.c +++ b/drivers/mtd/nand/at91_nand.c @@ -94,6 +94,24 @@ struct at91_nand_host { }; /* + * Enable NAND. + */ +static void at91_nand_enable(struct at91_nand_host *host) +{ + if (host->board->enable_pin) + at91_set_gpio_value(host->board->enable_pin, 0); +} + +/* + * Disable NAND. + */ +static void at91_nand_disable(struct at91_nand_host *host) +{ + if (host->board->enable_pin) + at91_set_gpio_value(host->board->enable_pin, 1); +} + +/* * Hardware specific access to control-lines */ static void at91_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) @@ -101,11 +119,11 @@ static void at91_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) struct nand_chip *nand_chip = mtd->priv; struct at91_nand_host *host = nand_chip->priv; - if (host->board->enable_pin && (ctrl & NAND_CTRL_CHANGE)) { + if (ctrl & NAND_CTRL_CHANGE) { if (ctrl & NAND_NCE) - at91_set_gpio_value(host->board->enable_pin, 0); + at91_nand_enable(host); else - at91_set_gpio_value(host->board->enable_pin, 1); + at91_nand_disable(host); } if (cmd == NAND_CMD_NONE) return; @@ -128,24 +146,6 @@ static int at91_nand_device_ready(struct mtd_info *mtd) } /* - * Enable NAND. - */ -static void at91_nand_enable(struct at91_nand_host *host) -{ - if (host->board->enable_pin) - at91_set_gpio_value(host->board->enable_pin, 0); -} - -/* - * Disable NAND. - */ -static void at91_nand_disable(struct at91_nand_host *host) -{ - if (host->board->enable_pin) - at91_set_gpio_value(host->board->enable_pin, 1); -} - -/* * write oob for small pages */ static int at91_nand_write_oob_512(struct mtd_info *mtd, |