Skip to content

Commit

Permalink
pinctrl: mediatek: add EINT support to virtual GPIOs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
chuanjia.liu authored and Linus Walleij committed Jan 11, 2019
1 parent 3fbb9a8 commit 6e737a4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6e737a4

Please sign in to comment.