Lines Matching refs:nand
112 int nand_ecc_init_ctx(struct nand_device *nand) in nand_ecc_init_ctx() argument
114 if (!nand->ecc.engine || !nand->ecc.engine->ops->init_ctx) in nand_ecc_init_ctx()
117 return nand->ecc.engine->ops->init_ctx(nand); in nand_ecc_init_ctx()
125 void nand_ecc_cleanup_ctx(struct nand_device *nand) in nand_ecc_cleanup_ctx() argument
127 if (nand->ecc.engine && nand->ecc.engine->ops->cleanup_ctx) in nand_ecc_cleanup_ctx()
128 nand->ecc.engine->ops->cleanup_ctx(nand); in nand_ecc_cleanup_ctx()
137 int nand_ecc_prepare_io_req(struct nand_device *nand, in nand_ecc_prepare_io_req() argument
140 if (!nand->ecc.engine || !nand->ecc.engine->ops->prepare_io_req) in nand_ecc_prepare_io_req()
143 return nand->ecc.engine->ops->prepare_io_req(nand, req); in nand_ecc_prepare_io_req()
152 int nand_ecc_finish_io_req(struct nand_device *nand, in nand_ecc_finish_io_req() argument
155 if (!nand->ecc.engine || !nand->ecc.engine->ops->finish_io_req) in nand_ecc_finish_io_req()
158 return nand->ecc.engine->ops->finish_io_req(nand, req); in nand_ecc_finish_io_req()
166 struct nand_device *nand = mtd_to_nanddev(mtd); in nand_ooblayout_ecc_sp() local
167 unsigned int total_ecc_bytes = nand->ecc.ctx.total; in nand_ooblayout_ecc_sp()
226 struct nand_device *nand = mtd_to_nanddev(mtd); in nand_ooblayout_ecc_lp() local
227 unsigned int total_ecc_bytes = nand->ecc.ctx.total; in nand_ooblayout_ecc_lp()
241 struct nand_device *nand = mtd_to_nanddev(mtd); in nand_ooblayout_free_lp() local
242 unsigned int total_ecc_bytes = nand->ecc.ctx.total; in nand_ooblayout_free_lp()
271 struct nand_device *nand = mtd_to_nanddev(mtd); in nand_ooblayout_ecc_lp_hamming() local
272 unsigned int total_ecc_bytes = nand->ecc.ctx.total; in nand_ooblayout_ecc_lp_hamming()
298 struct nand_device *nand = mtd_to_nanddev(mtd); in nand_ooblayout_free_lp_hamming() local
299 unsigned int total_ecc_bytes = nand->ecc.ctx.total; in nand_ooblayout_free_lp_hamming()
428 void of_get_nand_ecc_user_config(struct nand_device *nand) in of_get_nand_ecc_user_config() argument
430 struct device_node *dn = nanddev_get_of_node(nand); in of_get_nand_ecc_user_config()
433 nand->ecc.user_conf.engine_type = of_get_nand_ecc_engine_type(dn); in of_get_nand_ecc_user_config()
434 nand->ecc.user_conf.algo = of_get_nand_ecc_algo(dn); in of_get_nand_ecc_user_config()
435 nand->ecc.user_conf.placement = of_get_nand_ecc_placement(dn); in of_get_nand_ecc_user_config()
439 nand->ecc.user_conf.strength = strength; in of_get_nand_ecc_user_config()
443 nand->ecc.user_conf.step_size = size; in of_get_nand_ecc_user_config()
446 nand->ecc.user_conf.flags |= NAND_ECC_MAXIMIZE_STRENGTH; in of_get_nand_ecc_user_config()
467 bool nand_ecc_is_strong_enough(struct nand_device *nand) in nand_ecc_is_strong_enough() argument
469 const struct nand_ecc_props *reqs = nanddev_get_ecc_requirements(nand); in nand_ecc_is_strong_enough()
470 const struct nand_ecc_props *conf = nanddev_get_ecc_conf(nand); in nand_ecc_is_strong_enough()
471 struct mtd_info *mtd = nanddev_to_mtd(nand); in nand_ecc_is_strong_enough()
491 struct nand_device *nand) in nand_ecc_init_req_tweaking() argument
495 ctx->nand = nand; in nand_ecc_init_req_tweaking()
499 ctx->page_buffer_size = nanddev_page_size(nand); in nand_ecc_init_req_tweaking()
501 ctx->oob_buffer_size = nanddev_per_page_oobsize(nand); in nand_ecc_init_req_tweaking()
528 struct nand_device *nand = ctx->nand; in nand_ecc_tweak_req() local
539 if (orig->datalen < nanddev_page_size(nand)) { in nand_ecc_tweak_req()
542 tweak->datalen = nanddev_page_size(nand); in nand_ecc_tweak_req()
547 if (orig->ooblen < nanddev_per_page_oobsize(nand)) { in nand_ecc_tweak_req()
550 tweak->ooblen = nanddev_per_page_oobsize(nand); in nand_ecc_tweak_req()
594 struct nand_ecc_engine *nand_ecc_get_sw_engine(struct nand_device *nand) in nand_ecc_get_sw_engine() argument
596 unsigned int algo = nand->ecc.user_conf.algo; in nand_ecc_get_sw_engine()
599 algo = nand->ecc.defaults.algo; in nand_ecc_get_sw_engine()
614 struct nand_ecc_engine *nand_ecc_get_on_die_hw_engine(struct nand_device *nand) in nand_ecc_get_on_die_hw_engine() argument
616 return nand->ecc.ondie_engine; in nand_ecc_get_on_die_hw_engine()
664 struct nand_ecc_engine *nand_ecc_get_on_host_hw_engine(struct nand_device *nand) in nand_ecc_get_on_host_hw_engine() argument
667 struct device *dev = &nand->mtd.dev; in nand_ecc_get_on_host_hw_engine()
696 void nand_ecc_put_on_host_hw_engine(struct nand_device *nand) in nand_ecc_put_on_host_hw_engine() argument
698 put_device(nand->ecc.engine->dev); in nand_ecc_put_on_host_hw_engine()