Lines Matching refs:mtd

34 	struct mtd_info mtd;  member
52 return container_of(mtdinfo, struct fsl_upm_nand, mtd); in to_fsl_upm_nand()
55 static int fun_chip_ready(struct mtd_info *mtd) in fun_chip_ready() argument
57 struct fsl_upm_nand *fun = to_fsl_upm_nand(mtd); in fun_chip_ready()
71 while (--cnt && !fun_chip_ready(&fun->mtd)) in fun_wait_rnb()
80 static void fun_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) in fun_cmd_ctrl() argument
82 struct nand_chip *chip = mtd->priv; in fun_cmd_ctrl()
83 struct fsl_upm_nand *fun = to_fsl_upm_nand(mtd); in fun_cmd_ctrl()
110 static void fun_select_chip(struct mtd_info *mtd, int mchip_nr) in fun_select_chip() argument
112 struct nand_chip *chip = mtd->priv; in fun_select_chip()
113 struct fsl_upm_nand *fun = to_fsl_upm_nand(mtd); in fun_select_chip()
116 chip->cmd_ctrl(mtd, NAND_CMD_NONE, 0 | NAND_CTRL_CHANGE); in fun_select_chip()
126 static uint8_t fun_read_byte(struct mtd_info *mtd) in fun_read_byte() argument
128 struct fsl_upm_nand *fun = to_fsl_upm_nand(mtd); in fun_read_byte()
133 static void fun_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) in fun_read_buf() argument
135 struct fsl_upm_nand *fun = to_fsl_upm_nand(mtd); in fun_read_buf()
142 static void fun_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len) in fun_write_buf() argument
144 struct fsl_upm_nand *fun = to_fsl_upm_nand(mtd); in fun_write_buf()
178 fun->mtd.priv = &fun->chip; in fun_chip_init()
179 fun->mtd.dev.parent = fun->dev; in fun_chip_init()
185 fun->mtd.name = kasprintf(GFP_KERNEL, "0x%llx.%s", (u64)io_res->start, in fun_chip_init()
187 if (!fun->mtd.name) { in fun_chip_init()
192 ret = nand_scan(&fun->mtd, fun->mchip_count); in fun_chip_init()
197 ret = mtd_device_parse_register(&fun->mtd, NULL, &ppdata, NULL, 0); in fun_chip_init()
201 kfree(fun->mtd.name); in fun_chip_init()
327 nand_release(&fun->mtd); in fun_remove()
328 kfree(fun->mtd.name); in fun_remove()