Lines Matching refs:devdata
53 if (pin >= pctl->devdata->type1_start && pin < pctl->devdata->type1_end) in mtk_get_regmap()
61 return ((pin >> pctl->devdata->mode_shf) & pctl->devdata->port_mask) in mtk_get_port()
62 << pctl->devdata->port_shf; in mtk_get_port()
73 reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dir_offset; in mtk_pmx_gpio_set_direction()
74 bit = BIT(offset & pctl->devdata->mode_mask); in mtk_pmx_gpio_set_direction()
76 if (pctl->devdata->spec_dir_set) in mtk_pmx_gpio_set_direction()
77 pctl->devdata->spec_dir_set(®_addr, offset); in mtk_pmx_gpio_set_direction()
95 reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dout_offset; in mtk_gpio_set()
96 bit = BIT(offset & pctl->devdata->mode_mask); in mtk_gpio_set()
116 if (!pctl->devdata->spec_ies_smt_set && in mtk_pconf_set_ies_smt()
117 pctl->devdata->ies_offset == MTK_PINCTRL_NOT_SUPPORT && in mtk_pconf_set_ies_smt()
121 if (!pctl->devdata->spec_ies_smt_set && in mtk_pconf_set_ies_smt()
122 pctl->devdata->smt_offset == MTK_PINCTRL_NOT_SUPPORT && in mtk_pconf_set_ies_smt()
130 if (pctl->devdata->spec_ies_smt_set) { in mtk_pconf_set_ies_smt()
131 return pctl->devdata->spec_ies_smt_set(mtk_get_regmap(pctl, pin), in mtk_pconf_set_ies_smt()
132 pctl->devdata, pin, value, arg); in mtk_pconf_set_ies_smt()
136 offset = pctl->devdata->ies_offset; in mtk_pconf_set_ies_smt()
138 offset = pctl->devdata->smt_offset; in mtk_pconf_set_ies_smt()
140 bit = BIT(offset & pctl->devdata->mode_mask); in mtk_pconf_set_ies_smt()
152 const struct mtk_pinctrl_devdata *devdata, in mtk_pconf_spec_set_ies_smt_range() argument
160 ies_smt_infos = devdata->spec_ies; in mtk_pconf_spec_set_ies_smt_range()
161 info_num = devdata->n_spec_ies; in mtk_pconf_spec_set_ies_smt_range()
164 ies_smt_infos = devdata->spec_smt; in mtk_pconf_spec_set_ies_smt_range()
165 info_num = devdata->n_spec_smt; in mtk_pconf_spec_set_ies_smt_range()
185 reg_addr = ies_smt_infos[i].offset + devdata->port_align; in mtk_pconf_spec_set_ies_smt_range()
187 reg_addr = ies_smt_infos[i].offset + (devdata->port_align << 1); in mtk_pconf_spec_set_ies_smt_range()
198 for (i = 0; i < pctl->devdata->n_pin_drv_grps; i++) { in mtk_find_pin_drv_grp_by_pin()
200 pctl->devdata->pin_drv_grp + i; in mtk_find_pin_drv_grp_by_pin()
216 if (pin >= pctl->devdata->npins) in mtk_pconf_set_driving()
220 if (!pin_drv || pin_drv->grp > pctl->devdata->n_grp_cls) in mtk_pconf_set_driving()
223 drv_grp = pctl->devdata->grp_desc + pin_drv->grp; in mtk_pconf_set_driving()
240 const struct mtk_pinctrl_devdata *devdata, in mtk_pctrl_spec_pull_set_samereg() argument
249 if (!devdata->spec_pupd) in mtk_pctrl_spec_pull_set_samereg()
252 for (i = 0; i < devdata->n_spec_pupd; i++) { in mtk_pctrl_spec_pull_set_samereg()
253 if (pin == devdata->spec_pupd[i].pin) { in mtk_pctrl_spec_pull_set_samereg()
262 spec_pupd_pin = devdata->spec_pupd + i; in mtk_pctrl_spec_pull_set_samereg()
263 reg_set = spec_pupd_pin->offset + devdata->port_align; in mtk_pctrl_spec_pull_set_samereg()
264 reg_rst = spec_pupd_pin->offset + (devdata->port_align << 1); in mtk_pctrl_spec_pull_set_samereg()
312 if (pctl->devdata->spec_pull_set) { in mtk_pconf_set_pull_select()
317 ret = pctl->devdata->spec_pull_set(mtk_get_regmap(pctl, pin), in mtk_pconf_set_pull_select()
318 pctl->devdata, pin, isup, in mtk_pconf_set_pull_select()
331 if (pctl->devdata->mt8365_set_clr_mode) { in mtk_pconf_set_pull_select()
332 bit = pin & pctl->devdata->mode_mask; in mtk_pconf_set_pull_select()
334 pctl->devdata->pullen_offset; in mtk_pconf_set_pull_select()
336 pctl->devdata->pullsel_offset; in mtk_pconf_set_pull_select()
337 ret = pctl->devdata->mt8365_set_clr_mode(mtk_get_regmap(pctl, pin), in mtk_pconf_set_pull_select()
346 bit = BIT(pin & pctl->devdata->mode_mask); in mtk_pconf_set_pull_select()
349 pctl->devdata->pullen_offset, pctl); in mtk_pconf_set_pull_select()
352 pctl->devdata->pullen_offset, pctl); in mtk_pconf_set_pull_select()
356 pctl->devdata->pullsel_offset, pctl); in mtk_pconf_set_pull_select()
359 pctl->devdata->pullsel_offset, pctl); in mtk_pconf_set_pull_select()
459 const struct mtk_desc_pin *pin = pctl->devdata->pins + pin_num; in mtk_pctrl_find_function_by_pin()
476 for (i = 0; i < pctl->devdata->npins; i++) { in mtk_pctrl_is_function_valid()
477 const struct mtk_desc_pin *pin = pctl->devdata->pins + i; in mtk_pctrl_is_function_valid()
583 if (pin >= pctl->devdata->npins || in mtk_pctrl_dt_subnode_to_map()
714 if (pctl->devdata->spec_pinmux_set) in mtk_pmx_set_mode()
715 pctl->devdata->spec_pinmux_set(mtk_get_regmap(pctl, pin), in mtk_pmx_set_mode()
718 reg_addr = ((pin / pctl->devdata->mode_per_reg) << pctl->devdata->port_shf) in mtk_pmx_set_mode()
719 + pctl->devdata->pinmux_offset; in mtk_pmx_set_mode()
722 bit = pin % pctl->devdata->mode_per_reg; in mtk_pmx_set_mode()
735 for (i = 0; i < pctl->devdata->npins; i++) { in mtk_find_pin_by_eint_num()
736 pin = pctl->devdata->pins + i; in mtk_find_pin_by_eint_num()
770 const struct mtk_desc_pin *pin = pctl->devdata->pins + offset; in mtk_pmx_find_gpio_mode()
832 reg_addr = mtk_get_port(pctl, offset) + pctl->devdata->dir_offset; in mtk_gpio_get_direction()
833 bit = BIT(offset & pctl->devdata->mode_mask); in mtk_gpio_get_direction()
835 if (pctl->devdata->spec_dir_set) in mtk_gpio_get_direction()
836 pctl->devdata->spec_dir_set(®_addr, offset); in mtk_gpio_get_direction()
853 pctl->devdata->din_offset; in mtk_gpio_get()
855 bit = BIT(offset & pctl->devdata->mode_mask); in mtk_gpio_get()
866 pin = pctl->devdata->pins + offset; in mtk_gpio_to_irq()
886 pin = pctl->devdata->pins + offset; in mtk_gpio_set_config()
933 pctl->ngroups = pctl->devdata->npins; in mtk_pctrl_build_state()
947 for (i = 0; i < pctl->devdata->npins; i++) { in mtk_pctrl_build_state()
948 const struct mtk_desc_pin *pin = pctl->devdata->pins + i; in mtk_pctrl_build_state()
1040 pctl->eint->regs = pctl->devdata->eint_regs; in mtk_eint_init()
1041 pctl->eint->hw = &pctl->devdata->eint_hw; in mtk_eint_init()
1086 pctl->devdata = data; in mtk_pctrl_init()
1091 pins = devm_kcalloc(&pdev->dev, pctl->devdata->npins, sizeof(*pins), in mtk_pctrl_init()
1096 for (i = 0; i < pctl->devdata->npins; i++) in mtk_pctrl_init()
1097 pins[i] = pctl->devdata->pins[i].pin; in mtk_pctrl_init()
1102 pctl->pctl_desc.npins = pctl->devdata->npins; in mtk_pctrl_init()
1119 pctl->chip->ngpio = pctl->devdata->npins; in mtk_pctrl_init()
1130 0, 0, pctl->devdata->npins); in mtk_pctrl_init()