aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2013-05-06 09:53:51 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2013-08-05 15:45:58 -0400
commit2189408cb7ffd221075d3f414241da35dc30ae12 (patch)
treee35e5dbbf3a53f7294a4a7ad001fdaae54973087
parentee4f36663b2a3626a9dadb2679a0ddcff1371891 (diff)
mtd: nand-gpio: Use default nand_base {read/write}_buf functions
Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r--drivers/mtd/nand/gpio.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c
index 0d26f8b7d9d0..312c28586245 100644
--- a/drivers/mtd/nand/gpio.c
+++ b/drivers/mtd/nand/gpio.c
@@ -87,51 +87,6 @@ static void gpio_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
87 gpio_nand_dosync(gpiomtd); 87 gpio_nand_dosync(gpiomtd);
88} 88}
89 89
90static void gpio_nand_writebuf(struct mtd_info *mtd, const u_char *buf, int len)
91{
92 struct nand_chip *this = mtd->priv;
93
94 iowrite8_rep(this->IO_ADDR_W, buf, len);
95}
96
97static void gpio_nand_readbuf(struct mtd_info *mtd, u_char *buf, int len)
98{
99 struct nand_chip *this = mtd->priv;
100
101 ioread8_rep(this->IO_ADDR_R, buf, len);
102}
103
104static void gpio_nand_writebuf16(struct mtd_info *mtd, const u_char *buf,
105 int len)
106{
107 struct nand_chip *this = mtd->priv;
108
109 if (IS_ALIGNED((unsigned long)buf, 2)) {
110 iowrite16_rep(this->IO_ADDR_W, buf, len>>1);
111 } else {
112 int i;
113 unsigned short *ptr = (unsigned short *)buf;
114
115 for (i = 0; i < len; i += 2, ptr++)
116 writew(*ptr, this->IO_ADDR_W);
117 }
118}
119
120static void gpio_nand_readbuf16(struct mtd_info *mtd, u_char *buf, int len)
121{
122 struct nand_chip *this = mtd->priv;
123
124 if (IS_ALIGNED((unsigned long)buf, 2)) {
125 ioread16_rep(this->IO_ADDR_R, buf, len>>1);
126 } else {
127 int i;
128 unsigned short *ptr = (unsigned short *)buf;
129
130 for (i = 0; i < len; i += 2, ptr++)
131 *ptr = readw(this->IO_ADDR_R);
132 }
133}
134
135static int gpio_nand_devready(struct mtd_info *mtd) 90static int gpio_nand_devready(struct mtd_info *mtd)
136{ 91{
137 struct gpiomtd *gpiomtd = gpio_nand_getpriv(mtd); 92 struct gpiomtd *gpiomtd = gpio_nand_getpriv(mtd);
@@ -314,19 +269,8 @@ static int gpio_nand_probe(struct platform_device *dev)
314 this->ecc.mode = NAND_ECC_SOFT; 269 this->ecc.mode = NAND_ECC_SOFT;
315 this->options = gpiomtd->plat.options; 270 this->options = gpiomtd->plat.options;
316 this->chip_delay = gpiomtd->plat.chip_delay; 271 this->chip_delay = gpiomtd->plat.chip_delay;
317
318 /* install our routines */
319 this->cmd_ctrl = gpio_nand_cmd_ctrl; 272 this->cmd_ctrl = gpio_nand_cmd_ctrl;
320 273
321 if (this->options & NAND_BUSWIDTH_16) {
322 this->read_buf = gpio_nand_readbuf16;
323 this->write_buf = gpio_nand_writebuf16;
324 } else {
325 this->read_buf = gpio_nand_readbuf;
326 this->write_buf = gpio_nand_writebuf;
327 }
328
329 /* set the mtd private data for the nand driver */
330 gpiomtd->mtd_info.priv = this; 274 gpiomtd->mtd_info.priv = this;
331 gpiomtd->mtd_info.owner = THIS_MODULE; 275 gpiomtd->mtd_info.owner = THIS_MODULE;
332 276