Thread (2 messages) 2 messages, 2 authors, 2018-12-27
STALE2744d

[PATCH v3] pinctrl:mediatek:add EINT support to virtual GPIOs

From: <hidden>
Date: 2018-12-25 04:25:26
Also in: linux-gpio, linux-mediatek, lkml
Subsystem: pin control subsystem, pin controller - mediatek, the rest · Maintainers: Linus Walleij, Sean Wang, Linus Torvalds

From: Chuanjia Liu <redacted>

Virtual gpio only used inside SOC and not being exported to outside SOC.
Some modules use virtual gpio as eint and doesn't nedd SMT.
So this patch add EINT support to virtual GPIOs.

Signed-off-by: Chuanjia Liu <redacted>
---
change note:
v3 : 1. modify subject and description
      2. modify comments
---
 drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
index 4a9e0d4c2bbc..a0db145f798d 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c
@@ -290,7 +290,15 @@ 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;
-- 
2.19.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help