Lines Matching refs:mtd
62 struct mtd_info mtd; member
77 static inline struct jz_nand *mtd_to_jz_nand(struct mtd_info *mtd) in mtd_to_jz_nand() argument
79 return container_of(mtd, struct jz_nand, mtd); in mtd_to_jz_nand()
82 static void jz_nand_select_chip(struct mtd_info *mtd, int chipnr) in jz_nand_select_chip() argument
84 struct jz_nand *nand = mtd_to_jz_nand(mtd); in jz_nand_select_chip()
85 struct nand_chip *chip = mtd->priv; in jz_nand_select_chip()
104 static void jz_nand_cmd_ctrl(struct mtd_info *mtd, int dat, unsigned int ctrl) in jz_nand_cmd_ctrl() argument
106 struct jz_nand *nand = mtd_to_jz_nand(mtd); in jz_nand_cmd_ctrl()
107 struct nand_chip *chip = mtd->priv; in jz_nand_cmd_ctrl()
132 static int jz_nand_dev_ready(struct mtd_info *mtd) in jz_nand_dev_ready() argument
134 struct jz_nand *nand = mtd_to_jz_nand(mtd); in jz_nand_dev_ready()
138 static void jz_nand_hwctl(struct mtd_info *mtd, int mode) in jz_nand_hwctl() argument
140 struct jz_nand *nand = mtd_to_jz_nand(mtd); in jz_nand_hwctl()
166 static int jz_nand_calculate_ecc_rs(struct mtd_info *mtd, const uint8_t *dat, in jz_nand_calculate_ecc_rs() argument
169 struct jz_nand *nand = mtd_to_jz_nand(mtd); in jz_nand_calculate_ecc_rs()
219 static int jz_nand_correct_ecc_rs(struct mtd_info *mtd, uint8_t *dat, in jz_nand_correct_ecc_rs() argument
222 struct jz_nand *nand = mtd_to_jz_nand(mtd); in jz_nand_correct_ecc_rs()
337 struct mtd_info *mtd = &nand->mtd; in jz_nand_detect_bank() local
367 ret = nand_scan_ident(mtd, 1, NULL); in jz_nand_detect_bank()
372 chip->select_chip(mtd, 0); in jz_nand_detect_bank()
373 chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); in jz_nand_detect_bank()
374 chip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1); in jz_nand_detect_bank()
375 *nand_maf_id = chip->read_byte(mtd); in jz_nand_detect_bank()
376 *nand_dev_id = chip->read_byte(mtd); in jz_nand_detect_bank()
379 chip->select_chip(mtd, chipnr); in jz_nand_detect_bank()
380 chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); in jz_nand_detect_bank()
381 chip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1); in jz_nand_detect_bank()
382 if (*nand_maf_id != chip->read_byte(mtd) in jz_nand_detect_bank()
383 || *nand_dev_id != chip->read_byte(mtd)) { in jz_nand_detect_bank()
390 mtd->size += chip->chipsize; in jz_nand_detect_bank()
414 struct mtd_info *mtd; in jz_nand_probe() local
435 mtd = &nand->mtd; in jz_nand_probe()
437 mtd->priv = chip; in jz_nand_probe()
438 mtd->dev.parent = &pdev->dev; in jz_nand_probe()
439 mtd->name = "jz4740-nand"; in jz_nand_probe()
505 ret = nand_scan_tail(mtd); in jz_nand_probe()
511 ret = mtd_device_parse_register(mtd, NULL, NULL, in jz_nand_probe()
525 nand_release(mtd); in jz_nand_probe()
546 nand_release(&nand->mtd); in jz_nand_remove()