Lines Matching refs:mtd

302 	struct mtd_info		mtd;  member
330 static void fsmc_select_chip(struct mtd_info *mtd, int chipnr) in fsmc_select_chip() argument
332 struct nand_chip *chip = mtd->priv; in fsmc_select_chip()
335 host = container_of(mtd, struct fsmc_nand_data, mtd); in fsmc_select_chip()
339 chip->cmd_ctrl(mtd, NAND_CMD_NONE, 0 | NAND_CTRL_CHANGE); in fsmc_select_chip()
359 static void fsmc_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) in fsmc_cmd_ctrl() argument
361 struct nand_chip *this = mtd->priv; in fsmc_cmd_ctrl()
362 struct fsmc_nand_data *host = container_of(mtd, in fsmc_cmd_ctrl()
363 struct fsmc_nand_data, mtd); in fsmc_cmd_ctrl()
446 static void fsmc_enable_hwecc(struct mtd_info *mtd, int mode) in fsmc_enable_hwecc() argument
448 struct fsmc_nand_data *host = container_of(mtd, in fsmc_enable_hwecc()
449 struct fsmc_nand_data, mtd); in fsmc_enable_hwecc()
466 static int fsmc_read_hwecc_ecc4(struct mtd_info *mtd, const uint8_t *data, in fsmc_read_hwecc_ecc4() argument
469 struct fsmc_nand_data *host = container_of(mtd, in fsmc_read_hwecc_ecc4()
470 struct fsmc_nand_data, mtd); in fsmc_read_hwecc_ecc4()
517 static int fsmc_read_hwecc_ecc1(struct mtd_info *mtd, const uint8_t *data, in fsmc_read_hwecc_ecc1() argument
520 struct fsmc_nand_data *host = container_of(mtd, in fsmc_read_hwecc_ecc1()
521 struct fsmc_nand_data, mtd); in fsmc_read_hwecc_ecc1()
629 static void fsmc_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len) in fsmc_write_buf() argument
632 struct nand_chip *chip = mtd->priv; in fsmc_write_buf()
652 static void fsmc_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) in fsmc_read_buf() argument
655 struct nand_chip *chip = mtd->priv; in fsmc_read_buf()
675 static void fsmc_read_buf_dma(struct mtd_info *mtd, uint8_t *buf, int len) in fsmc_read_buf_dma() argument
679 host = container_of(mtd, struct fsmc_nand_data, mtd); in fsmc_read_buf_dma()
689 static void fsmc_write_buf_dma(struct mtd_info *mtd, const uint8_t *buf, in fsmc_write_buf_dma() argument
694 host = container_of(mtd, struct fsmc_nand_data, mtd); in fsmc_write_buf_dma()
712 static int fsmc_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, in fsmc_read_page_hwecc() argument
715 struct fsmc_nand_data *host = container_of(mtd, in fsmc_read_page_hwecc()
716 struct fsmc_nand_data, mtd); in fsmc_read_page_hwecc()
735 chip->cmdfunc(mtd, NAND_CMD_READ0, s * eccsize, page); in fsmc_read_page_hwecc()
736 chip->ecc.hwctl(mtd, NAND_ECC_READ); in fsmc_read_page_hwecc()
737 chip->read_buf(mtd, p, eccsize); in fsmc_read_page_hwecc()
752 chip->cmdfunc(mtd, NAND_CMD_READOOB, off, page); in fsmc_read_page_hwecc()
753 chip->read_buf(mtd, oob + j, len); in fsmc_read_page_hwecc()
758 chip->ecc.calculate(mtd, p, &ecc_calc[i]); in fsmc_read_page_hwecc()
760 stat = chip->ecc.correct(mtd, p, &ecc_code[i], &ecc_calc[i]); in fsmc_read_page_hwecc()
762 mtd->ecc_stats.failed++; in fsmc_read_page_hwecc()
764 mtd->ecc_stats.corrected += stat; in fsmc_read_page_hwecc()
782 static int fsmc_bch8_correct_data(struct mtd_info *mtd, uint8_t *dat, in fsmc_bch8_correct_data() argument
785 struct fsmc_nand_data *host = container_of(mtd, in fsmc_bch8_correct_data()
786 struct fsmc_nand_data, mtd); in fsmc_bch8_correct_data()
787 struct nand_chip *chip = mtd->priv; in fsmc_bch8_correct_data()
931 struct mtd_info *mtd; in fsmc_nand_probe() local
1015 mtd = &host->mtd; in fsmc_nand_probe()
1017 mtd->priv = nand; in fsmc_nand_probe()
1020 host->mtd.dev.parent = &pdev->dev; in fsmc_nand_probe()
1083 if (nand_scan_ident(&host->mtd, 1, NULL)) { in fsmc_nand_probe()
1090 switch (host->mtd.oobsize) { in fsmc_nand_probe()
1113 mtd->oobsize); in fsmc_nand_probe()
1141 switch (host->mtd.oobsize) { in fsmc_nand_probe()
1154 mtd->oobsize); in fsmc_nand_probe()
1162 if (nand_scan_tail(&host->mtd)) { in fsmc_nand_probe()
1177 host->mtd.name = "nand"; in fsmc_nand_probe()
1179 ret = mtd_device_parse_register(&host->mtd, NULL, &ppdata, in fsmc_nand_probe()
1210 nand_release(&host->mtd); in fsmc_nand_remove()