Lines Matching refs:ncfg
193 struct lpc32xx_nand_cfg_mlc *ncfg; member
269 tmp |= MLCTIMEREG_TCEA_DELAY(clkrate / host->ncfg->tcea_delay + 1); in lpc32xx_nand_setup()
270 tmp |= MLCTIMEREG_BUSY_DELAY(clkrate / host->ncfg->busy_delay + 1); in lpc32xx_nand_setup()
271 tmp |= MLCTIMEREG_NAND_TA(clkrate / host->ncfg->nand_ta + 1); in lpc32xx_nand_setup()
272 tmp |= MLCTIMEREG_RD_HIGH(clkrate / host->ncfg->rd_high + 1); in lpc32xx_nand_setup()
273 tmp |= MLCTIMEREG_RD_LOW(clkrate / host->ncfg->rd_low); in lpc32xx_nand_setup()
274 tmp |= MLCTIMEREG_WR_HIGH(clkrate / host->ncfg->wr_high + 1); in lpc32xx_nand_setup()
275 tmp |= MLCTIMEREG_WR_LOW(clkrate / host->ncfg->wr_low); in lpc32xx_nand_setup()
385 if (gpio_is_valid(host->ncfg->wp_gpio)) in lpc32xx_wp_enable()
386 gpio_set_value(host->ncfg->wp_gpio, 0); in lpc32xx_wp_enable()
394 if (gpio_is_valid(host->ncfg->wp_gpio)) in lpc32xx_wp_disable()
395 gpio_set_value(host->ncfg->wp_gpio, 1); in lpc32xx_wp_disable()
630 struct lpc32xx_nand_cfg_mlc *ncfg; in lpc32xx_parse_dt() local
633 ncfg = devm_kzalloc(dev, sizeof(*ncfg), GFP_KERNEL); in lpc32xx_parse_dt()
634 if (!ncfg) in lpc32xx_parse_dt()
637 of_property_read_u32(np, "nxp,tcea-delay", &ncfg->tcea_delay); in lpc32xx_parse_dt()
638 of_property_read_u32(np, "nxp,busy-delay", &ncfg->busy_delay); in lpc32xx_parse_dt()
639 of_property_read_u32(np, "nxp,nand-ta", &ncfg->nand_ta); in lpc32xx_parse_dt()
640 of_property_read_u32(np, "nxp,rd-high", &ncfg->rd_high); in lpc32xx_parse_dt()
641 of_property_read_u32(np, "nxp,rd-low", &ncfg->rd_low); in lpc32xx_parse_dt()
642 of_property_read_u32(np, "nxp,wr-high", &ncfg->wr_high); in lpc32xx_parse_dt()
643 of_property_read_u32(np, "nxp,wr-low", &ncfg->wr_low); in lpc32xx_parse_dt()
645 if (!ncfg->tcea_delay || !ncfg->busy_delay || !ncfg->nand_ta || in lpc32xx_parse_dt()
646 !ncfg->rd_high || !ncfg->rd_low || !ncfg->wr_high || in lpc32xx_parse_dt()
647 !ncfg->wr_low) { in lpc32xx_parse_dt()
652 ncfg->wp_gpio = of_get_named_gpio(np, "gpios", 0); in lpc32xx_parse_dt()
654 return ncfg; in lpc32xx_parse_dt()
711 host->ncfg = lpc32xx_parse_dt(&pdev->dev); in lpc32xx_nand_probe()
712 if (!host->ncfg) { in lpc32xx_nand_probe()
717 if (host->ncfg->wp_gpio == -EPROBE_DEFER) in lpc32xx_nand_probe()
719 if (gpio_is_valid(host->ncfg->wp_gpio) && in lpc32xx_nand_probe()
720 gpio_request(host->ncfg->wp_gpio, "NAND WP")) { in lpc32xx_nand_probe()
811 res = mtd_device_register(mtd, host->ncfg->parts, in lpc32xx_nand_probe()
812 host->ncfg->num_parts); in lpc32xx_nand_probe()
831 gpio_free(host->ncfg->wp_gpio); in lpc32xx_nand_probe()
853 gpio_free(host->ncfg->wp_gpio); in lpc32xx_nand_remove()