summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/mediatek
diff options
context:
space:
mode:
authorchuanjia.liu <Chuanjia.Liu@mediatek.com>2019-01-03 11:37:15 +0800
committerLinus Walleij <linus.walleij@linaro.org>2019-01-11 13:15:06 +0100
commit6e737a4e921ea99125955d0d8821d8da129b03bd (patch)
treec1df903a3face09c376a4b1c3d211f4fbd114ee7 /drivers/pinctrl/mediatek
parent3fbb9a8d79a84bf549979cad5511e202098d0aaa (diff)
downloadtalos-op-linux-6e737a4e921ea99125955d0d8821d8da129b03bd.tar.gz
talos-op-linux-6e737a4e921ea99125955d0d8821d8da129b03bd.zip
pinctrl: mediatek: add EINT support to virtual GPIOs
Virtual gpio only used inside SOC and not being exported to outside SOC. Some modules use virtual gpio as eint and doesn't need SMT. So this patch add EINT support to virtual GPIOs. Signed-off-by: Chuanjia Liu <Chuanjia.Liu@mediatek.com> Acked-by: Sean Wang <sean.wang@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/mediatek')
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
index 4a9e0d4c2bbc..b1c368455d30 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
@@ -290,7 +290,13 @@ static int mtk_xt_set_gpio_as_eint(void *data, unsigned long eint_n)
return err;
err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT, MTK_ENABLE);
- if (err)
+ /* SMT is supposed to be supported by every real GPIO and doesn't
+ * support virtual GPIOs, so the extra condition err != -ENOTSUPP
+ * is just for adding EINT support to these virtual GPIOs. It should
+ * add an extra flag in the pin descriptor when more pins with
+ * distinctive characteristic come out.
+ */
+ if (err && err != -ENOTSUPP)
return err;
return 0;
OpenPOWER on IntegriCloud