Lines Matching refs:nand
144 struct ingenic_nand *nand = to_ingenic_nand(nand_to_mtd(chip)); in ingenic_nand_ecc_hwctl() local
146 nand->reading = (mode == NAND_ECC_READ); in ingenic_nand_ecc_hwctl()
152 struct ingenic_nand *nand = to_ingenic_nand(nand_to_mtd(chip)); in ingenic_nand_ecc_calculate() local
153 struct ingenic_nfc *nfc = to_ingenic_nfc(nand->chip.controller); in ingenic_nand_ecc_calculate()
160 if (nand->reading) in ingenic_nand_ecc_calculate()
163 params.size = nand->chip.ecc.size; in ingenic_nand_ecc_calculate()
164 params.bytes = nand->chip.ecc.bytes; in ingenic_nand_ecc_calculate()
165 params.strength = nand->chip.ecc.strength; in ingenic_nand_ecc_calculate()
173 struct ingenic_nand *nand = to_ingenic_nand(nand_to_mtd(chip)); in ingenic_nand_ecc_correct() local
174 struct ingenic_nfc *nfc = to_ingenic_nfc(nand->chip.controller); in ingenic_nand_ecc_correct()
177 params.size = nand->chip.ecc.size; in ingenic_nand_ecc_correct()
178 params.bytes = nand->chip.ecc.bytes; in ingenic_nand_ecc_correct()
179 params.strength = nand->chip.ecc.strength; in ingenic_nand_ecc_correct()
262 struct ingenic_nand *nand = to_ingenic_nand(nand_to_mtd(chip)); in ingenic_nand_exec_instr() local
299 if (!nand->busy_gpio) in ingenic_nand_exec_instr()
303 return nand_gpio_waitrdy(chip, nand->busy_gpio, in ingenic_nand_exec_instr()
316 struct ingenic_nand *nand = to_ingenic_nand(nand_to_mtd(chip)); in ingenic_nand_exec_op() local
317 struct ingenic_nfc *nfc = to_ingenic_nfc(nand->chip.controller); in ingenic_nand_exec_op()
351 struct ingenic_nand *nand; in ingenic_nand_init_chip() local
372 nand = devm_kzalloc(dev, sizeof(*nand), GFP_KERNEL); in ingenic_nand_init_chip()
373 if (!nand) in ingenic_nand_init_chip()
376 nand->busy_gpio = devm_gpiod_get_optional(dev, "rb", GPIOD_IN); in ingenic_nand_init_chip()
378 if (IS_ERR(nand->busy_gpio)) { in ingenic_nand_init_chip()
379 ret = PTR_ERR(nand->busy_gpio); in ingenic_nand_init_chip()
393 gpiod_is_active_low(nand->busy_gpio)) in ingenic_nand_init_chip()
394 gpiod_toggle_active_low(nand->busy_gpio); in ingenic_nand_init_chip()
396 nand->wp_gpio = devm_gpiod_get_optional(dev, "wp", GPIOD_OUT_LOW); in ingenic_nand_init_chip()
398 if (IS_ERR(nand->wp_gpio)) { in ingenic_nand_init_chip()
399 ret = PTR_ERR(nand->wp_gpio); in ingenic_nand_init_chip()
404 chip = &nand->chip; in ingenic_nand_init_chip()
428 list_add_tail(&nand->chip_list, &nfc->chips); in ingenic_nand_init_chip()