Lines Matching refs:ebi

185 	int (*nwait_used_by_ctrls)(struct stm32_fmc2_ebi *ebi);
186 void (*set_setup)(struct stm32_fmc2_ebi *ebi);
187 int (*save_setup)(struct stm32_fmc2_ebi *ebi);
188 int (*check_rif)(struct stm32_fmc2_ebi *ebi, u32 resource);
189 void (*put_sems)(struct stm32_fmc2_ebi *ebi);
190 void (*get_sems)(struct stm32_fmc2_ebi *ebi);
233 int (*check)(struct stm32_fmc2_ebi *ebi,
235 u32 (*calculate)(struct stm32_fmc2_ebi *ebi, int cs, u32 setup);
236 int (*set)(struct stm32_fmc2_ebi *ebi,
241 static int stm32_fmc2_ebi_check_mux(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_check_mux() argument
248 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_mux()
258 static int stm32_fmc2_ebi_check_waitcfg(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_check_waitcfg() argument
265 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_waitcfg()
275 static int stm32_fmc2_ebi_check_sync_trans(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_check_sync_trans() argument
282 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_sync_trans()
292 static int stm32_fmc2_ebi_mp25_check_cclk(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_mp25_check_cclk() argument
296 if (!ebi->access_granted) in stm32_fmc2_ebi_mp25_check_cclk()
299 return stm32_fmc2_ebi_check_sync_trans(ebi, prop, cs); in stm32_fmc2_ebi_mp25_check_cclk()
302 static int stm32_fmc2_ebi_mp25_check_clk_period(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_mp25_check_clk_period() argument
309 ret = regmap_read(ebi->regmap, FMC2_CFGR, &cfgr); in stm32_fmc2_ebi_mp25_check_clk_period()
313 if (cfgr & FMC2_CFGR_CCLKEN && !ebi->access_granted) in stm32_fmc2_ebi_mp25_check_clk_period()
316 return stm32_fmc2_ebi_check_sync_trans(ebi, prop, cs); in stm32_fmc2_ebi_mp25_check_clk_period()
319 static int stm32_fmc2_ebi_check_async_trans(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_check_async_trans() argument
326 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_async_trans()
336 static int stm32_fmc2_ebi_check_cpsize(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_check_cpsize() argument
343 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_cpsize()
353 static int stm32_fmc2_ebi_check_address_hold(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_check_address_hold() argument
360 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_address_hold()
365 ret = regmap_read(ebi->regmap, FMC2_BWTR(cs), &bxtr); in stm32_fmc2_ebi_check_address_hold()
367 ret = regmap_read(ebi->regmap, FMC2_BTR(cs), &bxtr); in stm32_fmc2_ebi_check_address_hold()
378 static int stm32_fmc2_ebi_check_clk_period(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_check_clk_period() argument
385 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_clk_period()
390 ret = regmap_read(ebi->regmap, FMC2_BCR1, &bcr1); in stm32_fmc2_ebi_check_clk_period()
403 static int stm32_fmc2_ebi_check_cclk(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_check_cclk() argument
410 return stm32_fmc2_ebi_check_sync_trans(ebi, prop, cs); in stm32_fmc2_ebi_check_cclk()
413 static u32 stm32_fmc2_ebi_ns_to_clock_cycles(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_ns_to_clock_cycles() argument
416 unsigned long hclk = clk_get_rate(ebi->clk); in stm32_fmc2_ebi_ns_to_clock_cycles()
422 static u32 stm32_fmc2_ebi_ns_to_clk_period(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_ns_to_clk_period() argument
425 u32 nb_clk_cycles = stm32_fmc2_ebi_ns_to_clock_cycles(ebi, cs, setup); in stm32_fmc2_ebi_ns_to_clk_period()
429 ret = regmap_read(ebi->regmap, FMC2_BCR1, &bcr); in stm32_fmc2_ebi_ns_to_clk_period()
434 ret = regmap_read(ebi->regmap, FMC2_BTR1, &btr); in stm32_fmc2_ebi_ns_to_clk_period()
436 ret = regmap_read(ebi->regmap, FMC2_BTR(cs), &btr); in stm32_fmc2_ebi_ns_to_clk_period()
445 static u32 stm32_fmc2_ebi_mp25_ns_to_clk_period(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_mp25_ns_to_clk_period() argument
448 u32 nb_clk_cycles = stm32_fmc2_ebi_ns_to_clock_cycles(ebi, cs, setup); in stm32_fmc2_ebi_mp25_ns_to_clk_period()
452 ret = regmap_read(ebi->regmap, FMC2_CFGR, &cfgr); in stm32_fmc2_ebi_mp25_ns_to_clk_period()
459 ret = regmap_read(ebi->regmap, FMC2_BTR(cs), &btr); in stm32_fmc2_ebi_mp25_ns_to_clk_period()
494 static int stm32_fmc2_ebi_set_bit_field(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_set_bit_field() argument
505 regmap_update_bits(ebi->regmap, reg, prop->reg_mask, in stm32_fmc2_ebi_set_bit_field()
511 static int stm32_fmc2_ebi_set_trans_type(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_set_trans_type() argument
636 regmap_update_bits(ebi->regmap, FMC2_BWTR(cs), in stm32_fmc2_ebi_set_trans_type()
638 regmap_update_bits(ebi->regmap, FMC2_BTR(cs), btr_mask, btr); in stm32_fmc2_ebi_set_trans_type()
639 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), bcr_mask, bcr); in stm32_fmc2_ebi_set_trans_type()
644 static int stm32_fmc2_ebi_set_buswidth(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_set_buswidth() argument
662 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_MWID, val); in stm32_fmc2_ebi_set_buswidth()
667 static int stm32_fmc2_ebi_set_cpsize(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_set_cpsize() argument
694 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_CPSIZE, val); in stm32_fmc2_ebi_set_cpsize()
699 static int stm32_fmc2_ebi_set_bl_setup(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_set_bl_setup() argument
707 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_NBLSET, val); in stm32_fmc2_ebi_set_bl_setup()
712 static int stm32_fmc2_ebi_set_address_setup(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_set_address_setup() argument
724 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_set_address_setup()
729 ret = regmap_read(ebi->regmap, FMC2_BWTR(cs), &bxtr); in stm32_fmc2_ebi_set_address_setup()
731 ret = regmap_read(ebi->regmap, FMC2_BTR(cs), &bxtr); in stm32_fmc2_ebi_set_address_setup()
740 regmap_update_bits(ebi->regmap, reg, FMC2_BXTR_ADDSET, val); in stm32_fmc2_ebi_set_address_setup()
745 static int stm32_fmc2_ebi_set_address_hold(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_set_address_hold() argument
758 regmap_update_bits(ebi->regmap, reg, FMC2_BXTR_ADDHLD, val); in stm32_fmc2_ebi_set_address_hold()
763 static int stm32_fmc2_ebi_set_data_setup(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_set_data_setup() argument
776 regmap_update_bits(ebi->regmap, reg, FMC2_BXTR_DATAST, val); in stm32_fmc2_ebi_set_data_setup()
781 static int stm32_fmc2_ebi_set_bus_turnaround(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_set_bus_turnaround() argument
794 regmap_update_bits(ebi->regmap, reg, FMC2_BXTR_BUSTURN, val); in stm32_fmc2_ebi_set_bus_turnaround()
799 static int stm32_fmc2_ebi_set_data_hold(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_set_data_hold() argument
815 regmap_update_bits(ebi->regmap, reg, FMC2_BXTR_DATAHLD, val); in stm32_fmc2_ebi_set_data_hold()
820 static int stm32_fmc2_ebi_set_clk_period(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_set_clk_period() argument
828 regmap_update_bits(ebi->regmap, FMC2_BTR(cs), FMC2_BTR_CLKDIV, val); in stm32_fmc2_ebi_set_clk_period()
833 static int stm32_fmc2_ebi_mp25_set_clk_period(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_mp25_set_clk_period() argument
840 ret = regmap_read(ebi->regmap, FMC2_CFGR, &cfgr); in stm32_fmc2_ebi_mp25_set_clk_period()
847 regmap_update_bits(ebi->regmap, FMC2_CFGR, FMC2_CFGR_CLKDIV, val); in stm32_fmc2_ebi_mp25_set_clk_period()
851 regmap_update_bits(ebi->regmap, FMC2_BTR(cs), FMC2_BTR_CLKDIV, val); in stm32_fmc2_ebi_mp25_set_clk_period()
857 static int stm32_fmc2_ebi_set_data_latency(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_set_data_latency() argument
865 regmap_update_bits(ebi->regmap, FMC2_BTR(cs), FMC2_BTR_DATLAT, val); in stm32_fmc2_ebi_set_data_latency()
870 static int stm32_fmc2_ebi_set_max_low_pulse(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_set_max_low_pulse() argument
880 ret = regmap_read(ebi->regmap, FMC2_PCSCNTR, &pcscntr); in stm32_fmc2_ebi_set_max_low_pulse()
885 regmap_update_bits(ebi->regmap, FMC2_PCSCNTR, in stm32_fmc2_ebi_set_max_low_pulse()
896 regmap_update_bits(ebi->regmap, FMC2_PCSCNTR, in stm32_fmc2_ebi_set_max_low_pulse()
902 static int stm32_fmc2_ebi_mp25_set_max_low_pulse(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_mp25_set_max_low_pulse() argument
917 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), in stm32_fmc2_ebi_mp25_set_max_low_pulse()
1253 static int stm32_fmc2_ebi_mp25_check_rif(struct stm32_fmc2_ebi *ebi, u32 resource) in stm32_fmc2_ebi_mp25_check_rif() argument
1261 ret = regmap_read(ebi->regmap, FMC2_SECCFGR, &seccfgr); in stm32_fmc2_ebi_mp25_check_rif()
1267 dev_err(ebi->dev, "resource %d is configured as secure\n", in stm32_fmc2_ebi_mp25_check_rif()
1273 ret = regmap_read(ebi->regmap, FMC2_CIDCFGR(resource), &cidcfgr); in stm32_fmc2_ebi_mp25_check_rif()
1286 dev_err(ebi->dev, "static CID%d set for resource %d\n", in stm32_fmc2_ebi_mp25_check_rif()
1298 dev_err(ebi->dev, "CID1 is block-listed for resource %d\n", in stm32_fmc2_ebi_mp25_check_rif()
1304 ret = regmap_read(ebi->regmap, FMC2_SEMCR(resource), &semcr); in stm32_fmc2_ebi_mp25_check_rif()
1309 regmap_update_bits(ebi->regmap, FMC2_SEMCR(resource), in stm32_fmc2_ebi_mp25_check_rif()
1312 ret = regmap_read(ebi->regmap, FMC2_SEMCR(resource), &semcr); in stm32_fmc2_ebi_mp25_check_rif()
1320 dev_err(ebi->dev, "resource %d is already used by CID%d\n", in stm32_fmc2_ebi_mp25_check_rif()
1326 ebi->sem_taken |= BIT(resource); in stm32_fmc2_ebi_mp25_check_rif()
1331 static void stm32_fmc2_ebi_mp25_put_sems(struct stm32_fmc2_ebi *ebi) in stm32_fmc2_ebi_mp25_put_sems() argument
1336 if (!(ebi->sem_taken & BIT(resource))) in stm32_fmc2_ebi_mp25_put_sems()
1339 regmap_update_bits(ebi->regmap, FMC2_SEMCR(resource), in stm32_fmc2_ebi_mp25_put_sems()
1344 static void stm32_fmc2_ebi_mp25_get_sems(struct stm32_fmc2_ebi *ebi) in stm32_fmc2_ebi_mp25_get_sems() argument
1349 if (!(ebi->sem_taken & BIT(resource))) in stm32_fmc2_ebi_mp25_get_sems()
1352 regmap_update_bits(ebi->regmap, FMC2_SEMCR(resource), in stm32_fmc2_ebi_mp25_get_sems()
1357 static int stm32_fmc2_ebi_parse_prop(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_parse_prop() argument
1362 struct device *dev = ebi->dev; in stm32_fmc2_ebi_parse_prop()
1370 if (prop->check && prop->check(ebi, prop, cs)) in stm32_fmc2_ebi_parse_prop()
1400 setup = prop->calculate(ebi, cs, val); in stm32_fmc2_ebi_parse_prop()
1405 return prop->set(ebi, prop, cs, setup); in stm32_fmc2_ebi_parse_prop()
1408 static void stm32_fmc2_ebi_enable_bank(struct stm32_fmc2_ebi *ebi, int cs) in stm32_fmc2_ebi_enable_bank() argument
1410 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), in stm32_fmc2_ebi_enable_bank()
1414 static void stm32_fmc2_ebi_disable_bank(struct stm32_fmc2_ebi *ebi, int cs) in stm32_fmc2_ebi_disable_bank() argument
1416 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_MBKEN, 0); in stm32_fmc2_ebi_disable_bank()
1419 static int stm32_fmc2_ebi_save_setup(struct stm32_fmc2_ebi *ebi) in stm32_fmc2_ebi_save_setup() argument
1425 if (!(ebi->bank_assigned & BIT(cs))) in stm32_fmc2_ebi_save_setup()
1428 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &ebi->bcr[cs]); in stm32_fmc2_ebi_save_setup()
1429 ret |= regmap_read(ebi->regmap, FMC2_BTR(cs), &ebi->btr[cs]); in stm32_fmc2_ebi_save_setup()
1430 ret |= regmap_read(ebi->regmap, FMC2_BWTR(cs), &ebi->bwtr[cs]); in stm32_fmc2_ebi_save_setup()
1438 static int stm32_fmc2_ebi_mp1_save_setup(struct stm32_fmc2_ebi *ebi) in stm32_fmc2_ebi_mp1_save_setup() argument
1442 ret = stm32_fmc2_ebi_save_setup(ebi); in stm32_fmc2_ebi_mp1_save_setup()
1446 return regmap_read(ebi->regmap, FMC2_PCSCNTR, &ebi->pcscntr); in stm32_fmc2_ebi_mp1_save_setup()
1449 static int stm32_fmc2_ebi_mp25_save_setup(struct stm32_fmc2_ebi *ebi) in stm32_fmc2_ebi_mp25_save_setup() argument
1453 ret = stm32_fmc2_ebi_save_setup(ebi); in stm32_fmc2_ebi_mp25_save_setup()
1457 if (ebi->access_granted) in stm32_fmc2_ebi_mp25_save_setup()
1458 ret = regmap_read(ebi->regmap, FMC2_CFGR, &ebi->cfgr); in stm32_fmc2_ebi_mp25_save_setup()
1463 static void stm32_fmc2_ebi_set_setup(struct stm32_fmc2_ebi *ebi) in stm32_fmc2_ebi_set_setup() argument
1468 if (!(ebi->bank_assigned & BIT(cs))) in stm32_fmc2_ebi_set_setup()
1471 regmap_write(ebi->regmap, FMC2_BCR(cs), ebi->bcr[cs]); in stm32_fmc2_ebi_set_setup()
1472 regmap_write(ebi->regmap, FMC2_BTR(cs), ebi->btr[cs]); in stm32_fmc2_ebi_set_setup()
1473 regmap_write(ebi->regmap, FMC2_BWTR(cs), ebi->bwtr[cs]); in stm32_fmc2_ebi_set_setup()
1477 static void stm32_fmc2_ebi_mp1_set_setup(struct stm32_fmc2_ebi *ebi) in stm32_fmc2_ebi_mp1_set_setup() argument
1479 stm32_fmc2_ebi_set_setup(ebi); in stm32_fmc2_ebi_mp1_set_setup()
1480 regmap_write(ebi->regmap, FMC2_PCSCNTR, ebi->pcscntr); in stm32_fmc2_ebi_mp1_set_setup()
1483 static void stm32_fmc2_ebi_mp25_set_setup(struct stm32_fmc2_ebi *ebi) in stm32_fmc2_ebi_mp25_set_setup() argument
1485 stm32_fmc2_ebi_set_setup(ebi); in stm32_fmc2_ebi_mp25_set_setup()
1487 if (ebi->access_granted) in stm32_fmc2_ebi_mp25_set_setup()
1488 regmap_write(ebi->regmap, FMC2_CFGR, ebi->cfgr); in stm32_fmc2_ebi_mp25_set_setup()
1491 static void stm32_fmc2_ebi_disable_banks(struct stm32_fmc2_ebi *ebi) in stm32_fmc2_ebi_disable_banks() argument
1496 if (!(ebi->bank_assigned & BIT(cs))) in stm32_fmc2_ebi_disable_banks()
1499 stm32_fmc2_ebi_disable_bank(ebi, cs); in stm32_fmc2_ebi_disable_banks()
1504 static int stm32_fmc2_ebi_nwait_used_by_ctrls(struct stm32_fmc2_ebi *ebi) in stm32_fmc2_ebi_nwait_used_by_ctrls() argument
1506 struct device *dev = ebi->dev; in stm32_fmc2_ebi_nwait_used_by_ctrls()
1512 if (!(ebi->bank_assigned & BIT(cs))) in stm32_fmc2_ebi_nwait_used_by_ctrls()
1515 ret = regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_nwait_used_by_ctrls()
1520 ebi->bank_assigned & BIT(FMC2_NAND)) { in stm32_fmc2_ebi_nwait_used_by_ctrls()
1529 static void stm32_fmc2_ebi_enable(struct stm32_fmc2_ebi *ebi) in stm32_fmc2_ebi_enable() argument
1531 if (!ebi->access_granted) in stm32_fmc2_ebi_enable()
1534 regmap_update_bits(ebi->regmap, ebi->data->fmc2_enable_reg, in stm32_fmc2_ebi_enable()
1535 ebi->data->fmc2_enable_bit, in stm32_fmc2_ebi_enable()
1536 ebi->data->fmc2_enable_bit); in stm32_fmc2_ebi_enable()
1539 static void stm32_fmc2_ebi_disable(struct stm32_fmc2_ebi *ebi) in stm32_fmc2_ebi_disable() argument
1541 if (!ebi->access_granted) in stm32_fmc2_ebi_disable()
1544 regmap_update_bits(ebi->regmap, ebi->data->fmc2_enable_reg, in stm32_fmc2_ebi_disable()
1545 ebi->data->fmc2_enable_bit, 0); in stm32_fmc2_ebi_disable()
1548 static int stm32_fmc2_ebi_setup_cs(struct stm32_fmc2_ebi *ebi, in stm32_fmc2_ebi_setup_cs() argument
1555 stm32_fmc2_ebi_disable_bank(ebi, cs); in stm32_fmc2_ebi_setup_cs()
1557 for (i = 0; i < ebi->data->nb_child_props; i++) { in stm32_fmc2_ebi_setup_cs()
1558 const struct stm32_fmc2_prop *p = &ebi->data->child_props[i]; in stm32_fmc2_ebi_setup_cs()
1560 ret = stm32_fmc2_ebi_parse_prop(ebi, dev_node, p, cs); in stm32_fmc2_ebi_setup_cs()
1562 dev_err(ebi->dev, "property %s could not be set: %d\n", in stm32_fmc2_ebi_setup_cs()
1568 stm32_fmc2_ebi_enable_bank(ebi, cs); in stm32_fmc2_ebi_setup_cs()
1573 static int stm32_fmc2_ebi_parse_dt(struct stm32_fmc2_ebi *ebi) in stm32_fmc2_ebi_parse_dt() argument
1575 struct device *dev = ebi->dev; in stm32_fmc2_ebi_parse_dt()
1590 if (ebi->bank_assigned & BIT(bank)) { in stm32_fmc2_ebi_parse_dt()
1595 if (ebi->data->check_rif) { in stm32_fmc2_ebi_parse_dt()
1596 ret = ebi->data->check_rif(ebi, bank + 1); in stm32_fmc2_ebi_parse_dt()
1604 ret = stm32_fmc2_ebi_setup_cs(ebi, child, bank); in stm32_fmc2_ebi_parse_dt()
1610 ebi->bank_assigned |= BIT(bank); in stm32_fmc2_ebi_parse_dt()
1619 if (ebi->data->nwait_used_by_ctrls) { in stm32_fmc2_ebi_parse_dt()
1620 ret = ebi->data->nwait_used_by_ctrls(ebi); in stm32_fmc2_ebi_parse_dt()
1625 stm32_fmc2_ebi_enable(ebi); in stm32_fmc2_ebi_parse_dt()
1633 struct stm32_fmc2_ebi *ebi; in stm32_fmc2_ebi_probe() local
1637 ebi = devm_kzalloc(&pdev->dev, sizeof(*ebi), GFP_KERNEL); in stm32_fmc2_ebi_probe()
1638 if (!ebi) in stm32_fmc2_ebi_probe()
1641 ebi->dev = dev; in stm32_fmc2_ebi_probe()
1642 platform_set_drvdata(pdev, ebi); in stm32_fmc2_ebi_probe()
1644 ebi->data = of_device_get_match_data(dev); in stm32_fmc2_ebi_probe()
1645 if (!ebi->data) in stm32_fmc2_ebi_probe()
1648 ebi->regmap = device_node_to_regmap(dev->of_node); in stm32_fmc2_ebi_probe()
1649 if (IS_ERR(ebi->regmap)) in stm32_fmc2_ebi_probe()
1650 return PTR_ERR(ebi->regmap); in stm32_fmc2_ebi_probe()
1652 ebi->clk = devm_clk_get(dev, NULL); in stm32_fmc2_ebi_probe()
1653 if (IS_ERR(ebi->clk)) in stm32_fmc2_ebi_probe()
1654 return PTR_ERR(ebi->clk); in stm32_fmc2_ebi_probe()
1674 ebi->access_granted = true; in stm32_fmc2_ebi_probe()
1675 if (ebi->data->check_rif) { in stm32_fmc2_ebi_probe()
1676 ret = ebi->data->check_rif(ebi, 0); in stm32_fmc2_ebi_probe()
1680 ebi->access_granted = false; in stm32_fmc2_ebi_probe()
1682 ret = regmap_read(ebi->regmap, FMC2_SR, &sr); in stm32_fmc2_ebi_probe()
1695 ret = stm32_fmc2_ebi_parse_dt(ebi); in stm32_fmc2_ebi_probe()
1699 ret = ebi->data->save_setup(ebi); in stm32_fmc2_ebi_probe()
1706 stm32_fmc2_ebi_disable_banks(ebi); in stm32_fmc2_ebi_probe()
1707 stm32_fmc2_ebi_disable(ebi); in stm32_fmc2_ebi_probe()
1708 if (ebi->data->put_sems) in stm32_fmc2_ebi_probe()
1709 ebi->data->put_sems(ebi); in stm32_fmc2_ebi_probe()
1717 struct stm32_fmc2_ebi *ebi = platform_get_drvdata(pdev); in stm32_fmc2_ebi_remove() local
1720 stm32_fmc2_ebi_disable_banks(ebi); in stm32_fmc2_ebi_remove()
1721 stm32_fmc2_ebi_disable(ebi); in stm32_fmc2_ebi_remove()
1722 if (ebi->data->put_sems) in stm32_fmc2_ebi_remove()
1723 ebi->data->put_sems(ebi); in stm32_fmc2_ebi_remove()
1729 struct stm32_fmc2_ebi *ebi = dev_get_drvdata(dev); in stm32_fmc2_ebi_runtime_suspend() local
1731 clk_disable_unprepare(ebi->clk); in stm32_fmc2_ebi_runtime_suspend()
1738 struct stm32_fmc2_ebi *ebi = dev_get_drvdata(dev); in stm32_fmc2_ebi_runtime_resume() local
1740 return clk_prepare_enable(ebi->clk); in stm32_fmc2_ebi_runtime_resume()
1745 struct stm32_fmc2_ebi *ebi = dev_get_drvdata(dev); in stm32_fmc2_ebi_suspend() local
1747 stm32_fmc2_ebi_disable(ebi); in stm32_fmc2_ebi_suspend()
1748 if (ebi->data->put_sems) in stm32_fmc2_ebi_suspend()
1749 ebi->data->put_sems(ebi); in stm32_fmc2_ebi_suspend()
1758 struct stm32_fmc2_ebi *ebi = dev_get_drvdata(dev); in stm32_fmc2_ebi_resume() local
1767 if (ebi->data->get_sems) in stm32_fmc2_ebi_resume()
1768 ebi->data->get_sems(ebi); in stm32_fmc2_ebi_resume()
1769 ebi->data->set_setup(ebi); in stm32_fmc2_ebi_resume()
1770 stm32_fmc2_ebi_enable(ebi); in stm32_fmc2_ebi_resume()