Lines Matching refs:nand
362 int nand_ecc_sw_hamming_calculate(struct nand_device *nand, in nand_ecc_sw_hamming_calculate() argument
365 struct nand_ecc_sw_hamming_conf *engine_conf = nand->ecc.ctx.priv; in nand_ecc_sw_hamming_calculate()
366 unsigned int step_size = nand->ecc.ctx.conf.step_size; in nand_ecc_sw_hamming_calculate()
454 int nand_ecc_sw_hamming_correct(struct nand_device *nand, unsigned char *buf, in nand_ecc_sw_hamming_correct() argument
458 struct nand_ecc_sw_hamming_conf *engine_conf = nand->ecc.ctx.priv; in nand_ecc_sw_hamming_correct()
459 unsigned int step_size = nand->ecc.ctx.conf.step_size; in nand_ecc_sw_hamming_correct()
467 int nand_ecc_sw_hamming_init_ctx(struct nand_device *nand) in nand_ecc_sw_hamming_init_ctx() argument
469 struct nand_ecc_props *conf = &nand->ecc.ctx.conf; in nand_ecc_sw_hamming_init_ctx()
471 struct mtd_info *mtd = nanddev_to_mtd(nand); in nand_ecc_sw_hamming_init_ctx()
492 conf->step_size = nand->ecc.user_conf.step_size; in nand_ecc_sw_hamming_init_ctx()
503 ret = nand_ecc_init_req_tweaking(&engine_conf->req_ctx, nand); in nand_ecc_sw_hamming_init_ctx()
515 nand->ecc.ctx.priv = engine_conf; in nand_ecc_sw_hamming_init_ctx()
516 nand->ecc.ctx.nsteps = mtd->writesize / conf->step_size; in nand_ecc_sw_hamming_init_ctx()
517 nand->ecc.ctx.total = nand->ecc.ctx.nsteps * engine_conf->code_size; in nand_ecc_sw_hamming_init_ctx()
532 void nand_ecc_sw_hamming_cleanup_ctx(struct nand_device *nand) in nand_ecc_sw_hamming_cleanup_ctx() argument
534 struct nand_ecc_sw_hamming_conf *engine_conf = nand->ecc.ctx.priv; in nand_ecc_sw_hamming_cleanup_ctx()
545 static int nand_ecc_sw_hamming_prepare_io_req(struct nand_device *nand, in nand_ecc_sw_hamming_prepare_io_req() argument
548 struct nand_ecc_sw_hamming_conf *engine_conf = nand->ecc.ctx.priv; in nand_ecc_sw_hamming_prepare_io_req()
549 struct mtd_info *mtd = nanddev_to_mtd(nand); in nand_ecc_sw_hamming_prepare_io_req()
550 int eccsize = nand->ecc.ctx.conf.step_size; in nand_ecc_sw_hamming_prepare_io_req()
552 int eccsteps = nand->ecc.ctx.nsteps; in nand_ecc_sw_hamming_prepare_io_req()
553 int total = nand->ecc.ctx.total; in nand_ecc_sw_hamming_prepare_io_req()
576 nand_ecc_sw_hamming_calculate(nand, data, &ecccalc[i]); in nand_ecc_sw_hamming_prepare_io_req()
582 static int nand_ecc_sw_hamming_finish_io_req(struct nand_device *nand, in nand_ecc_sw_hamming_finish_io_req() argument
585 struct nand_ecc_sw_hamming_conf *engine_conf = nand->ecc.ctx.priv; in nand_ecc_sw_hamming_finish_io_req()
586 struct mtd_info *mtd = nanddev_to_mtd(nand); in nand_ecc_sw_hamming_finish_io_req()
587 int eccsize = nand->ecc.ctx.conf.step_size; in nand_ecc_sw_hamming_finish_io_req()
588 int total = nand->ecc.ctx.total; in nand_ecc_sw_hamming_finish_io_req()
590 int eccsteps = nand->ecc.ctx.nsteps; in nand_ecc_sw_hamming_finish_io_req()
619 nand_ecc_sw_hamming_calculate(nand, data, &ecccalc[i]); in nand_ecc_sw_hamming_finish_io_req()
622 for (eccsteps = nand->ecc.ctx.nsteps, i = 0, data = req->databuf.in; in nand_ecc_sw_hamming_finish_io_req()
625 int stat = nand_ecc_sw_hamming_correct(nand, data, in nand_ecc_sw_hamming_finish_io_req()