Message ID | 1597916439-26376-1-git-send-email-light.hsieh@mediatek.com |
---|---|
State | New |
Headers | show |
Series | [v1,1/1] pinctrl: mediatek: refine mtk_pmx_get_funcs_cnt() | expand |
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt6765.c b/drivers/pinctrl/mediatek/pinctrl-mt6765.c index 2c59d39..8d9f3ea 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt6765.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt6765.c @@ -1069,6 +1069,7 @@ .pins = mtk_pins_mt6765, .npins = ARRAY_SIZE(mtk_pins_mt6765), .ngrps = ARRAY_SIZE(mtk_pins_mt6765), + .nfuncs = 8, .eint_hw = &mt6765_eint_hw, .gpio_m = 0, .base_names = mt6765_pinctrl_register_base_names, diff --git a/drivers/pinctrl/mediatek/pinctrl-mt6779.c b/drivers/pinctrl/mediatek/pinctrl-mt6779.c index bb0851c..1f26adb 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mt6779.c +++ b/drivers/pinctrl/mediatek/pinctrl-mt6779.c @@ -744,6 +744,7 @@ .pins = mtk_pins_mt6779, .npins = ARRAY_SIZE(mtk_pins_mt6779), .ngrps = ARRAY_SIZE(mtk_pins_mt6779), + .nfuncs = 8, .eint_hw = &mt6779_eint_hw, .gpio_m = 0, .ies_present = true, diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c index a23c182..96f9f86 100644 --- a/drivers/pinctrl/mediatek/pinctrl-paris.c +++ b/drivers/pinctrl/mediatek/pinctrl-paris.c @@ -657,6 +657,10 @@ static void mtk_pctrl_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s, static int mtk_pmx_get_funcs_cnt(struct pinctrl_dev *pctldev) { + struct mtk_pinctrl *hw = pinctrl_dev_get_drvdata(pctldev); + + if (hw->soc->nfuncs) + return (int)hw->soc->nfuncs; return ARRAY_SIZE(mtk_gpio_functions); }