• Home
  • Raw
  • Download

Lines Matching refs:mtd

159 	struct mtd_info mtd;  member
174 #define mtd_to_nfc(_mtd) container_of(_mtd, struct vf610_nfc, mtd)
323 struct mtd_info *mtd = data; in vf610_nfc_irq() local
324 struct vf610_nfc *nfc = mtd_to_nfc(mtd); in vf610_nfc_irq()
357 static void vf610_nfc_command(struct mtd_info *mtd, unsigned command, in vf610_nfc_command() argument
360 struct vf610_nfc *nfc = mtd_to_nfc(mtd); in vf610_nfc_command()
394 trfr_sz += mtd->oobsize; in vf610_nfc_command()
395 column = mtd->writesize; in vf610_nfc_command()
404 trfr_sz += mtd->writesize + mtd->oobsize; in vf610_nfc_command()
451 static void vf610_nfc_read_buf(struct mtd_info *mtd, u_char *buf, int len) in vf610_nfc_read_buf() argument
453 struct vf610_nfc *nfc = mtd_to_nfc(mtd); in vf610_nfc_read_buf()
464 static void vf610_nfc_write_buf(struct mtd_info *mtd, const uint8_t *buf, in vf610_nfc_write_buf() argument
467 struct vf610_nfc *nfc = mtd_to_nfc(mtd); in vf610_nfc_write_buf()
471 l = min_t(uint, len, mtd->writesize + mtd->oobsize - c); in vf610_nfc_write_buf()
478 static uint8_t vf610_nfc_read_byte(struct mtd_info *mtd) in vf610_nfc_read_byte() argument
480 struct vf610_nfc *nfc = mtd_to_nfc(mtd); in vf610_nfc_read_byte()
505 static u16 vf610_nfc_read_word(struct mtd_info *mtd) in vf610_nfc_read_word() argument
509 vf610_nfc_read_buf(mtd, (u_char *)&tmp, sizeof(tmp)); in vf610_nfc_read_word()
514 static int vf610_nfc_dev_ready(struct mtd_info *mtd) in vf610_nfc_dev_ready() argument
523 static void vf610_nfc_select_chip(struct mtd_info *mtd, int chip) in vf610_nfc_select_chip() argument
525 struct vf610_nfc *nfc = mtd_to_nfc(mtd); in vf610_nfc_select_chip()
557 static inline int vf610_nfc_correct_data(struct mtd_info *mtd, uint8_t *dat, in vf610_nfc_correct_data() argument
560 struct vf610_nfc *nfc = mtd_to_nfc(mtd); in vf610_nfc_correct_data()
573 vf610_nfc_command(mtd, NAND_CMD_READOOB, 0, page); in vf610_nfc_correct_data()
574 vf610_nfc_read_buf(mtd, oob, mtd->oobsize); in vf610_nfc_correct_data()
581 mtd->oobsize, NULL, 0, in vf610_nfc_correct_data()
585 static int vf610_nfc_read_page(struct mtd_info *mtd, struct nand_chip *chip, in vf610_nfc_read_page() argument
591 vf610_nfc_read_buf(mtd, buf, eccsize); in vf610_nfc_read_page()
593 vf610_nfc_read_buf(mtd, chip->oob_poi, mtd->oobsize); in vf610_nfc_read_page()
595 stat = vf610_nfc_correct_data(mtd, buf, chip->oob_poi, page); in vf610_nfc_read_page()
598 mtd->ecc_stats.failed++; in vf610_nfc_read_page()
601 mtd->ecc_stats.corrected += stat; in vf610_nfc_read_page()
606 static int vf610_nfc_write_page(struct mtd_info *mtd, struct nand_chip *chip, in vf610_nfc_write_page() argument
609 struct vf610_nfc *nfc = mtd_to_nfc(mtd); in vf610_nfc_write_page()
611 vf610_nfc_write_buf(mtd, buf, mtd->writesize); in vf610_nfc_write_page()
613 vf610_nfc_write_buf(mtd, chip->oob_poi, mtd->oobsize); in vf610_nfc_write_page()
617 nfc->write_sz = mtd->writesize + mtd->oobsize; in vf610_nfc_write_page()
665 struct mtd_info *mtd; in vf610_nfc_probe() local
677 mtd = &nfc->mtd; in vf610_nfc_probe()
680 mtd->priv = chip; in vf610_nfc_probe()
681 mtd->owner = THIS_MODULE; in vf610_nfc_probe()
682 mtd->dev.parent = nfc->dev; in vf610_nfc_probe()
683 mtd->name = DRV_NAME; in vf610_nfc_probe()
739 err = devm_request_irq(nfc->dev, irq, vf610_nfc_irq, 0, DRV_NAME, mtd); in vf610_nfc_probe()
748 if (nand_scan_ident(mtd, 1, NULL)) { in vf610_nfc_probe()
760 if (mtd->writesize + mtd->oobsize > PAGE_2K + OOB_MAX - 8) { in vf610_nfc_probe()
767 if (mtd->writesize != PAGE_2K && mtd->oobsize < 64) { in vf610_nfc_probe()
773 if (chip->ecc.size != mtd->writesize) { in vf610_nfc_probe()
780 if (mtd->oobsize > 64) in vf610_nfc_probe()
781 mtd->oobsize = 64; in vf610_nfc_probe()
798 mtd->ecclayout = chip->ecc.layout; in vf610_nfc_probe()
806 if (nand_scan_tail(mtd)) { in vf610_nfc_probe()
811 platform_set_drvdata(pdev, mtd); in vf610_nfc_probe()
814 return mtd_device_parse_register(mtd, NULL, in vf610_nfc_probe()
829 struct mtd_info *mtd = platform_get_drvdata(pdev); in vf610_nfc_remove() local
830 struct vf610_nfc *nfc = mtd_to_nfc(mtd); in vf610_nfc_remove()
832 nand_release(mtd); in vf610_nfc_remove()
840 struct mtd_info *mtd = dev_get_drvdata(dev); in vf610_nfc_suspend() local
841 struct vf610_nfc *nfc = mtd_to_nfc(mtd); in vf610_nfc_suspend()
849 struct mtd_info *mtd = dev_get_drvdata(dev); in vf610_nfc_resume() local
850 struct vf610_nfc *nfc = mtd_to_nfc(mtd); in vf610_nfc_resume()