Lines Matching refs:pc
204 #define pc_to_bank(pc) \ argument
205 container_of(pc, struct st_gpio_bank, pc)
316 struct st_pio_control pc; member
369 return &bank->pc; in st_get_pio_control()
383 static void st_pinconf_set_config(struct st_pio_control *pc, in st_pinconf_set_config() argument
386 struct regmap_field *output_enable = pc->oe; in st_pinconf_set_config()
387 struct regmap_field *pull_up = pc->pu; in st_pinconf_set_config()
388 struct regmap_field *open_drain = pc->od; in st_pinconf_set_config()
417 static void st_pctl_set_function(struct st_pio_control *pc, in st_pctl_set_function() argument
420 struct regmap_field *alt = pc->alt; in st_pctl_set_function()
434 static unsigned int st_pctl_get_pin_function(struct st_pio_control *pc, int pin) in st_pctl_get_pin_function() argument
436 struct regmap_field *alt = pc->alt; in st_pctl_get_pin_function()
517 struct st_pio_control *pc, unsigned long config, int pin) in st_pinconf_set_retime_packed() argument
520 struct st_retime_packed *rt_p = &pc->rt.rt_p; in st_pinconf_set_retime_packed()
547 struct st_pio_control *pc, unsigned long config, int pin) in st_pinconf_set_retime_dedicated() argument
559 struct st_retime_dedicated *rt_d = &pc->rt.rt_d; in st_pinconf_set_retime_dedicated()
573 static void st_pinconf_get_direction(struct st_pio_control *pc, in st_pinconf_get_direction() argument
578 if (pc->oe) { in st_pinconf_get_direction()
579 regmap_field_read(pc->oe, &oe_value); in st_pinconf_get_direction()
584 if (pc->pu) { in st_pinconf_get_direction()
585 regmap_field_read(pc->pu, &pu_value); in st_pinconf_get_direction()
590 if (pc->od) { in st_pinconf_get_direction()
591 regmap_field_read(pc->od, &od_value); in st_pinconf_get_direction()
598 struct st_pio_control *pc, int pin, unsigned long *config) in st_pinconf_get_retime_packed() argument
601 struct st_retime_packed *rt_p = &pc->rt.rt_p; in st_pinconf_get_retime_packed()
631 struct st_pio_control *pc, int pin, unsigned long *config) in st_pinconf_get_retime_dedicated() argument
636 struct st_retime_dedicated *rt_d = &pc->rt.rt_d; in st_pinconf_get_retime_dedicated()
737 struct st_pio_control pc = bank->pc; in st_gpio_get_direction() local
745 function = st_pctl_get_pin_function(&pc, offset); in st_gpio_get_direction()
747 st_pinconf_get_direction(&pc, offset, &config); in st_gpio_get_direction()
906 struct st_pio_control *pc; in st_pmx_set_mux() local
910 pc = st_get_pio_control(pctldev, conf[i].pin); in st_pmx_set_mux()
911 st_pctl_set_function(pc, conf[i].pin, conf[i].altfunc); in st_pmx_set_mux()
927 st_pctl_set_function(&bank->pc, gpio, 0); in st_pmx_set_gpio_direction()
945 struct st_pio_control *pc, int pin, unsigned long *config) in st_pinconf_get_retime() argument
948 st_pinconf_get_retime_packed(info, pc, pin, config); in st_pinconf_get_retime()
950 if ((BIT(pin) & pc->rt_pin_mask)) in st_pinconf_get_retime()
951 st_pinconf_get_retime_dedicated(info, pc, in st_pinconf_get_retime()
956 struct st_pio_control *pc, int pin, unsigned long config) in st_pinconf_set_retime() argument
959 st_pinconf_set_retime_packed(info, pc, config, pin); in st_pinconf_set_retime()
961 if ((BIT(pin) & pc->rt_pin_mask)) in st_pinconf_set_retime()
962 st_pinconf_set_retime_dedicated(info, pc, in st_pinconf_set_retime()
971 struct st_pio_control *pc = st_get_pio_control(pctldev, pin_id); in st_pinconf_set() local
975 st_pinconf_set_config(pc, pin, configs[i]); in st_pinconf_set()
976 st_pinconf_set_retime(info, pc, pin, configs[i]); in st_pinconf_set()
987 struct st_pio_control *pc = st_get_pio_control(pctldev, pin_id); in st_pinconf_get() local
990 st_pinconf_get_direction(pc, pin, config); in st_pinconf_get()
991 st_pinconf_get_retime(info, pc, pin, config); in st_pinconf_get()
999 struct st_pio_control *pc; in st_pinconf_dbg_show() local
1007 pc = st_get_pio_control(pctldev, pin_id); in st_pinconf_dbg_show()
1011 function = st_pctl_get_pin_function(pc, offset); in st_pinconf_dbg_show()
1017 oe = st_gpio_get_direction(&pc_to_bank(pc)->gpio_chip, offset); in st_pinconf_dbg_show()
1054 int bank, struct st_pio_control *pc) in st_pctl_dt_setup_retime_packed() argument
1061 struct st_retime_packed *rt_p = &pc->rt.rt_p; in st_pctl_dt_setup_retime_packed()
1090 int bank, struct st_pio_control *pc) in st_pctl_dt_setup_retime_dedicated() argument
1097 struct st_retime_dedicated *rt_d = &pc->rt.rt_d; in st_pctl_dt_setup_retime_dedicated()
1099 u32 pin_mask = pc->rt_pin_mask; in st_pctl_dt_setup_retime_dedicated()
1114 int bank, struct st_pio_control *pc) in st_pctl_dt_setup_retime() argument
1118 return st_pctl_dt_setup_retime_packed(info, bank, pc); in st_pctl_dt_setup_retime()
1120 return st_pctl_dt_setup_retime_dedicated(info, bank, pc); in st_pctl_dt_setup_retime()
1149 struct st_pio_control *pc = &info->banks[bank].pc; in st_parse_syscfgs() local
1153 pc->alt = st_pc_get_value(dev, regmap, bank, data->alt, 0, 31); in st_parse_syscfgs()
1154 pc->oe = st_pc_get_value(dev, regmap, bank/4, data->oe, lsb, msb); in st_parse_syscfgs()
1155 pc->pu = st_pc_get_value(dev, regmap, bank/4, data->pu, lsb, msb); in st_parse_syscfgs()
1156 pc->od = st_pc_get_value(dev, regmap, bank/4, data->od, lsb, msb); in st_parse_syscfgs()
1159 pc->rt_pin_mask = 0xff; in st_parse_syscfgs()
1160 of_property_read_u32(np, "st,retime-pin-mask", &pc->rt_pin_mask); in st_parse_syscfgs()
1161 st_pctl_dt_setup_retime(info, bank, pc); in st_parse_syscfgs()