Lines Matching refs:ecc_cfg
310 struct mtk_ecc_config *ecc_cfg; member
670 struct mtk_ecc_config *ecc_cfg; in mtk_snand_ecc_init_ctx() local
677 ecc_cfg = kzalloc(sizeof(*ecc_cfg), GFP_KERNEL); in mtk_snand_ecc_init_ctx()
678 if (!ecc_cfg) in mtk_snand_ecc_init_ctx()
681 nand->ecc.ctx.priv = ecc_cfg; in mtk_snand_ecc_init_ctx()
698 ecc_cfg->mode = ECC_NFI_MODE; in mtk_snand_ecc_init_ctx()
699 ecc_cfg->sectors = snf->nfi_cfg.nsectors; in mtk_snand_ecc_init_ctx()
700 ecc_cfg->len = snf->caps->sector_size + snf->caps->fdm_ecc_size; in mtk_snand_ecc_init_ctx()
705 ecc_cfg->strength = max_ecc_bytes * 8 / parity_bits; in mtk_snand_ecc_init_ctx()
706 mtk_ecc_adjust_strength(snf->ecc, &ecc_cfg->strength); in mtk_snand_ecc_init_ctx()
712 u32 s_next = ecc_cfg->strength - 1; in mtk_snand_ecc_init_ctx()
716 if (s_next >= ecc_cfg->strength) in mtk_snand_ecc_init_ctx()
720 s_next = ecc_cfg->strength - 1; in mtk_snand_ecc_init_ctx()
727 conf->strength = ecc_cfg->strength; in mtk_snand_ecc_init_ctx()
729 if (ecc_cfg->strength < strength) in mtk_snand_ecc_init_ctx()
733 ecc_cfg->strength, snf->caps->sector_size); in mtk_snand_ecc_init_ctx()
740 struct mtk_ecc_config *ecc_cfg = nand_to_ecc_ctx(nand); in mtk_snand_ecc_cleanup_ctx() local
742 kfree(ecc_cfg); in mtk_snand_ecc_cleanup_ctx()
749 struct mtk_ecc_config *ecc_cfg = nand_to_ecc_ctx(nand); in mtk_snand_ecc_prepare_io_req() local
757 snf->ecc_cfg = ecc_cfg; in mtk_snand_ecc_prepare_io_req()
767 snf->ecc_cfg = NULL; in mtk_snand_ecc_finish_io_req()
943 snf->ecc_cfg->op = ECC_DECODE; in mtk_snand_read_page_cache()
944 ret = mtk_ecc_enable(snf->ecc, snf->ecc_cfg); in mtk_snand_read_page_cache()
1133 snf->ecc_cfg->op = ECC_ENCODE; in mtk_snand_write_page_cache()
1134 ret = mtk_ecc_enable(snf->ecc, snf->ecc_cfg); in mtk_snand_write_page_cache()