Lines Matching refs:desc
73 const struct mtk_pin_desc *desc, in mtk_hw_pin_field_lookup() argument
94 if (desc->number >= rc->range[check].s_pin in mtk_hw_pin_field_lookup()
95 && desc->number <= rc->range[check].e_pin) { in mtk_hw_pin_field_lookup()
100 else if (desc->number < rc->range[check].s_pin) in mtk_hw_pin_field_lookup()
108 field, desc->number, desc->name); in mtk_hw_pin_field_lookup()
117 field, desc->number, desc->name); in mtk_hw_pin_field_lookup()
126 (desc->number - c->s_pin) * (c->x_bits); in mtk_hw_pin_field_lookup()
146 const struct mtk_pin_desc *desc, in mtk_hw_pin_field_get() argument
154 return mtk_hw_pin_field_lookup(hw, desc, field, pfd); in mtk_hw_pin_field_get()
192 int mtk_hw_set_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc, in mtk_hw_set_value() argument
198 err = mtk_hw_pin_field_get(hw, desc, field, &pf); in mtk_hw_set_value()
215 int mtk_hw_get_value(struct mtk_pinctrl *hw, const struct mtk_pin_desc *desc, in mtk_hw_get_value() argument
221 err = mtk_hw_pin_field_get(hw, desc, field, &pf); in mtk_hw_get_value()
237 const struct mtk_pin_desc *desc; in mtk_xt_find_eint_num() local
240 desc = (const struct mtk_pin_desc *)hw->soc->pins; in mtk_xt_find_eint_num()
243 if (desc[i].eint.eint_n == eint_n) in mtk_xt_find_eint_num()
244 return desc[i].number; in mtk_xt_find_eint_num()
262 const struct mtk_pin_desc *desc; in mtk_is_virt_gpio() local
265 desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio_n]; in mtk_is_virt_gpio()
268 if (desc->eint.eint_m == NO_EINT_SUPPORT) in mtk_is_virt_gpio()
271 if (desc->funcs && !desc->funcs[desc->eint.eint_m].name) in mtk_is_virt_gpio()
283 const struct mtk_pin_desc *desc; in mtk_xt_get_gpio_n() local
285 desc = (const struct mtk_pin_desc *)hw->soc->pins; in mtk_xt_get_gpio_n()
293 desc[eint_n].eint.eint_n == eint_n) in mtk_xt_get_gpio_n()
304 const struct mtk_pin_desc *desc; in mtk_xt_get_gpio_state() local
313 desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio_n]; in mtk_xt_get_gpio_state()
315 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DI, &value); in mtk_xt_get_gpio_state()
325 const struct mtk_pin_desc *desc; in mtk_xt_set_gpio_as_eint() local
337 desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio_n]; in mtk_xt_set_gpio_as_eint()
339 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_MODE, in mtk_xt_set_gpio_as_eint()
340 desc->eint.eint_m); in mtk_xt_set_gpio_as_eint()
344 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR, MTK_INPUT); in mtk_xt_set_gpio_as_eint()
348 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT, MTK_ENABLE); in mtk_xt_set_gpio_as_eint()
415 const struct mtk_pin_desc *desc) in mtk_pinconf_bias_disable_set() argument
419 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PU, in mtk_pinconf_bias_disable_set()
424 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PD, in mtk_pinconf_bias_disable_set()
434 const struct mtk_pin_desc *desc, int *res) in mtk_pinconf_bias_disable_get() argument
439 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PU, &v); in mtk_pinconf_bias_disable_get()
443 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &v2); in mtk_pinconf_bias_disable_get()
457 const struct mtk_pin_desc *desc, bool pullup) in mtk_pinconf_bias_set() argument
463 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PU, arg & 1); in mtk_pinconf_bias_set()
467 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PD, in mtk_pinconf_bias_set()
477 const struct mtk_pin_desc *desc, bool pullup, int *res) in mtk_pinconf_bias_get() argument
483 err = mtk_hw_get_value(hw, desc, reg, &v); in mtk_pinconf_bias_get()
498 const struct mtk_pin_desc *desc) in mtk_pinconf_bias_disable_set_rev1() argument
500 return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PULLEN, in mtk_pinconf_bias_disable_set_rev1()
506 const struct mtk_pin_desc *desc, int *res) in mtk_pinconf_bias_disable_get_rev1() argument
510 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PULLEN, &v); in mtk_pinconf_bias_disable_get_rev1()
524 const struct mtk_pin_desc *desc, bool pullup) in mtk_pinconf_bias_set_rev1() argument
530 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PULLEN, in mtk_pinconf_bias_set_rev1()
535 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PULLSEL, arg); in mtk_pinconf_bias_set_rev1()
544 const struct mtk_pin_desc *desc, bool pullup, in mtk_pinconf_bias_get_rev1() argument
549 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PULLEN, &v); in mtk_pinconf_bias_get_rev1()
556 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PULLSEL, &v); in mtk_pinconf_bias_get_rev1()
575 const struct mtk_pin_desc *desc, in mtk_pinconf_bias_set_pu_pd() argument
594 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PU, pu); in mtk_pinconf_bias_set_pu_pd()
598 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PD, pd); in mtk_pinconf_bias_set_pu_pd()
605 const struct mtk_pin_desc *desc, in mtk_pinconf_bias_set_pullsel_pullen() argument
619 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PULLEN, enable); in mtk_pinconf_bias_set_pullsel_pullen()
623 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PULLSEL, pullup); in mtk_pinconf_bias_set_pullsel_pullen()
630 const struct mtk_pin_desc *desc, in mtk_pinconf_bias_set_pupd_r1_r0() argument
654 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PUPD, !pullup); in mtk_pinconf_bias_set_pupd_r1_r0()
658 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_R0, r0); in mtk_pinconf_bias_set_pupd_r1_r0()
662 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_R1, r1); in mtk_pinconf_bias_set_pupd_r1_r0()
669 const struct mtk_pin_desc *desc, in mtk_hw_pin_rsel_lookup() argument
679 if (desc->number >= rsel[check].s_pin && in mtk_hw_pin_rsel_lookup()
680 desc->number <= rsel[check].e_pin) { in mtk_hw_pin_rsel_lookup()
699 arg, desc->number, desc->name); in mtk_hw_pin_rsel_lookup()
707 const struct mtk_pin_desc *desc, in mtk_pinconf_bias_set_rsel() argument
714 err = mtk_hw_pin_rsel_lookup(hw, desc, pullup, arg, &rsel_val); in mtk_pinconf_bias_set_rsel()
724 return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_RSEL, rsel_val); in mtk_pinconf_bias_set_rsel()
728 const struct mtk_pin_desc *desc, in mtk_pinconf_bias_set_pu_pd_rsel() argument
735 err = mtk_pinconf_bias_set_rsel(hw, desc, pullup, arg); in mtk_pinconf_bias_set_pu_pd_rsel()
740 return mtk_pinconf_bias_set_pu_pd(hw, desc, pullup, enable); in mtk_pinconf_bias_set_pu_pd_rsel()
744 const struct mtk_pin_desc *desc, in mtk_pinconf_bias_set_combo() argument
751 try_all_type = hw->soc->pull_type[desc->number]; in mtk_pinconf_bias_set_combo()
756 err = mtk_pinconf_bias_set_pu_pd_rsel(hw, desc, pullup, arg); in mtk_pinconf_bias_set_combo()
762 err = mtk_pinconf_bias_set_pu_pd(hw, desc, pullup, arg); in mtk_pinconf_bias_set_combo()
768 err = mtk_pinconf_bias_set_pullsel_pullen(hw, desc, in mtk_pinconf_bias_set_combo()
775 err = mtk_pinconf_bias_set_pupd_r1_r0(hw, desc, pullup, arg); in mtk_pinconf_bias_set_combo()
785 const struct mtk_pin_desc *desc, in mtk_rsel_get_si_unit() argument
794 if (desc->number >= rsel[check].s_pin && in mtk_rsel_get_si_unit()
795 desc->number <= rsel[check].e_pin) { in mtk_rsel_get_si_unit()
810 const struct mtk_pin_desc *desc, in mtk_pinconf_bias_get_pu_pd_rsel() argument
815 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_RSEL, &rsel); in mtk_pinconf_bias_get_pu_pd_rsel()
819 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PU, &pu); in mtk_pinconf_bias_get_pu_pd_rsel()
823 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &pd); in mtk_pinconf_bias_get_pu_pd_rsel()
833 mtk_rsel_get_si_unit(hw, desc, *pullup, rsel, enable); in mtk_pinconf_bias_get_pu_pd_rsel()
839 mtk_rsel_get_si_unit(hw, desc, *pullup, rsel, enable); in mtk_pinconf_bias_get_pu_pd_rsel()
852 const struct mtk_pin_desc *desc, in mtk_pinconf_bias_get_pu_pd() argument
857 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PU, &pu); in mtk_pinconf_bias_get_pu_pd()
861 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &pd); in mtk_pinconf_bias_get_pu_pd()
882 const struct mtk_pin_desc *desc, in mtk_pinconf_bias_get_pullsel_pullen() argument
887 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PULLSEL, pullup); in mtk_pinconf_bias_get_pullsel_pullen()
891 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PULLEN, enable); in mtk_pinconf_bias_get_pullsel_pullen()
898 const struct mtk_pin_desc *desc, in mtk_pinconf_bias_get_pupd_r1_r0() argument
903 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PUPD, pullup); in mtk_pinconf_bias_get_pupd_r1_r0()
909 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_R0, &r0); in mtk_pinconf_bias_get_pupd_r1_r0()
913 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_R1, &r1); in mtk_pinconf_bias_get_pupd_r1_r0()
933 const struct mtk_pin_desc *desc, in mtk_pinconf_bias_get_combo() argument
940 try_all_type = hw->soc->pull_type[desc->number]; in mtk_pinconf_bias_get_combo()
945 err = mtk_pinconf_bias_get_pu_pd_rsel(hw, desc, pullup, enable); in mtk_pinconf_bias_get_combo()
951 err = mtk_pinconf_bias_get_pu_pd(hw, desc, pullup, enable); in mtk_pinconf_bias_get_combo()
957 err = mtk_pinconf_bias_get_pullsel_pullen(hw, desc, in mtk_pinconf_bias_get_combo()
964 err = mtk_pinconf_bias_get_pupd_r1_r0(hw, desc, pullup, enable); in mtk_pinconf_bias_get_combo()
972 const struct mtk_pin_desc *desc, u32 arg) in mtk_pinconf_drive_set() argument
977 tb = &mtk_drive[desc->drv_n]; in mtk_pinconf_drive_set()
985 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_E4, in mtk_pinconf_drive_set()
990 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_E8, in mtk_pinconf_drive_set()
1001 const struct mtk_pin_desc *desc, int *val) in mtk_pinconf_drive_get() argument
1006 tb = &mtk_drive[desc->drv_n]; in mtk_pinconf_drive_get()
1008 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_E4, &val1); in mtk_pinconf_drive_get()
1012 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_E8, &val2); in mtk_pinconf_drive_get()
1027 const struct mtk_pin_desc *desc, u32 arg) in mtk_pinconf_drive_set_rev1() argument
1032 tb = &mtk_drive[desc->drv_n]; in mtk_pinconf_drive_set_rev1()
1037 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV, in mtk_pinconf_drive_set_rev1()
1048 const struct mtk_pin_desc *desc, int *val) in mtk_pinconf_drive_get_rev1() argument
1053 tb = &mtk_drive[desc->drv_n]; in mtk_pinconf_drive_get_rev1()
1055 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV, &val1); in mtk_pinconf_drive_get_rev1()
1066 const struct mtk_pin_desc *desc, u32 arg) in mtk_pinconf_drive_set_raw() argument
1068 return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV, arg); in mtk_pinconf_drive_set_raw()
1073 const struct mtk_pin_desc *desc, int *val) in mtk_pinconf_drive_get_raw() argument
1075 return mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV, val); in mtk_pinconf_drive_get_raw()
1080 const struct mtk_pin_desc *desc, bool pullup, in mtk_pinconf_adv_pull_set() argument
1090 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_R0, arg & 1); in mtk_pinconf_adv_pull_set()
1094 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_R1, in mtk_pinconf_adv_pull_set()
1101 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PUPD, arg); in mtk_pinconf_adv_pull_set()
1108 err = hw->soc->bias_set(hw, desc, pullup); in mtk_pinconf_adv_pull_set()
1112 err = mtk_pinconf_bias_set_rev1(hw, desc, pullup); in mtk_pinconf_adv_pull_set()
1114 err = mtk_pinconf_bias_set(hw, desc, pullup); in mtk_pinconf_adv_pull_set()
1123 const struct mtk_pin_desc *desc, bool pullup, in mtk_pinconf_adv_pull_get() argument
1129 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PUPD, &t); in mtk_pinconf_adv_pull_get()
1136 err = hw->soc->bias_get(hw, desc, pullup, val); in mtk_pinconf_adv_pull_get()
1151 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_R0, &t); in mtk_pinconf_adv_pull_get()
1155 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_R1, &t2); in mtk_pinconf_adv_pull_get()
1166 const struct mtk_pin_desc *desc, u32 arg) in mtk_pinconf_adv_drive_set() argument
1173 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV_EN, en); in mtk_pinconf_adv_drive_set()
1180 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV_E0, e0); in mtk_pinconf_adv_drive_set()
1184 err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV_E1, e1); in mtk_pinconf_adv_drive_set()
1193 const struct mtk_pin_desc *desc, u32 *val) in mtk_pinconf_adv_drive_get() argument
1198 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV_EN, &en); in mtk_pinconf_adv_drive_get()
1202 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV_E0, &e0); in mtk_pinconf_adv_drive_get()
1206 err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV_E1, &e1); in mtk_pinconf_adv_drive_get()
1217 const struct mtk_pin_desc *desc, u32 arg) in mtk_pinconf_adv_drive_set_raw() argument
1219 return mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DRV_ADV, arg); in mtk_pinconf_adv_drive_set_raw()
1224 const struct mtk_pin_desc *desc, u32 *val) in mtk_pinconf_adv_drive_get_raw() argument
1226 return mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_DRV_ADV, val); in mtk_pinconf_adv_drive_get_raw()