Lines Matching refs:nand

106 int nand_ecc_init_ctx(struct nand_device *nand)  in nand_ecc_init_ctx()  argument
108 if (!nand->ecc.engine || !nand->ecc.engine->ops->init_ctx) in nand_ecc_init_ctx()
111 return nand->ecc.engine->ops->init_ctx(nand); in nand_ecc_init_ctx()
119 void nand_ecc_cleanup_ctx(struct nand_device *nand) in nand_ecc_cleanup_ctx() argument
121 if (nand->ecc.engine && nand->ecc.engine->ops->cleanup_ctx) in nand_ecc_cleanup_ctx()
122 nand->ecc.engine->ops->cleanup_ctx(nand); in nand_ecc_cleanup_ctx()
131 int nand_ecc_prepare_io_req(struct nand_device *nand, in nand_ecc_prepare_io_req() argument
134 if (!nand->ecc.engine || !nand->ecc.engine->ops->prepare_io_req) in nand_ecc_prepare_io_req()
137 return nand->ecc.engine->ops->prepare_io_req(nand, req); in nand_ecc_prepare_io_req()
146 int nand_ecc_finish_io_req(struct nand_device *nand, in nand_ecc_finish_io_req() argument
149 if (!nand->ecc.engine || !nand->ecc.engine->ops->finish_io_req) in nand_ecc_finish_io_req()
152 return nand->ecc.engine->ops->finish_io_req(nand, req); in nand_ecc_finish_io_req()
160 struct nand_device *nand = mtd_to_nanddev(mtd); in nand_ooblayout_ecc_sp() local
161 unsigned int total_ecc_bytes = nand->ecc.ctx.total; in nand_ooblayout_ecc_sp()
220 struct nand_device *nand = mtd_to_nanddev(mtd); in nand_ooblayout_ecc_lp() local
221 unsigned int total_ecc_bytes = nand->ecc.ctx.total; in nand_ooblayout_ecc_lp()
235 struct nand_device *nand = mtd_to_nanddev(mtd); in nand_ooblayout_free_lp() local
236 unsigned int total_ecc_bytes = nand->ecc.ctx.total; in nand_ooblayout_free_lp()
265 struct nand_device *nand = mtd_to_nanddev(mtd); in nand_ooblayout_ecc_lp_hamming() local
266 unsigned int total_ecc_bytes = nand->ecc.ctx.total; in nand_ooblayout_ecc_lp_hamming()
292 struct nand_device *nand = mtd_to_nanddev(mtd); in nand_ooblayout_free_lp_hamming() local
293 unsigned int total_ecc_bytes = nand->ecc.ctx.total; in nand_ooblayout_free_lp_hamming()
422 void of_get_nand_ecc_user_config(struct nand_device *nand) in of_get_nand_ecc_user_config() argument
424 struct device_node *dn = nanddev_get_of_node(nand); in of_get_nand_ecc_user_config()
427 nand->ecc.user_conf.engine_type = of_get_nand_ecc_engine_type(dn); in of_get_nand_ecc_user_config()
428 nand->ecc.user_conf.algo = of_get_nand_ecc_algo(dn); in of_get_nand_ecc_user_config()
429 nand->ecc.user_conf.placement = of_get_nand_ecc_placement(dn); in of_get_nand_ecc_user_config()
433 nand->ecc.user_conf.strength = strength; in of_get_nand_ecc_user_config()
437 nand->ecc.user_conf.step_size = size; in of_get_nand_ecc_user_config()
440 nand->ecc.user_conf.flags |= NAND_ECC_MAXIMIZE_STRENGTH; in of_get_nand_ecc_user_config()
461 bool nand_ecc_is_strong_enough(struct nand_device *nand) in nand_ecc_is_strong_enough() argument
463 const struct nand_ecc_props *reqs = nanddev_get_ecc_requirements(nand); in nand_ecc_is_strong_enough()
464 const struct nand_ecc_props *conf = nanddev_get_ecc_conf(nand); in nand_ecc_is_strong_enough()
465 struct mtd_info *mtd = nanddev_to_mtd(nand); in nand_ecc_is_strong_enough()
485 struct nand_device *nand) in nand_ecc_init_req_tweaking() argument
489 ctx->nand = nand; in nand_ecc_init_req_tweaking()
493 ctx->page_buffer_size = nanddev_page_size(nand); in nand_ecc_init_req_tweaking()
495 ctx->oob_buffer_size = nanddev_per_page_oobsize(nand); in nand_ecc_init_req_tweaking()
522 struct nand_device *nand = ctx->nand; in nand_ecc_tweak_req() local
533 if (orig->datalen < nanddev_page_size(nand)) { in nand_ecc_tweak_req()
536 tweak->datalen = nanddev_page_size(nand); in nand_ecc_tweak_req()
541 if (orig->ooblen < nanddev_per_page_oobsize(nand)) { in nand_ecc_tweak_req()
544 tweak->ooblen = nanddev_per_page_oobsize(nand); in nand_ecc_tweak_req()
588 struct nand_ecc_engine *nand_ecc_get_sw_engine(struct nand_device *nand) in nand_ecc_get_sw_engine() argument
590 unsigned int algo = nand->ecc.user_conf.algo; in nand_ecc_get_sw_engine()
593 algo = nand->ecc.defaults.algo; in nand_ecc_get_sw_engine()
608 struct nand_ecc_engine *nand_ecc_get_on_die_hw_engine(struct nand_device *nand) in nand_ecc_get_on_die_hw_engine() argument
610 return nand->ecc.ondie_engine; in nand_ecc_get_on_die_hw_engine()