diff options
author | Weijie Gao | 2023-07-19 17:16:46 +0800 |
---|---|---|
committer | Tom Rini | 2023-08-03 09:40:50 -0400 |
commit | f9c610618cc46df76b3b27eba0456554bfb1ed46 (patch) | |
tree | 4296e9d4bc180cfd8541cbf2ec74ce4f0f5c8ed6 | |
parent | 4fd0be037229bb558e36002d061967880d80ce88 (diff) |
pinctrl: mediatek: add pinmux_set ops support
This patch adds pinmux_set ops for mediatek pinctrl framework
Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
-rw-r--r-- | drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c index 623a094c39c..0baef57c1c2 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c @@ -304,6 +304,19 @@ static const char *mtk_get_function_name(struct udevice *dev, return priv->soc->funcs[selector].name; } +static int mtk_pinmux_set(struct udevice *dev, unsigned int pin_selector, + unsigned int func_selector) +{ + int err; + + err = mtk_hw_set_value(dev, pin_selector, PINCTRL_PIN_REG_MODE, + func_selector); + if (err) + return err; + + return 0; +} + static int mtk_pinmux_group_set(struct udevice *dev, unsigned int group_selector, unsigned int func_selector) @@ -647,6 +660,7 @@ const struct pinctrl_ops mtk_pinctrl_ops = { .get_group_name = mtk_get_group_name, .get_functions_count = mtk_get_functions_count, .get_function_name = mtk_get_function_name, + .pinmux_set = mtk_pinmux_set, .pinmux_group_set = mtk_pinmux_group_set, #if CONFIG_IS_ENABLED(PINCONF) .pinconf_num_params = ARRAY_SIZE(mtk_conf_params), |