All of lore.kernel.org
 help / color / mirror / Atom feed
From: <chuanjia.liu@mediatek.com>
To: sean.wang@kernel.org, linus.walleij@linaro.org,
	matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org,
	linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: youlin.pei@mediatek.com, zhiyong.tao@mediatek.com,
	eddie.huang@mediatek.com, hailong.fan@mediatek.com,
	"chuanjia.liu" <Chuanjia.Liu@mediatek.com>
Subject: [PATCH v5] pinctrl: mediatek: add EINT support to virtual GPIOs
Date: Thu, 3 Jan 2019 11:37:15 +0800	[thread overview]
Message-ID: <1546486635-16829-1-git-send-email-chuanjia.liu@mediatek.com> (raw)

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(-)

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

WARNING: multiple messages have this Message-ID (diff)
From: <chuanjia.liu@mediatek.com>
To: <sean.wang@kernel.org>, <linus.walleij@linaro.org>,
	<matthias.bgg@gmail.com>, <linux-mediatek@lists.infradead.org>,
	<linux-gpio@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Cc: youlin.pei@mediatek.com, zhiyong.tao@mediatek.com,
	eddie.huang@mediatek.com, hailong.fan@mediatek.com,
	"chuanjia.liu" <Chuanjia.Liu@mediatek.com>
Subject: [PATCH v5] pinctrl: mediatek: add EINT support to virtual GPIOs
Date: Thu, 3 Jan 2019 11:37:15 +0800	[thread overview]
Message-ID: <1546486635-16829-1-git-send-email-chuanjia.liu@mediatek.com> (raw)

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(-)

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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2019-01-03  3:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-03  3:37 chuanjia.liu [this message]
2019-01-03  3:37 ` [PATCH v5] pinctrl: mediatek: add EINT support to virtual GPIOs chuanjia.liu
2019-01-04 10:26 ` Sean Wang
2019-01-04 10:26   ` Sean Wang
2019-01-11 12:15 ` Linus Walleij
2019-01-11 12:15   ` Linus Walleij
2019-01-11 12:15   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1546486635-16829-1-git-send-email-chuanjia.liu@mediatek.com \
    --to=chuanjia.liu@mediatek.com \
    --cc=eddie.huang@mediatek.com \
    --cc=hailong.fan@mediatek.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=sean.wang@kernel.org \
    --cc=youlin.pei@mediatek.com \
    --cc=zhiyong.tao@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.