aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/gpio.c')
-rw-r--r--drivers/mtd/nand/gpio.c54
1 files changed, 1 insertions, 53 deletions
diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c
index 27000a5f5f47..bc73bc5f2713 100644
--- a/drivers/mtd/nand/gpio.c
+++ b/drivers/mtd/nand/gpio.c
@@ -100,23 +100,6 @@ static void gpio_nand_readbuf(struct mtd_info *mtd, u_char *buf, int len)
100 readsb(this->IO_ADDR_R, buf, len); 100 readsb(this->IO_ADDR_R, buf, len);
101} 101}
102 102
103static int gpio_nand_verifybuf(struct mtd_info *mtd, const u_char *buf, int len)
104{
105 struct nand_chip *this = mtd->priv;
106 unsigned char read, *p = (unsigned char *) buf;
107 int i, err = 0;
108
109 for (i = 0; i < len; i++) {
110 read = readb(this->IO_ADDR_R);
111 if (read != p[i]) {
112 pr_debug("%s: err at %d (read %04x vs %04x)\n",
113 __func__, i, read, p[i]);
114 err = -EFAULT;
115 }
116 }
117 return err;
118}
119
120static void gpio_nand_writebuf16(struct mtd_info *mtd, const u_char *buf, 103static void gpio_nand_writebuf16(struct mtd_info *mtd, const u_char *buf,
121 int len) 104 int len)
122{ 105{
@@ -148,26 +131,6 @@ static void gpio_nand_readbuf16(struct mtd_info *mtd, u_char *buf, int len)
148 } 131 }
149} 132}
150 133
151static int gpio_nand_verifybuf16(struct mtd_info *mtd, const u_char *buf,
152 int len)
153{
154 struct nand_chip *this = mtd->priv;
155 unsigned short read, *p = (unsigned short *) buf;
156 int i, err = 0;
157 len >>= 1;
158
159 for (i = 0; i < len; i++) {
160 read = readw(this->IO_ADDR_R);
161 if (read != p[i]) {
162 pr_debug("%s: err at %d (read %04x vs %04x)\n",
163 __func__, i, read, p[i]);
164 err = -EFAULT;
165 }
166 }
167 return err;
168}
169
170
171static int gpio_nand_devready(struct mtd_info *mtd) 134static int gpio_nand_devready(struct mtd_info *mtd)
172{ 135{
173 struct gpiomtd *gpiomtd = gpio_nand_getpriv(mtd); 136 struct gpiomtd *gpiomtd = gpio_nand_getpriv(mtd);
@@ -391,11 +354,9 @@ static int __devinit gpio_nand_probe(struct platform_device *dev)
391 if (this->options & NAND_BUSWIDTH_16) { 354 if (this->options & NAND_BUSWIDTH_16) {
392 this->read_buf = gpio_nand_readbuf16; 355 this->read_buf = gpio_nand_readbuf16;
393 this->write_buf = gpio_nand_writebuf16; 356 this->write_buf = gpio_nand_writebuf16;
394 this->verify_buf = gpio_nand_verifybuf16;
395 } else { 357 } else {
396 this->read_buf = gpio_nand_readbuf; 358 this->read_buf = gpio_nand_readbuf;
397 this->write_buf = gpio_nand_writebuf; 359 this->write_buf = gpio_nand_writebuf;
398 this->verify_buf = gpio_nand_verifybuf;
399 } 360 }
400 361
401 /* set the mtd private data for the nand driver */ 362 /* set the mtd private data for the nand driver */
@@ -456,20 +417,7 @@ static struct platform_driver gpio_nand_driver = {
456 }, 417 },
457}; 418};
458 419
459static int __init gpio_nand_init(void) 420module_platform_driver(gpio_nand_driver);
460{
461 printk(KERN_INFO "GPIO NAND driver, © 2004 Simtec Electronics\n");
462
463 return platform_driver_register(&gpio_nand_driver);
464}
465
466static void __exit gpio_nand_exit(void)
467{
468 platform_driver_unregister(&gpio_nand_driver);
469}
470
471module_init(gpio_nand_init);
472module_exit(gpio_nand_exit);
473 421
474MODULE_LICENSE("GPL"); 422MODULE_LICENSE("GPL");
475MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); 423MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");