Lines Matching refs:cs

172 		     const struct stm32_fmc2_prop *prop, int cs);
173 u32 (*calculate)(struct stm32_fmc2_ebi *ebi, int cs, u32 setup);
176 int cs, u32 setup);
181 int cs) in stm32_fmc2_ebi_check_mux() argument
185 regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_mux()
195 int cs) in stm32_fmc2_ebi_check_waitcfg() argument
199 regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_waitcfg()
209 int cs) in stm32_fmc2_ebi_check_sync_trans() argument
213 regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_sync_trans()
223 int cs) in stm32_fmc2_ebi_check_async_trans() argument
227 regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_async_trans()
237 int cs) in stm32_fmc2_ebi_check_cpsize() argument
241 regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_cpsize()
251 int cs) in stm32_fmc2_ebi_check_address_hold() argument
255 regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_address_hold()
257 regmap_read(ebi->regmap, FMC2_BWTR(cs), &bxtr); in stm32_fmc2_ebi_check_address_hold()
259 regmap_read(ebi->regmap, FMC2_BTR(cs), &bxtr); in stm32_fmc2_ebi_check_address_hold()
270 int cs) in stm32_fmc2_ebi_check_clk_period() argument
274 regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_check_clk_period()
275 if (cs) in stm32_fmc2_ebi_check_clk_period()
280 if (bcr & FMC2_BCR_BURSTEN && (!cs || !(bcr1 & FMC2_BCR1_CCLKEN))) in stm32_fmc2_ebi_check_clk_period()
288 int cs) in stm32_fmc2_ebi_check_cclk() argument
290 if (cs) in stm32_fmc2_ebi_check_cclk()
293 return stm32_fmc2_ebi_check_sync_trans(ebi, prop, cs); in stm32_fmc2_ebi_check_cclk()
297 int cs, u32 setup) in stm32_fmc2_ebi_ns_to_clock_cycles() argument
306 int cs, u32 setup) in stm32_fmc2_ebi_ns_to_clk_period() argument
308 u32 nb_clk_cycles = stm32_fmc2_ebi_ns_to_clock_cycles(ebi, cs, setup); in stm32_fmc2_ebi_ns_to_clk_period()
312 if (bcr & FMC2_BCR1_CCLKEN || !cs) in stm32_fmc2_ebi_ns_to_clk_period()
315 regmap_read(ebi->regmap, FMC2_BTR(cs), &btr); in stm32_fmc2_ebi_ns_to_clk_period()
322 static int stm32_fmc2_ebi_get_reg(int reg_type, int cs, u32 *reg) in stm32_fmc2_ebi_get_reg() argument
326 *reg = FMC2_BCR(cs); in stm32_fmc2_ebi_get_reg()
329 *reg = FMC2_BTR(cs); in stm32_fmc2_ebi_get_reg()
332 *reg = FMC2_BWTR(cs); in stm32_fmc2_ebi_get_reg()
346 int cs, u32 setup) in stm32_fmc2_ebi_set_bit_field() argument
351 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, &reg); in stm32_fmc2_ebi_set_bit_field()
363 int cs, u32 setup) in stm32_fmc2_ebi_set_trans_type() argument
486 regmap_update_bits(ebi->regmap, FMC2_BWTR(cs), in stm32_fmc2_ebi_set_trans_type()
488 regmap_update_bits(ebi->regmap, FMC2_BTR(cs), btr_mask, btr); in stm32_fmc2_ebi_set_trans_type()
489 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), bcr_mask, bcr); in stm32_fmc2_ebi_set_trans_type()
496 int cs, u32 setup) in stm32_fmc2_ebi_set_buswidth() argument
512 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_MWID, val); in stm32_fmc2_ebi_set_buswidth()
519 int cs, u32 setup) in stm32_fmc2_ebi_set_cpsize() argument
544 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_CPSIZE, val); in stm32_fmc2_ebi_set_cpsize()
551 int cs, u32 setup) in stm32_fmc2_ebi_set_bl_setup() argument
557 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_NBLSET, val); in stm32_fmc2_ebi_set_bl_setup()
564 int cs, u32 setup) in stm32_fmc2_ebi_set_address_setup() argument
570 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, &reg); in stm32_fmc2_ebi_set_address_setup()
574 regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_set_address_setup()
576 regmap_read(ebi->regmap, FMC2_BWTR(cs), &bxtr); in stm32_fmc2_ebi_set_address_setup()
578 regmap_read(ebi->regmap, FMC2_BTR(cs), &bxtr); in stm32_fmc2_ebi_set_address_setup()
592 int cs, u32 setup) in stm32_fmc2_ebi_set_address_hold() argument
597 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, &reg); in stm32_fmc2_ebi_set_address_hold()
610 int cs, u32 setup) in stm32_fmc2_ebi_set_data_setup() argument
615 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, &reg); in stm32_fmc2_ebi_set_data_setup()
628 int cs, u32 setup) in stm32_fmc2_ebi_set_bus_turnaround() argument
633 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, &reg); in stm32_fmc2_ebi_set_bus_turnaround()
646 int cs, u32 setup) in stm32_fmc2_ebi_set_data_hold() argument
651 ret = stm32_fmc2_ebi_get_reg(prop->reg_type, cs, &reg); in stm32_fmc2_ebi_set_data_hold()
667 int cs, u32 setup) in stm32_fmc2_ebi_set_clk_period() argument
673 regmap_update_bits(ebi->regmap, FMC2_BTR(cs), FMC2_BTR_CLKDIV, val); in stm32_fmc2_ebi_set_clk_period()
680 int cs, u32 setup) in stm32_fmc2_ebi_set_data_latency() argument
686 regmap_update_bits(ebi->regmap, FMC2_BTR(cs), FMC2_BTR_DATLAT, val); in stm32_fmc2_ebi_set_data_latency()
693 int cs, u32 setup) in stm32_fmc2_ebi_set_max_low_pulse() argument
704 FMC2_PCSCNTR_CNTBEN(cs), in stm32_fmc2_ebi_set_max_low_pulse()
705 FMC2_PCSCNTR_CNTBEN(cs)); in stm32_fmc2_ebi_set_max_low_pulse()
888 int cs) in stm32_fmc2_ebi_parse_prop() argument
898 if (prop->check && prop->check(ebi, prop, cs)) in stm32_fmc2_ebi_parse_prop()
928 setup = prop->calculate(ebi, cs, val); in stm32_fmc2_ebi_parse_prop()
933 return prop->set(ebi, prop, cs, setup); in stm32_fmc2_ebi_parse_prop()
936 static void stm32_fmc2_ebi_enable_bank(struct stm32_fmc2_ebi *ebi, int cs) in stm32_fmc2_ebi_enable_bank() argument
938 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), in stm32_fmc2_ebi_enable_bank()
942 static void stm32_fmc2_ebi_disable_bank(struct stm32_fmc2_ebi *ebi, int cs) in stm32_fmc2_ebi_disable_bank() argument
944 regmap_update_bits(ebi->regmap, FMC2_BCR(cs), FMC2_BCR_MBKEN, 0); in stm32_fmc2_ebi_disable_bank()
949 unsigned int cs; in stm32_fmc2_ebi_save_setup() local
951 for (cs = 0; cs < FMC2_MAX_EBI_CE; cs++) { in stm32_fmc2_ebi_save_setup()
952 regmap_read(ebi->regmap, FMC2_BCR(cs), &ebi->bcr[cs]); in stm32_fmc2_ebi_save_setup()
953 regmap_read(ebi->regmap, FMC2_BTR(cs), &ebi->btr[cs]); in stm32_fmc2_ebi_save_setup()
954 regmap_read(ebi->regmap, FMC2_BWTR(cs), &ebi->bwtr[cs]); in stm32_fmc2_ebi_save_setup()
962 unsigned int cs; in stm32_fmc2_ebi_set_setup() local
964 for (cs = 0; cs < FMC2_MAX_EBI_CE; cs++) { in stm32_fmc2_ebi_set_setup()
965 regmap_write(ebi->regmap, FMC2_BCR(cs), ebi->bcr[cs]); in stm32_fmc2_ebi_set_setup()
966 regmap_write(ebi->regmap, FMC2_BTR(cs), ebi->btr[cs]); in stm32_fmc2_ebi_set_setup()
967 regmap_write(ebi->regmap, FMC2_BWTR(cs), ebi->bwtr[cs]); in stm32_fmc2_ebi_set_setup()
975 unsigned int cs; in stm32_fmc2_ebi_disable_banks() local
977 for (cs = 0; cs < FMC2_MAX_EBI_CE; cs++) { in stm32_fmc2_ebi_disable_banks()
978 if (!(ebi->bank_assigned & BIT(cs))) in stm32_fmc2_ebi_disable_banks()
981 stm32_fmc2_ebi_disable_bank(ebi, cs); in stm32_fmc2_ebi_disable_banks()
988 unsigned int cs; in stm32_fmc2_ebi_nwait_used_by_ctrls() local
991 for (cs = 0; cs < FMC2_MAX_EBI_CE; cs++) { in stm32_fmc2_ebi_nwait_used_by_ctrls()
992 if (!(ebi->bank_assigned & BIT(cs))) in stm32_fmc2_ebi_nwait_used_by_ctrls()
995 regmap_read(ebi->regmap, FMC2_BCR(cs), &bcr); in stm32_fmc2_ebi_nwait_used_by_ctrls()
1017 u32 cs) in stm32_fmc2_ebi_setup_cs() argument
1022 stm32_fmc2_ebi_disable_bank(ebi, cs); in stm32_fmc2_ebi_setup_cs()
1027 ret = stm32_fmc2_ebi_parse_prop(ebi, dev_node, p, cs); in stm32_fmc2_ebi_setup_cs()
1035 stm32_fmc2_ebi_enable_bank(ebi, cs); in stm32_fmc2_ebi_setup_cs()