Lines Matching defs:config
166 static int mtk_ecc_config(struct mtk_ecc *ecc, struct mtk_ecc_config *config)
172 if (ecc->caps->ecc_strength[i] == config->strength)
178 config->strength);
184 if (config->op == ECC_ENCODE) {
186 enc_sz = config->len << 3;
188 reg = ecc_bit | (config->mode << ecc->caps->ecc_mode_shift);
192 if (config->mode != ECC_NFI_MODE)
193 writel(lower_32_bits(config->addr),
198 dec_sz = (config->len << 3) +
199 config->strength * ecc->caps->parity_bits;
201 reg = ecc_bit | (config->mode << ecc->caps->ecc_mode_shift);
206 if (config->sectors)
207 ecc->sectors = 1 << (config->sectors - 1);
293 int mtk_ecc_enable(struct mtk_ecc *ecc, struct mtk_ecc_config *config)
295 enum mtk_ecc_operation op = config->op;
307 ret = mtk_ecc_config(ecc, config);
313 if (config->mode != ECC_NFI_MODE || op != ECC_ENCODE) {
321 if (ecc->caps->pg_irq_sel && config->mode == ECC_NFI_MODE)
379 int mtk_ecc_encode(struct mtk_ecc *ecc, struct mtk_ecc_config *config,
393 config->op = ECC_ENCODE;
394 config->addr = addr;
395 ret = mtk_ecc_enable(ecc, config);
408 len = (config->strength * ecc->caps->parity_bits + 7) >> 3;