Lines Matching defs:nand

18 #include <linux/mtd/nand.h>
19 #include <linux/mtd/nand-ecc-mxic.h>
124 static struct mxic_ecc_engine *nand_to_mxic(struct nand_device *nand)
126 struct nand_ecc_engine *eng = nand->ecc.engine;
137 struct nand_device *nand = mtd_to_nanddev(mtd);
138 struct mxic_ecc_ctx *ctx = nand_to_ecc_ctx(nand);
152 struct nand_device *nand = mtd_to_nanddev(mtd);
153 struct mxic_ecc_ctx *ctx = nand_to_ecc_ctx(nand);
219 static int mxic_ecc_init_ctx(struct nand_device *nand, struct device *dev)
221 struct mxic_ecc_engine *mxic = nand_to_mxic(nand);
222 struct nand_ecc_props *conf = &nand->ecc.ctx.conf;
223 struct nand_ecc_props *reqs = &nand->ecc.requirements;
224 struct nand_ecc_props *user = &nand->ecc.user_conf;
225 struct mtd_info *mtd = nanddev_to_mtd(nand);
237 nand->ecc.ctx.priv = ctx;
309 ctx->req_ctx.oob_buffer_size = nanddev_per_page_oobsize(nand) +
311 ret = nand_ecc_init_req_tweaking(&ctx->req_ctx, nand);
360 static int mxic_ecc_init_ctx_external(struct nand_device *nand)
362 struct mxic_ecc_engine *mxic = nand_to_mxic(nand);
363 struct device *dev = nand->ecc.engine->dev;
368 ret = mxic_ecc_init_ctx(nand, dev);
380 static int mxic_ecc_init_ctx_pipelined(struct nand_device *nand)
382 struct mxic_ecc_engine *mxic = nand_to_mxic(nand);
387 dev = nand_ecc_get_engine_dev(nand->ecc.engine->dev);
393 ret = mxic_ecc_init_ctx(nand, dev);
397 ctx = nand_to_ecc_ctx(nand);
412 static void mxic_ecc_cleanup_ctx(struct nand_device *nand)
414 struct mxic_ecc_ctx *ctx = nand_to_ecc_ctx(nand);
520 struct nand_device *nand)
522 struct mxic_ecc_ctx *ctx = nand_to_ecc_ctx(nand);
523 struct mtd_info *mtd = nanddev_to_mtd(nand);
552 static int mxic_ecc_prepare_io_req_external(struct nand_device *nand,
555 struct mxic_ecc_engine *mxic = nand_to_mxic(nand);
556 struct mxic_ecc_ctx *ctx = nand_to_ecc_ctx(nand);
557 struct mtd_info *mtd = nanddev_to_mtd(nand);
612 static int mxic_ecc_finish_io_req_external(struct nand_device *nand,
615 struct mxic_ecc_engine *mxic = nand_to_mxic(nand);
616 struct mxic_ecc_ctx *ctx = nand_to_ecc_ctx(nand);
664 return mxic_ecc_count_biterrs(mxic, nand);
668 static int mxic_ecc_prepare_io_req_pipelined(struct nand_device *nand,
671 struct mxic_ecc_engine *mxic = nand_to_mxic(nand);
672 struct mxic_ecc_ctx *ctx = nand_to_ecc_ctx(nand);
700 static int mxic_ecc_finish_io_req_pipelined(struct nand_device *nand,
703 struct mxic_ecc_engine *mxic = nand_to_mxic(nand);
704 struct mxic_ecc_ctx *ctx = nand_to_ecc_ctx(nand);
718 ret = mxic_ecc_count_biterrs(mxic, nand);
752 /* Retrieve the nand-ecc-engine phandle */
753 np = of_parse_phandle(spi_pdev->dev.of_node, "nand-ecc-engine", 0);
860 .compatible = "mxicy,nand-ecc-engine-rev3",
868 .name = "mxic-nand-ecc-engine",