mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 18:09:57 +00:00
[MTD] [NAND] at91_nand: use at91_nand_{en,dis}able consistently.
Use at91_nand_enable(), at91_nand_disable() to manipulate enable_pin. No functional changes. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
parent
4a27214d7b
commit
8136508cd6
1 changed files with 21 additions and 21 deletions
|
@ -93,6 +93,24 @@ struct at91_nand_host {
|
|||
void __iomem *ecc;
|
||||
};
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
@ -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;
|
||||
|
@ -127,24 +145,6 @@ static int at91_nand_device_ready(struct mtd_info *mtd)
|
|||
return at91_get_gpio_value(host->board->rdy_pin);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue