Lines Matching refs:mtd
65 static inline struct r852_device *r852_get_dev(struct mtd_info *mtd) in r852_get_dev() argument
67 struct nand_chip *chip = mtd->priv; in r852_get_dev()
232 static void r852_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len) in r852_write_buf() argument
234 struct r852_device *dev = r852_get_dev(mtd); in r852_write_buf()
266 static void r852_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) in r852_read_buf() argument
268 struct r852_device *dev = r852_get_dev(mtd); in r852_read_buf()
303 static uint8_t r852_read_byte(struct mtd_info *mtd) in r852_read_byte() argument
305 struct r852_device *dev = r852_get_dev(mtd); in r852_read_byte()
317 static void r852_cmdctl(struct mtd_info *mtd, int dat, unsigned int ctrl) in r852_cmdctl() argument
319 struct r852_device *dev = r852_get_dev(mtd); in r852_cmdctl()
362 static int r852_wait(struct mtd_info *mtd, struct nand_chip *chip) in r852_wait() argument
373 if (chip->dev_ready(mtd)) in r852_wait()
376 chip->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1); in r852_wait()
377 status = (int)chip->read_byte(mtd); in r852_wait()
391 static int r852_ready(struct mtd_info *mtd) in r852_ready() argument
393 struct r852_device *dev = r852_get_dev(mtd); in r852_ready()
402 static void r852_ecc_hwctl(struct mtd_info *mtd, int mode) in r852_ecc_hwctl() argument
404 struct r852_device *dev = r852_get_dev(mtd); in r852_ecc_hwctl()
434 static int r852_ecc_calculate(struct mtd_info *mtd, const uint8_t *dat, in r852_ecc_calculate() argument
437 struct r852_device *dev = r852_get_dev(mtd); in r852_ecc_calculate()
466 static int r852_ecc_correct(struct mtd_info *mtd, uint8_t *dat, in r852_ecc_correct() argument
473 struct r852_device *dev = r852_get_dev(mtd); in r852_ecc_correct()
522 static int r852_read_oob(struct mtd_info *mtd, struct nand_chip *chip, in r852_read_oob() argument
525 chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); in r852_read_oob()
526 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); in r852_read_oob()
594 struct mtd_info *mtd = container_of(sys_dev, struct mtd_info, dev); in r852_media_type_show() local
595 struct r852_device *dev = r852_get_dev(mtd); in r852_media_type_show()
637 dev->mtd = kzalloc(sizeof(struct mtd_info), GFP_KERNEL); in r852_register_nand_device()
639 if (!dev->mtd) in r852_register_nand_device()
644 dev->mtd->priv = dev->chip; in r852_register_nand_device()
645 dev->mtd->dev.parent = &dev->pci_dev->dev; in r852_register_nand_device()
652 if (sm_register_device(dev->mtd, dev->sm)) in r852_register_nand_device()
655 if (device_create_file(&dev->mtd->dev, &dev_attr_media_type)) { in r852_register_nand_device()
663 nand_release(dev->mtd); in r852_register_nand_device()
665 kfree(dev->mtd); in r852_register_nand_device()
681 device_remove_file(&dev->mtd->dev, &dev_attr_media_type); in r852_unregister_nand_device()
682 nand_release(dev->mtd); in r852_unregister_nand_device()
685 kfree(dev->mtd); in r852_unregister_nand_device()
686 dev->mtd = NULL; in r852_unregister_nand_device()
1054 dev->chip->select_chip(dev->mtd, 0); in r852_resume()
1055 dev->chip->cmdfunc(dev->mtd, NAND_CMD_RESET, -1, -1); in r852_resume()
1056 dev->chip->select_chip(dev->mtd, -1); in r852_resume()