diff mbox series

[v5] pinctrl: mediatek: add EINT support to virtual GPIOs

Message ID 1546486635-16829-1-git-send-email-chuanjia.liu@mediatek.com (mailing list archive)
State Mainlined, archived
Commit 6e737a4e921ea99125955d0d8821d8da129b03bd
Headers show
Series [v5] pinctrl: mediatek: add EINT support to virtual GPIOs | expand

Commit Message

Chuanjia Liu Jan. 3, 2019, 3:37 a.m. UTC
From: "chuanjia.liu" <Chuanjia.Liu@mediatek.com>

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>
---
change note:
v5: This patch is the same as v4,re-upload due to
      mail permissions issues	 
---
 drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Sean Wang Jan. 4, 2019, 10:26 a.m. UTC | #1
On Wed, Jan 2, 2019 at 7:38 PM <chuanjia.liu@mediatek.com> wrote:
>
> From: "chuanjia.liu" <Chuanjia.Liu@mediatek.com>
>
> 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>

BTW, if you were worried about a patch is lost, you could use RESEND
in the tag is fine.

> ---
> change note:
> v5: This patch is the same as v4,re-upload due to
>       mail permissions issues
> ---
>  drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 8 +++++++-
>  1 file changed, 7 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..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;
> --
> 2.19.1
>
Linus Walleij Jan. 11, 2019, 12:15 p.m. UTC | #2
On Thu, Jan 3, 2019 at 4:38 AM <chuanjia.liu@mediatek.com> wrote:

> From: "chuanjia.liu" <Chuanjia.Liu@mediatek.com>
>
> 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>
> ---
> change note:
> v5: This patch is the same as v4,re-upload due to
>       mail permissions issues

Patch applied with Sean's ACK.

Yours,
Linus Walleij
diff mbox series

Patch

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;