Lines Matching refs:ncfg
206 struct lpc32xx_nand_cfg_slc *ncfg; member
242 tmp = SLCTAC_WDR(host->ncfg->wdr_clks) | in lpc32xx_nand_setup()
243 SLCTAC_WWIDTH(1 + (clkrate / host->ncfg->wwidth)) | in lpc32xx_nand_setup()
244 SLCTAC_WHOLD(1 + (clkrate / host->ncfg->whold)) | in lpc32xx_nand_setup()
245 SLCTAC_WSETUP(1 + (clkrate / host->ncfg->wsetup)) | in lpc32xx_nand_setup()
246 SLCTAC_RDR(host->ncfg->rdr_clks) | in lpc32xx_nand_setup()
247 SLCTAC_RWIDTH(1 + (clkrate / host->ncfg->rwidth)) | in lpc32xx_nand_setup()
248 SLCTAC_RHOLD(1 + (clkrate / host->ncfg->rhold)) | in lpc32xx_nand_setup()
249 SLCTAC_RSETUP(1 + (clkrate / host->ncfg->rsetup)); in lpc32xx_nand_setup()
299 if (gpio_is_valid(host->ncfg->wp_gpio)) in lpc32xx_wp_enable()
300 gpio_set_value(host->ncfg->wp_gpio, 0); in lpc32xx_wp_enable()
308 if (gpio_is_valid(host->ncfg->wp_gpio)) in lpc32xx_wp_disable()
309 gpio_set_value(host->ncfg->wp_gpio, 1); in lpc32xx_wp_disable()
724 struct lpc32xx_nand_cfg_slc *ncfg; in lpc32xx_parse_dt() local
727 ncfg = devm_kzalloc(dev, sizeof(*ncfg), GFP_KERNEL); in lpc32xx_parse_dt()
728 if (!ncfg) in lpc32xx_parse_dt()
731 of_property_read_u32(np, "nxp,wdr-clks", &ncfg->wdr_clks); in lpc32xx_parse_dt()
732 of_property_read_u32(np, "nxp,wwidth", &ncfg->wwidth); in lpc32xx_parse_dt()
733 of_property_read_u32(np, "nxp,whold", &ncfg->whold); in lpc32xx_parse_dt()
734 of_property_read_u32(np, "nxp,wsetup", &ncfg->wsetup); in lpc32xx_parse_dt()
735 of_property_read_u32(np, "nxp,rdr-clks", &ncfg->rdr_clks); in lpc32xx_parse_dt()
736 of_property_read_u32(np, "nxp,rwidth", &ncfg->rwidth); in lpc32xx_parse_dt()
737 of_property_read_u32(np, "nxp,rhold", &ncfg->rhold); in lpc32xx_parse_dt()
738 of_property_read_u32(np, "nxp,rsetup", &ncfg->rsetup); in lpc32xx_parse_dt()
740 if (!ncfg->wdr_clks || !ncfg->wwidth || !ncfg->whold || in lpc32xx_parse_dt()
741 !ncfg->wsetup || !ncfg->rdr_clks || !ncfg->rwidth || in lpc32xx_parse_dt()
742 !ncfg->rhold || !ncfg->rsetup) { in lpc32xx_parse_dt()
747 ncfg->use_bbt = of_get_nand_on_flash_bbt(np); in lpc32xx_parse_dt()
748 ncfg->wp_gpio = of_get_named_gpio(np, "gpios", 0); in lpc32xx_parse_dt()
750 return ncfg; in lpc32xx_parse_dt()
782 host->ncfg = lpc32xx_parse_dt(&pdev->dev); in lpc32xx_nand_probe()
783 if (!host->ncfg) { in lpc32xx_nand_probe()
788 if (host->ncfg->wp_gpio == -EPROBE_DEFER) in lpc32xx_nand_probe()
790 if (gpio_is_valid(host->ncfg->wp_gpio) && devm_gpio_request(&pdev->dev, in lpc32xx_nand_probe()
791 host->ncfg->wp_gpio, "NAND WP")) { in lpc32xx_nand_probe()
884 if (host->ncfg->use_bbt) { in lpc32xx_nand_probe()
908 res = mtd_device_parse_register(mtd, NULL, &ppdata, host->ncfg->parts, in lpc32xx_nand_probe()
909 host->ncfg->num_parts); in lpc32xx_nand_probe()