diff options
-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 { | |||
94 | }; | 94 | }; |
95 | 95 | ||
96 | /* | 96 | /* |
97 | * Enable NAND. | ||
98 | */ | ||
99 | static 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 | */ | ||
108 | static 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 | */ |
99 | static void at91_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) | 117 | 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) | |||
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 | */ | ||
133 | static 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 | */ | ||
142 | static 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 | */ |
151 | static int at91_nand_write_oob_512(struct mtd_info *mtd, | 151 | static int at91_nand_write_oob_512(struct mtd_info *mtd, |