Lines Matching refs:ebi
34 struct atmel_ebi *ebi; member
86 atmel_smc_cs_conf_get(ebid->ebi->smc.regmap, conf->cs, in at91sam9_ebi_get_config()
93 atmel_hsmc_cs_conf_get(ebid->ebi->smc.regmap, ebid->ebi->smc.layout, in sama5_ebi_get_config()
118 unsigned int clk_rate = clk_get_rate(ebid->ebi->clk); in atmel_ebi_xslate_smc_timings()
166 dev_err(ebid->ebi->dev, in atmel_ebi_xslate_smc_timings()
278 dev_err(ebid->ebi->dev, "missing atmel,smc- properties in %pOF", in atmel_ebi_xslate_smc_config()
289 atmel_smc_cs_conf_apply(ebid->ebi->smc.regmap, conf->cs, in at91sam9_ebi_apply_config()
296 atmel_hsmc_cs_conf_apply(ebid->ebi->smc.regmap, ebid->ebi->smc.layout, in sama5_ebi_apply_config()
300 static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np, in atmel_ebi_dev_setup() argument
303 const struct atmel_ebi_caps *caps = ebi->caps; in atmel_ebi_dev_setup()
305 struct device *dev = ebi->dev; in atmel_ebi_dev_setup()
321 !(ebi->caps->available_cs & BIT(cs))) { in atmel_ebi_dev_setup()
335 ebid = devm_kzalloc(ebi->dev, struct_size(ebid, configs, numcs), in atmel_ebi_dev_setup()
340 ebid->ebi = ebi; in atmel_ebi_dev_setup()
364 if (ebi->caps->ebi_csa_offs && apply) in atmel_ebi_dev_setup()
365 regmap_update_bits(ebi->regmap, in atmel_ebi_dev_setup()
366 ebi->caps->ebi_csa_offs, in atmel_ebi_dev_setup()
372 list_add_tail(&ebid->node, &ebi->devs); in atmel_ebi_dev_setup()
496 static int atmel_ebi_dev_disable(struct atmel_ebi *ebi, struct device_node *np) in atmel_ebi_dev_disable() argument
498 struct device *dev = ebi->dev; in atmel_ebi_dev_disable()
522 struct atmel_ebi *ebi; in atmel_ebi_probe() local
527 ebi = devm_kzalloc(dev, sizeof(*ebi), GFP_KERNEL); in atmel_ebi_probe()
528 if (!ebi) in atmel_ebi_probe()
531 platform_set_drvdata(pdev, ebi); in atmel_ebi_probe()
533 INIT_LIST_HEAD(&ebi->devs); in atmel_ebi_probe()
534 ebi->caps = device_get_match_data(dev); in atmel_ebi_probe()
535 if (!ebi->caps) in atmel_ebi_probe()
537 ebi->dev = dev; in atmel_ebi_probe()
543 ebi->clk = clk; in atmel_ebi_probe()
548 ebi->smc.regmap = syscon_node_to_regmap(smc_np); in atmel_ebi_probe()
549 if (IS_ERR(ebi->smc.regmap)) in atmel_ebi_probe()
550 return PTR_ERR(ebi->smc.regmap); in atmel_ebi_probe()
552 ebi->smc.layout = atmel_hsmc_get_reg_layout(smc_np); in atmel_ebi_probe()
553 if (IS_ERR(ebi->smc.layout)) in atmel_ebi_probe()
554 return PTR_ERR(ebi->smc.layout); in atmel_ebi_probe()
556 ebi->smc.clk = of_clk_get(smc_np, 0); in atmel_ebi_probe()
557 if (IS_ERR(ebi->smc.clk)) { in atmel_ebi_probe()
558 if (PTR_ERR(ebi->smc.clk) != -ENOENT) in atmel_ebi_probe()
559 return PTR_ERR(ebi->smc.clk); in atmel_ebi_probe()
561 ebi->smc.clk = NULL; in atmel_ebi_probe()
563 ret = clk_prepare_enable(ebi->smc.clk); in atmel_ebi_probe()
571 if (ebi->caps->ebi_csa_offs) { in atmel_ebi_probe()
572 ebi->regmap = in atmel_ebi_probe()
574 ebi->caps->regmap_name); in atmel_ebi_probe()
575 if (IS_ERR(ebi->regmap)) in atmel_ebi_probe()
576 return PTR_ERR(ebi->regmap); in atmel_ebi_probe()
599 ret = atmel_ebi_dev_setup(ebi, child, reg_cells); in atmel_ebi_probe()
604 ret = atmel_ebi_dev_disable(ebi, child); in atmel_ebi_probe()
615 struct atmel_ebi *ebi = dev_get_drvdata(dev); in atmel_ebi_resume() local
618 list_for_each_entry(ebid, &ebi->devs, node) { in atmel_ebi_resume()
622 ebid->ebi->caps->apply_config(ebid, &ebid->configs[i]); in atmel_ebi_resume()