Lines Matching defs:nand

97 #include <linux/mtd/nand.h>
101 * @nand: the NAND device
105 int nand_ecc_init_ctx(struct nand_device *nand)
107 if (!nand->ecc.engine->ops->init_ctx)
110 return nand->ecc.engine->ops->init_ctx(nand);
116 * @nand: the NAND device
118 void nand_ecc_cleanup_ctx(struct nand_device *nand)
120 if (nand->ecc.engine->ops->cleanup_ctx)
121 nand->ecc.engine->ops->cleanup_ctx(nand);
127 * @nand: the NAND device
130 int nand_ecc_prepare_io_req(struct nand_device *nand,
133 if (!nand->ecc.engine->ops->prepare_io_req)
136 return nand->ecc.engine->ops->prepare_io_req(nand, req);
142 * @nand: the NAND device
145 int nand_ecc_finish_io_req(struct nand_device *nand,
148 if (!nand->ecc.engine->ops->finish_io_req)
151 return nand->ecc.engine->ops->finish_io_req(nand, req);
159 struct nand_device *nand = mtd_to_nanddev(mtd);
160 unsigned int total_ecc_bytes = nand->ecc.ctx.total;
219 struct nand_device *nand = mtd_to_nanddev(mtd);
220 unsigned int total_ecc_bytes = nand->ecc.ctx.total;
234 struct nand_device *nand = mtd_to_nanddev(mtd);
235 unsigned int total_ecc_bytes = nand->ecc.ctx.total;
264 struct nand_device *nand = mtd_to_nanddev(mtd);
265 unsigned int total_ecc_bytes = nand->ecc.ctx.total;
291 struct nand_device *nand = mtd_to_nanddev(mtd);
292 unsigned int total_ecc_bytes = nand->ecc.ctx.total;
336 if (of_property_read_bool(np, "nand-no-ecc-engine"))
339 if (of_property_read_bool(np, "nand-use-soft-ecc-engine"))
342 eng_np = of_parse_phandle(np, "nand-ecc-engine", 0);
366 err = of_property_read_string(np, "nand-ecc-placement", &pm);
390 err = of_property_read_string(np, "nand-ecc-algo", &pm);
408 ret = of_property_read_u32(np, "nand-ecc-step-size", &val);
417 ret = of_property_read_u32(np, "nand-ecc-strength", &val);
421 void of_get_nand_ecc_user_config(struct nand_device *nand)
423 struct device_node *dn = nanddev_get_of_node(nand);
426 nand->ecc.user_conf.engine_type = of_get_nand_ecc_engine_type(dn);
427 nand->ecc.user_conf.algo = of_get_nand_ecc_algo(dn);
428 nand->ecc.user_conf.placement = of_get_nand_ecc_placement(dn);
432 nand->ecc.user_conf.strength = strength;
436 nand->ecc.user_conf.step_size = size;
438 if (of_property_read_bool(dn, "nand-ecc-maximize"))
439 nand->ecc.user_conf.flags |= NAND_ECC_MAXIMIZE_STRENGTH;
447 * @nand: Device to check
460 bool nand_ecc_is_strong_enough(struct nand_device *nand)
462 const struct nand_ecc_props *reqs = nanddev_get_ecc_requirements(nand);
463 const struct nand_ecc_props *conf = nanddev_get_ecc_conf(nand);
464 struct mtd_info *mtd = nanddev_to_mtd(nand);