Lines Matching refs:mtd

16 #include <linux/mtd/mtd.h>
17 #include <linux/mtd/rawnand.h>
18 #include <linux/mtd/partitions.h>
163 struct mtd_info *mtd = nand_to_mtd(chip);
185 if (mtd->writesize > 512 &&
187 column += mtd->writesize;
205 if (mtd->size > mtd->writesize << 16)
225 cafe->datalen = mtd->writesize + mtd->oobsize - column;
244 else if (command == NAND_CMD_READ0 && mtd->writesize > 512)
333 struct mtd_info *mtd = id;
334 struct nand_chip *chip = mtd_to_nand(mtd);
347 struct mtd_info *mtd = nand_to_mtd(chip);
349 return nand_prog_page_op(chip, page, mtd->writesize, chip->oob_poi,
350 mtd->oobsize);
356 struct mtd_info *mtd = nand_to_mtd(chip);
358 return nand_read_oob_op(chip, page, 0, chip->oob_poi, mtd->oobsize);
373 struct mtd_info *mtd = nand_to_mtd(chip);
381 nand_read_page_op(chip, page, 0, buf, mtd->writesize);
382 chip->legacy.read_buf(chip, chip->oob_poi, mtd->oobsize);
439 mtd->ecc_stats.failed++;
442 mtd->ecc_stats.corrected += n;
450 static int cafe_ooblayout_ecc(struct mtd_info *mtd, int section,
453 struct nand_chip *chip = mtd_to_nand(mtd);
464 static int cafe_ooblayout_free(struct mtd_info *mtd, int section,
467 struct nand_chip *chip = mtd_to_nand(mtd);
473 oobregion->length = mtd->oobsize - chip->ecc.total;
537 struct mtd_info *mtd = nand_to_mtd(chip);
540 nand_prog_page_begin_op(chip, page, 0, buf, mtd->writesize);
541 chip->legacy.write_buf(chip, chip->oob_poi, mtd->oobsize);
593 struct mtd_info *mtd = nand_to_mtd(chip);
613 if (mtd->writesize == 2048)
617 mtd_set_ooblayout(mtd, &cafe_ooblayout_ops);
618 if (mtd->writesize == 2048) {
621 } else if (mtd->writesize == 512) {
627 mtd->writesize);
634 cafe->nand.ecc.size = mtd->writesize;
665 struct mtd_info *mtd;
687 mtd = nand_to_mtd(&cafe->nand);
688 mtd->dev.parent = &pdev->dev;
753 "CAFE NAND", mtd);
785 pci_set_drvdata(pdev, mtd);
787 mtd->name = "cafe_nand";
788 err = mtd_device_parse_register(mtd, part_probes, NULL, NULL, 0);
799 free_irq(pdev->irq, mtd);
814 struct mtd_info *mtd = pci_get_drvdata(pdev);
815 struct nand_chip *chip = mtd_to_nand(mtd);
821 free_irq(pdev->irq, mtd);
822 ret = mtd_device_unregister(mtd);
843 struct mtd_info *mtd = pci_get_drvdata(pdev);
844 struct nand_chip *chip = mtd_to_nand(mtd);