Lines Matching refs:mtd

61 	struct mtd_info mtd;  member
76 static inline struct jz_nand *mtd_to_jz_nand(struct mtd_info *mtd) in mtd_to_jz_nand() argument
78 return container_of(mtd, struct jz_nand, mtd); in mtd_to_jz_nand()
81 static void jz_nand_select_chip(struct mtd_info *mtd, int chipnr) in jz_nand_select_chip() argument
83 struct jz_nand *nand = mtd_to_jz_nand(mtd); in jz_nand_select_chip()
84 struct nand_chip *chip = mtd->priv; in jz_nand_select_chip()
103 static void jz_nand_cmd_ctrl(struct mtd_info *mtd, int dat, unsigned int ctrl) in jz_nand_cmd_ctrl() argument
105 struct jz_nand *nand = mtd_to_jz_nand(mtd); in jz_nand_cmd_ctrl()
106 struct nand_chip *chip = mtd->priv; in jz_nand_cmd_ctrl()
131 static int jz_nand_dev_ready(struct mtd_info *mtd) in jz_nand_dev_ready() argument
133 struct jz_nand *nand = mtd_to_jz_nand(mtd); in jz_nand_dev_ready()
137 static void jz_nand_hwctl(struct mtd_info *mtd, int mode) in jz_nand_hwctl() argument
139 struct jz_nand *nand = mtd_to_jz_nand(mtd); in jz_nand_hwctl()
165 static int jz_nand_calculate_ecc_rs(struct mtd_info *mtd, const uint8_t *dat, in jz_nand_calculate_ecc_rs() argument
168 struct jz_nand *nand = mtd_to_jz_nand(mtd); in jz_nand_calculate_ecc_rs()
218 static int jz_nand_correct_ecc_rs(struct mtd_info *mtd, uint8_t *dat, in jz_nand_correct_ecc_rs() argument
221 struct jz_nand *nand = mtd_to_jz_nand(mtd); in jz_nand_correct_ecc_rs()
336 struct mtd_info *mtd = &nand->mtd; in jz_nand_detect_bank() local
366 ret = nand_scan_ident(mtd, 1, NULL); in jz_nand_detect_bank()
371 chip->select_chip(mtd, 0); in jz_nand_detect_bank()
372 chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); in jz_nand_detect_bank()
373 chip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1); in jz_nand_detect_bank()
374 *nand_maf_id = chip->read_byte(mtd); in jz_nand_detect_bank()
375 *nand_dev_id = chip->read_byte(mtd); in jz_nand_detect_bank()
378 chip->select_chip(mtd, chipnr); in jz_nand_detect_bank()
379 chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); in jz_nand_detect_bank()
380 chip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1); in jz_nand_detect_bank()
381 if (*nand_maf_id != chip->read_byte(mtd) in jz_nand_detect_bank()
382 || *nand_dev_id != chip->read_byte(mtd)) { in jz_nand_detect_bank()
389 mtd->size += chip->chipsize; in jz_nand_detect_bank()
413 struct mtd_info *mtd; in jz_nand_probe() local
434 mtd = &nand->mtd; in jz_nand_probe()
436 mtd->priv = chip; in jz_nand_probe()
437 mtd->owner = THIS_MODULE; in jz_nand_probe()
438 mtd->name = "jz4740-nand"; in jz_nand_probe()
504 ret = nand_scan_tail(mtd); in jz_nand_probe()
510 ret = mtd_device_parse_register(mtd, NULL, NULL, in jz_nand_probe()
524 nand_release(mtd); in jz_nand_probe()
545 nand_release(&nand->mtd); in jz_nand_remove()