forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 297b60346df8beafee954a0fd7c2d64f33f3b9bc
kernel/arch/arm/mach-orion5x/ts78xx-setup.c
....@@ -16,8 +16,7 @@
1616 #include <linux/platform_device.h>
1717 #include <linux/mv643xx_eth.h>
1818 #include <linux/ata_platform.h>
19
-#include <linux/mtd/rawnand.h>
20
-#include <linux/mtd/partitions.h>
19
+#include <linux/mtd/platnand.h>
2120 #include <linux/timeriomem-rng.h>
2221 #include <asm/mach-types.h>
2322 #include <asm/mach/arch.h>
....@@ -131,11 +130,9 @@
131130 * NAND_CLE: bit 1 -> bit 1
132131 * NAND_ALE: bit 2 -> bit 0
133132 */
134
-static void ts78xx_ts_nand_cmd_ctrl(struct mtd_info *mtd, int cmd,
135
- unsigned int ctrl)
133
+static void ts78xx_ts_nand_cmd_ctrl(struct nand_chip *this, int cmd,
134
+ unsigned int ctrl)
136135 {
137
- struct nand_chip *this = mtd_to_nand(mtd);
138
-
139136 if (ctrl & NAND_CTRL_CHANGE) {
140137 unsigned char bits;
141138
....@@ -147,19 +144,18 @@
147144 }
148145
149146 if (cmd != NAND_CMD_NONE)
150
- writeb(cmd, this->IO_ADDR_W);
147
+ writeb(cmd, this->legacy.IO_ADDR_W);
151148 }
152149
153
-static int ts78xx_ts_nand_dev_ready(struct mtd_info *mtd)
150
+static int ts78xx_ts_nand_dev_ready(struct nand_chip *chip)
154151 {
155152 return readb(TS_NAND_CTRL) & 0x20;
156153 }
157154
158
-static void ts78xx_ts_nand_write_buf(struct mtd_info *mtd,
159
- const uint8_t *buf, int len)
155
+static void ts78xx_ts_nand_write_buf(struct nand_chip *chip,
156
+ const uint8_t *buf, int len)
160157 {
161
- struct nand_chip *chip = mtd_to_nand(mtd);
162
- void __iomem *io_base = chip->IO_ADDR_W;
158
+ void __iomem *io_base = chip->legacy.IO_ADDR_W;
163159 unsigned long off = ((unsigned long)buf & 3);
164160 int sz;
165161
....@@ -182,11 +178,10 @@
182178 writesb(io_base, buf, len);
183179 }
184180
185
-static void ts78xx_ts_nand_read_buf(struct mtd_info *mtd,
186
- uint8_t *buf, int len)
181
+static void ts78xx_ts_nand_read_buf(struct nand_chip *chip,
182
+ uint8_t *buf, int len)
187183 {
188
- struct nand_chip *chip = mtd_to_nand(mtd);
189
- void __iomem *io_base = chip->IO_ADDR_R;
184
+ void __iomem *io_base = chip->legacy.IO_ADDR_R;
190185 unsigned long off = ((unsigned long)buf & 3);
191186 int sz;
192187
....@@ -403,7 +398,6 @@
403398
404399 static int ts78xx_fpga_unload_devices(void)
405400 {
406
- int ret = 0;
407401
408402 if (ts78xx_fpga.supports.ts_rtc.present == 1)
409403 ts78xx_ts_rtc_unload();
....@@ -412,7 +406,7 @@
412406 if (ts78xx_fpga.supports.ts_rng.present == 1)
413407 ts78xx_ts_rng_unload();
414408
415
- return ret;
409
+ return 0;
416410 }
417411
418412 static int ts78xx_fpga_load(void)