aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2008-04-26 12:51:12 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2008-04-26 13:41:16 -0400
commit8136508cd6075a74e68a8d1cde8399a558ca27a7 (patch)
tree94abb38c970dcf912dfec220b33b25e43efd8b47 /drivers/mtd
parent4a27214d7be31e122db4102166f49ec15958e8e9 (diff)
[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>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/at91_nand.c42
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 {
94}; 94};
95 95
96/* 96/*
97 * Enable NAND.
98 */
99static void at91_nand_enable(struct at91_nand_host *host)
100{
101 if (host->board->enable_pin)
102 at91_set_gpio_value(host->board->enable_pin, 0);
103}
104
105/*
106 * Disable NAND.
107 */
108static void at91_nand_disable(struct at91_nand_host *host)
109{
110 if (host->board->enable_pin)
111 at91_set_gpio_value(host->board->enable_pin, 1);
112}
113
114/*
97 * Hardware specific access to control-lines 115 * Hardware specific access to control-lines
98 */ 116 */
99static void at91_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) 117static 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)
101 struct nand_chip *nand_chip = mtd->priv; 119 struct nand_chip *nand_chip = mtd->priv;
102 struct at91_nand_host *host = nand_chip->priv; 120 struct at91_nand_host *host = nand_chip->priv;
103 121
104 if (host->board->enable_pin && (ctrl & NAND_CTRL_CHANGE)) { 122 if (ctrl & NAND_CTRL_CHANGE) {
105 if (ctrl & NAND_NCE) 123 if (ctrl & NAND_NCE)
106 at91_set_gpio_value(host->board->enable_pin, 0); 124 at91_nand_enable(host);
107 else 125 else
108 at91_set_gpio_value(host->board->enable_pin, 1); 126 at91_nand_disable(host);
109 } 127 }
110 if (cmd == NAND_CMD_NONE) 128 if (cmd == NAND_CMD_NONE)
111 return; 129 return;
@@ -128,24 +146,6 @@ static int at91_nand_device_ready(struct mtd_info *mtd)
128} 146}
129 147
130/* 148/*
131 * Enable NAND.
132 */
133static void at91_nand_enable(struct at91_nand_host *host)
134{
135 if (host->board->enable_pin)
136 at91_set_gpio_value(host->board->enable_pin, 0);
137}
138
139/*
140 * Disable NAND.
141 */
142static void at91_nand_disable(struct at91_nand_host *host)
143{
144 if (host->board->enable_pin)
145 at91_set_gpio_value(host->board->enable_pin, 1);
146}
147
148/*
149 * write oob for small pages 149 * write oob for small pages
150 */ 150 */
151static int at91_nand_write_oob_512(struct mtd_info *mtd, 151static int at91_nand_write_oob_512(struct mtd_info *mtd,