aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/rtc_from4.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/rtc_from4.c')
-rw-r--r--drivers/mtd/nand/rtc_from4.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/drivers/mtd/nand/rtc_from4.c b/drivers/mtd/nand/rtc_from4.c
index f8e631c89a6..6c97bfaea19 100644
--- a/drivers/mtd/nand/rtc_from4.c
+++ b/drivers/mtd/nand/rtc_from4.c
@@ -208,32 +208,18 @@ static uint8_t revbits[256] = {
208 * Address lines (A24-A22), so no action is required here. 208 * Address lines (A24-A22), so no action is required here.
209 * 209 *
210 */ 210 */
211static void rtc_from4_hwcontrol(struct mtd_info *mtd, int cmd) 211static void rtc_from4_hwcontrol(struct mtd_info *mtd, int cmd,
212 unsigned int ctrl)
212{ 213{
213 struct nand_chip *this = (struct nand_chip *)(mtd->priv); 214 struct nand_chip *chip = (mtd->priv);
214 215
215 switch (cmd) { 216 if (cmd == NAND_CMD_NONE)
217 return;
216 218
217 case NAND_CTL_SETCLE: 219 if (ctrl & NAND_CLE)
218 this->IO_ADDR_W = (void __iomem *)((unsigned long)this->IO_ADDR_W | RTC_FROM4_CLE); 220 writeb(cmd, chip->IO_ADDR_W | RTC_FROM4_CLE);
219 break; 221 else
220 case NAND_CTL_CLRCLE: 222 writeb(cmd, chip->IO_ADDR_W | RTC_FROM4_ALE);
221 this->IO_ADDR_W = (void __iomem *)((unsigned long)this->IO_ADDR_W & ~RTC_FROM4_CLE);
222 break;
223
224 case NAND_CTL_SETALE:
225 this->IO_ADDR_W = (void __iomem *)((unsigned long)this->IO_ADDR_W | RTC_FROM4_ALE);
226 break;
227 case NAND_CTL_CLRALE:
228 this->IO_ADDR_W = (void __iomem *)((unsigned long)this->IO_ADDR_W & ~RTC_FROM4_ALE);
229 break;
230
231 case NAND_CTL_SETNCE:
232 break;
233 case NAND_CTL_CLRNCE:
234 break;
235
236 }
237} 223}
238 224
239/* 225/*
@@ -559,7 +545,7 @@ static int __init rtc_from4_init(void)
559 this->IO_ADDR_R = rtc_from4_fio_base; 545 this->IO_ADDR_R = rtc_from4_fio_base;
560 this->IO_ADDR_W = rtc_from4_fio_base; 546 this->IO_ADDR_W = rtc_from4_fio_base;
561 /* Set address of hardware control function */ 547 /* Set address of hardware control function */
562 this->hwcontrol = rtc_from4_hwcontrol; 548 this->cmd_ctrl = rtc_from4_hwcontrol;
563 /* Set address of chip select function */ 549 /* Set address of chip select function */
564 this->select_chip = rtc_from4_nand_select_chip; 550 this->select_chip = rtc_from4_nand_select_chip;
565 /* command delay time (in us) */ 551 /* command delay time (in us) */