Lines Matching defs:mtd

23 #include <linux/mtd/mtd.h>
24 #include <linux/mtd/rawnand.h>
25 #include <linux/mtd/partitions.h>
157 static int pl35x_ecc_ooblayout16_ecc(struct mtd_info *mtd, int section,
160 struct nand_chip *chip = mtd_to_nand(mtd);
171 static int pl35x_ecc_ooblayout16_free(struct mtd_info *mtd, int section,
174 struct nand_chip *chip = mtd_to_nand(mtd);
470 struct mtd_info *mtd = nand_to_mtd(chip);
485 mtd->ecc_stats.failed++;
492 mtd->ecc_stats.failed++;
494 mtd->ecc_stats.corrected += stats;
508 struct mtd_info *mtd = nand_to_mtd(chip);
509 unsigned int first_row = (mtd->writesize <= 512) ? 1 : 2;
539 pl35x_nand_write_data_op(chip, buf, mtd->writesize, false,
551 memset(chip->oob_poi, 0xFF, mtd->oobsize);
553 ret = mtd_ooblayout_set_eccbytes(mtd, nfc->ecc_buf, chip->oob_poi,
559 pl35x_nand_write_data_op(chip, chip->oob_poi, mtd->oobsize, false, 0,
599 struct mtd_info *mtd = nand_to_mtd(chip);
600 unsigned int first_row = (mtd->writesize <= 512) ? 1 : 2;
637 pl35x_nand_read_data_op(chip, buf, mtd->writesize, false,
644 pl35x_nand_read_data_op(chip, chip->oob_poi, mtd->oobsize, false,
646 ret = mtd_ooblayout_get_eccbytes(mtd, nfc->ecc_buf, chip->oob_poi, 0,
899 struct mtd_info *mtd = nand_to_mtd(chip);
902 if (mtd->writesize < SZ_512 || mtd->writesize > SZ_2K) {
911 chip->ecc.steps = mtd->writesize / chip->ecc.size;
915 pl35x_smc_set_ecc_pg_size(nfc, chip, mtd->writesize);
922 switch (mtd->oobsize) {
925 mtd_set_ooblayout(mtd, &pl35x_ecc_ooblayout16_ops);
929 mtd_set_ooblayout(mtd, nand_get_large_page_ooblayout());
945 struct mtd_info *mtd = nand_to_mtd(chip);
961 if (mtd->writesize <= SZ_512)
1043 struct mtd_info *mtd;
1070 mtd = nand_to_mtd(chip);
1071 mtd->dev.parent = nfc->dev;
1073 if (!mtd->name) {
1074 mtd->name = devm_kasprintf(nfc->dev, GFP_KERNEL,
1076 if (!mtd->name) {
1077 dev_err(nfc->dev, "Failed to allocate mtd->name\n");
1086 ret = mtd_device_register(mtd, NULL, 0);