Lines Matching refs:mtd
106 struct mtd_info mtd; member
122 #define mtd_to_tmio(m) container_of(m, struct tmio_nand, mtd)
127 static void tmio_nand_hwcontrol(struct mtd_info *mtd, int cmd, in tmio_nand_hwcontrol() argument
130 struct tmio_nand *tmio = mtd_to_tmio(mtd); in tmio_nand_hwcontrol()
131 struct nand_chip *chip = mtd->priv; in tmio_nand_hwcontrol()
160 static int tmio_nand_dev_ready(struct mtd_info *mtd) in tmio_nand_dev_ready() argument
162 struct tmio_nand *tmio = mtd_to_tmio(mtd); in tmio_nand_dev_ready()
189 tmio_nand_wait(struct mtd_info *mtd, struct nand_chip *nand_chip) in tmio_nand_wait() argument
191 struct tmio_nand *tmio = mtd_to_tmio(mtd); in tmio_nand_wait()
199 tmio_nand_dev_ready(mtd), in tmio_nand_wait()
202 if (unlikely(!tmio_nand_dev_ready(mtd))) { in tmio_nand_wait()
213 nand_chip->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1); in tmio_nand_wait()
214 return nand_chip->read_byte(mtd); in tmio_nand_wait()
225 static u_char tmio_nand_read_byte(struct mtd_info *mtd) in tmio_nand_read_byte() argument
227 struct tmio_nand *tmio = mtd_to_tmio(mtd); in tmio_nand_read_byte()
245 tmio_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len) in tmio_nand_write_buf() argument
247 struct tmio_nand *tmio = mtd_to_tmio(mtd); in tmio_nand_write_buf()
252 static void tmio_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len) in tmio_nand_read_buf() argument
254 struct tmio_nand *tmio = mtd_to_tmio(mtd); in tmio_nand_read_buf()
259 static void tmio_nand_enable_hwecc(struct mtd_info *mtd, int mode) in tmio_nand_enable_hwecc() argument
261 struct tmio_nand *tmio = mtd_to_tmio(mtd); in tmio_nand_enable_hwecc()
268 static int tmio_nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, in tmio_nand_calculate_ecc() argument
271 struct tmio_nand *tmio = mtd_to_tmio(mtd); in tmio_nand_calculate_ecc()
290 static int tmio_nand_correct_data(struct mtd_info *mtd, unsigned char *buf, in tmio_nand_correct_data() argument
367 struct mtd_info *mtd; in tmio_probe() local
381 mtd = &tmio->mtd; in tmio_probe()
383 mtd->priv = nand_chip; in tmio_probe()
384 mtd->name = "tmio-nand"; in tmio_probe()
385 mtd->dev.parent = &dev->dev; in tmio_probe()
437 if (nand_scan(mtd, 1)) { in tmio_probe()
442 retval = mtd_device_parse_register(mtd, NULL, NULL, in tmio_probe()
448 nand_release(mtd); in tmio_probe()
459 nand_release(&tmio->mtd); in tmio_remove()