linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] pinctrl:mediatek:add EINT support to virtual GPIOs
@ 2018-12-25  4:23 chuanjia.liu
  2018-12-27 19:16 ` Sean Wang
  0 siblings, 1 reply; 2+ messages in thread
From: chuanjia.liu @ 2018-12-25  4:23 UTC (permalink / raw)
  To: sean.wang, linus.walleij, matthias.bgg, linux-mediatek,
	linux-gpio, linux-arm-kernel, linux-kernel
  Cc: youlin.pei, eddie.huang, zhiyong.tao, hailong.fan, Chuanjia Liu

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 nedd SMT.
So this patch add EINT support to virtual GPIOs.

Signed-off-by: Chuanjia Liu <Chuanjia.Liu@mediatek.com>
---
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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] pinctrl:mediatek:add EINT support to virtual GPIOs
  2018-12-25  4:23 [PATCH v3] pinctrl:mediatek:add EINT support to virtual GPIOs chuanjia.liu
@ 2018-12-27 19:16 ` Sean Wang
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Wang @ 2018-12-27 19:16 UTC (permalink / raw)
  To: chuanjia.liu
  Cc: Linus Walleij, Matthias Brugger, linux-mediatek, linux-gpio,
	linux-arm-kernel, linux-kernel, youlin.pei, eddie.huang,
	zhiyong.tao, hailong.fan

On Mon, Dec 24, 2018 at 8:25 PM <chuanjia.liu@mediatek.com> wrote:
>
> From: Chuanjia Liu <Chuanjia.Liu@mediatek.com>
>

there are still some nitpicks

an empty char should follow the ':' char

> 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.

s/nedd/need/

> So this patch add EINT support to virtual GPIOs.
>
> Signed-off-by: Chuanjia Liu <Chuanjia.Liu@mediatek.com>
> ---
> 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)
> +       /*

merge the second line to be consistent with the other comment blocks

> +        *SMT is supposed to be supported by every real GPIO and doesn't

an empty char should follow '*' char to be consistent with the other
comment blocks
and also in the other lines starting with '*'

> +        *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.
> +        */
> +

remove the blank line

> +       if (err && err != -ENOTSUPP)
>                 return err;
>
>         return 0;
> --
> 2.19.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-27 19:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-25  4:23 [PATCH v3] pinctrl:mediatek:add EINT support to virtual GPIOs chuanjia.liu
2018-12-27 19:16 ` Sean Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).