1 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
2 +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
3 @@ -601,6 +601,30 @@ out:
7 +static int mtk_pinconf_bias_set_pd(struct mtk_pinctrl *hw,
8 + const struct mtk_pin_desc *desc,
13 + if (arg == MTK_DISABLE)
15 + else if ((arg == MTK_ENABLE) && pullup)
17 + else if ((arg == MTK_ENABLE) && !pullup)
24 + err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_PD, pd);
31 static int mtk_pinconf_bias_set_pullsel_pullen(struct mtk_pinctrl *hw,
32 const struct mtk_pin_desc *desc,
34 @@ -755,6 +779,12 @@ int mtk_pinconf_bias_set_combo(struct mt
38 + if (try_all_type & MTK_PULL_PD_TYPE) {
39 + err = mtk_pinconf_bias_set_pd(hw, desc, pullup, arg);
44 if (try_all_type & MTK_PULL_PU_PD_TYPE) {
45 err = mtk_pinconf_bias_set_pu_pd(hw, desc, pullup, arg);
47 @@ -875,6 +905,29 @@ out:
51 +static int mtk_pinconf_bias_get_pd(struct mtk_pinctrl *hw,
52 + const struct mtk_pin_desc *desc,
53 + u32 *pullup, u32 *enable)
57 + err = mtk_hw_get_value(hw, desc, PINCTRL_PIN_REG_PD, &pd);
63 + *enable = MTK_DISABLE;
64 + } else if (pd == 1) {
66 + *enable = MTK_ENABLE;
74 static int mtk_pinconf_bias_get_pullsel_pullen(struct mtk_pinctrl *hw,
75 const struct mtk_pin_desc *desc,
76 u32 *pullup, u32 *enable)
77 @@ -943,6 +996,12 @@ int mtk_pinconf_bias_get_combo(struct mt
82 + if (try_all_type & MTK_PULL_PD_TYPE) {
83 + err = mtk_pinconf_bias_get_pd(hw, desc, pullup, enable);
88 if (try_all_type & MTK_PULL_PU_PD_TYPE) {
89 err = mtk_pinconf_bias_get_pu_pd(hw, desc, pullup, enable);
90 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h
91 +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.h
93 * turned on/off itself. But it can't be selected pull up/down
95 #define MTK_PULL_RSEL_TYPE BIT(3)
96 +#define MTK_PULL_PD_TYPE BIT(4)
97 /* MTK_PULL_PU_PD_RSEL_TYPE is a type which is controlled by
98 * MTK_PULL_PU_PD_TYPE and MTK_PULL_RSEL_TYPE.