All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhiyong Tao <zhiyong.tao@mediatek.com>
To: <robh+dt@kernel.org>, <linus.walleij@linaro.org>,
	<mark.rutland@arm.com>, <matthias.bgg@gmail.com>,
	<sean.wang@kernel.org>
Cc: <srv_heupstream@mediatek.com>, <zhiyong.tao@mediatek.com>,
	<hui.liu@mediatek.com>, <eddie.huang@mediatek.com>,
	<jg_poxu@mediatek.com>, <biao.huang@mediatek.com>,
	<hongzhou.yang@mediatek.com>, <erin.lo@mediatek.com>,
	<sean.wang@mediatek.com>, <seiya.wang@mediatek.com>,
	<sj.huang@mediatek.com>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	<linux-gpio@vger.kernel.org>
Subject: [PATCH] pinctrl: fix low level output voltage issue
Date: Fri, 20 Nov 2020 17:30:58 +0800	[thread overview]
Message-ID: <20201120093058.7248-2-zhiyong.tao@mediatek.com> (raw)
In-Reply-To: <20201120093058.7248-1-zhiyong.tao@mediatek.com>

This patch is used to fix low level output voltage issue.
A pin is changed from input pull-up to output high.
The Dout value of the pin is default as 0.
If we change the direction of the pin before the dout value of the pin,
It maybe produce a low level output voltage between "input pull-up" and
"output high".

Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
---
 drivers/pinctrl/mediatek/pinctrl-paris.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c
index 623af4410b07..039ce9be19c5 100644
--- a/drivers/pinctrl/mediatek/pinctrl-paris.c
+++ b/drivers/pinctrl/mediatek/pinctrl-paris.c
@@ -247,13 +247,13 @@ static int mtk_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
 		err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SR, !!arg);
 		break;
 	case PIN_CONFIG_OUTPUT:
-		err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR,
-				       MTK_OUTPUT);
+		err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DO,
+				       arg);
 		if (err)
 			goto err;
 
-		err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DO,
-				       arg);
+		err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR,
+				       MTK_OUTPUT);
 		break;
 	case PIN_CONFIG_INPUT_SCHMITT:
 	case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
-- 
2.18.0


WARNING: multiple messages have this Message-ID (diff)
From: Zhiyong Tao <zhiyong.tao@mediatek.com>
To: <robh+dt@kernel.org>, <linus.walleij@linaro.org>,
	<mark.rutland@arm.com>,  <matthias.bgg@gmail.com>,
	<sean.wang@kernel.org>
Cc: devicetree@vger.kernel.org, eddie.huang@mediatek.com,
	srv_heupstream@mediatek.com, linux-gpio@vger.kernel.org,
	biao.huang@mediatek.com, zhiyong.tao@mediatek.com,
	erin.lo@mediatek.com, hui.liu@mediatek.com,
	seiya.wang@mediatek.com, linux-kernel@vger.kernel.org,
	hongzhou.yang@mediatek.com, sj.huang@mediatek.com,
	linux-mediatek@lists.infradead.org, sean.wang@mediatek.com,
	jg_poxu@mediatek.com, linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pinctrl: fix low level output voltage issue
Date: Fri, 20 Nov 2020 17:30:58 +0800	[thread overview]
Message-ID: <20201120093058.7248-2-zhiyong.tao@mediatek.com> (raw)
In-Reply-To: <20201120093058.7248-1-zhiyong.tao@mediatek.com>

This patch is used to fix low level output voltage issue.
A pin is changed from input pull-up to output high.
The Dout value of the pin is default as 0.
If we change the direction of the pin before the dout value of the pin,
It maybe produce a low level output voltage between "input pull-up" and
"output high".

Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
---
 drivers/pinctrl/mediatek/pinctrl-paris.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c
index 623af4410b07..039ce9be19c5 100644
--- a/drivers/pinctrl/mediatek/pinctrl-paris.c
+++ b/drivers/pinctrl/mediatek/pinctrl-paris.c
@@ -247,13 +247,13 @@ static int mtk_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
 		err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SR, !!arg);
 		break;
 	case PIN_CONFIG_OUTPUT:
-		err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR,
-				       MTK_OUTPUT);
+		err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DO,
+				       arg);
 		if (err)
 			goto err;
 
-		err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DO,
-				       arg);
+		err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR,
+				       MTK_OUTPUT);
 		break;
 	case PIN_CONFIG_INPUT_SCHMITT:
 	case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
-- 
2.18.0
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Zhiyong Tao <zhiyong.tao@mediatek.com>
To: <robh+dt@kernel.org>, <linus.walleij@linaro.org>,
	<mark.rutland@arm.com>,  <matthias.bgg@gmail.com>,
	<sean.wang@kernel.org>
Cc: devicetree@vger.kernel.org, eddie.huang@mediatek.com,
	srv_heupstream@mediatek.com, linux-gpio@vger.kernel.org,
	biao.huang@mediatek.com, zhiyong.tao@mediatek.com,
	erin.lo@mediatek.com, hui.liu@mediatek.com,
	seiya.wang@mediatek.com, linux-kernel@vger.kernel.org,
	hongzhou.yang@mediatek.com, sj.huang@mediatek.com,
	linux-mediatek@lists.infradead.org, sean.wang@mediatek.com,
	jg_poxu@mediatek.com, linux-arm-kernel@lists.infradead.org
Subject: [PATCH] pinctrl: fix low level output voltage issue
Date: Fri, 20 Nov 2020 17:30:58 +0800	[thread overview]
Message-ID: <20201120093058.7248-2-zhiyong.tao@mediatek.com> (raw)
In-Reply-To: <20201120093058.7248-1-zhiyong.tao@mediatek.com>

This patch is used to fix low level output voltage issue.
A pin is changed from input pull-up to output high.
The Dout value of the pin is default as 0.
If we change the direction of the pin before the dout value of the pin,
It maybe produce a low level output voltage between "input pull-up" and
"output high".

Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
---
 drivers/pinctrl/mediatek/pinctrl-paris.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.c b/drivers/pinctrl/mediatek/pinctrl-paris.c
index 623af4410b07..039ce9be19c5 100644
--- a/drivers/pinctrl/mediatek/pinctrl-paris.c
+++ b/drivers/pinctrl/mediatek/pinctrl-paris.c
@@ -247,13 +247,13 @@ static int mtk_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
 		err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SR, !!arg);
 		break;
 	case PIN_CONFIG_OUTPUT:
-		err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR,
-				       MTK_OUTPUT);
+		err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DO,
+				       arg);
 		if (err)
 			goto err;
 
-		err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DO,
-				       arg);
+		err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_DIR,
+				       MTK_OUTPUT);
 		break;
 	case PIN_CONFIG_INPUT_SCHMITT:
 	case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
-- 
2.18.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-11-20  9:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20  9:30 [PATCH 0/1] Mediatek pinctrl patch Zhiyong Tao
2020-11-20  9:30 ` Zhiyong Tao
2020-11-20  9:30 ` Zhiyong Tao
2020-11-20  9:30 ` Zhiyong Tao [this message]
2020-11-20  9:30   ` [PATCH] pinctrl: fix low level output voltage issue Zhiyong Tao
2020-11-20  9:30   ` Zhiyong Tao
2020-12-04  8:43   ` Linus Walleij
2020-12-04  8:43     ` Linus Walleij
2020-12-04  8:43     ` 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=20201120093058.7248-2-zhiyong.tao@mediatek.com \
    --to=zhiyong.tao@mediatek.com \
    --cc=biao.huang@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=eddie.huang@mediatek.com \
    --cc=erin.lo@mediatek.com \
    --cc=hongzhou.yang@mediatek.com \
    --cc=hui.liu@mediatek.com \
    --cc=jg_poxu@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=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=sean.wang@kernel.org \
    --cc=sean.wang@mediatek.com \
    --cc=seiya.wang@mediatek.com \
    --cc=sj.huang@mediatek.com \
    --cc=srv_heupstream@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.