Linux-Amlogic Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] pinctrl: meson: Fix wrong shift value when get drive-strength
@ 2019-12-26  2:37 Qianggui Song
  2020-01-07 10:21 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Qianggui Song @ 2019-12-26  2:37 UTC (permalink / raw)
  To: Linus Walleij, linux-gpio
  Cc: Qianggui Song, Jianxin Pan, Neil Armstrong, Martin Blumenstingl,
	Kevin Hilman, linux-kernel, Guillaume La Roque, linux-arm-kernel,
	linux-amlogic, Xingyu Chen, Jerome Brunet

In meson_pinconf_get_drive_strength, variable bit is calculated by
meson_calc_reg_and_bit, this value is the offset from the first pin of a
certain bank to current pin, while Meson SoCs use two bits for each pin
to depict drive-strength. So a left shift by 1 should be done or node
pinconf-pins shows wrong message.

Fixes: 6ea3e3bbef37 ("pinctrl: meson: add support of drive-strength-microamp")

Signed-off-by: Qianggui Song <qianggui.song@amlogic.com>
---
 drivers/pinctrl/meson/pinctrl-meson.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c
index 3c80828a5e50..bbc919bef2bf 100644
--- a/drivers/pinctrl/meson/pinctrl-meson.c
+++ b/drivers/pinctrl/meson/pinctrl-meson.c
@@ -441,6 +441,7 @@ static int meson_pinconf_get_drive_strength(struct meson_pinctrl *pc,
 		return ret;
 
 	meson_calc_reg_and_bit(bank, pin, REG_DS, &reg, &bit);
+	bit = bit << 1;
 
 	ret = regmap_read(pc->reg_ds, reg, &val);
 	if (ret)
-- 
2.24.0


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

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

* Re: [PATCH] pinctrl: meson: Fix wrong shift value when get drive-strength
  2019-12-26  2:37 [PATCH] pinctrl: meson: Fix wrong shift value when get drive-strength Qianggui Song
@ 2020-01-07 10:21 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2020-01-07 10:21 UTC (permalink / raw)
  To: Qianggui Song
  Cc: Jianxin Pan, Neil Armstrong, Martin Blumenstingl, Kevin Hilman,
	linux-kernel, open list:GPIO SUBSYSTEM, Guillaume La Roque,
	Linux ARM, open list:ARM/Amlogic Meson...,
	Xingyu Chen, Jerome Brunet

On Thu, Dec 26, 2019 at 3:37 AM Qianggui Song <qianggui.song@amlogic.com> wrote:

> In meson_pinconf_get_drive_strength, variable bit is calculated by
> meson_calc_reg_and_bit, this value is the offset from the first pin of a
> certain bank to current pin, while Meson SoCs use two bits for each pin
> to depict drive-strength. So a left shift by 1 should be done or node
> pinconf-pins shows wrong message.
>
> Fixes: 6ea3e3bbef37 ("pinctrl: meson: add support of drive-strength-microamp")
>
> Signed-off-by: Qianggui Song <qianggui.song@amlogic.com>

Patch applied.

Yours,
Linus Walleij

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

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-26  2:37 [PATCH] pinctrl: meson: Fix wrong shift value when get drive-strength Qianggui Song
2020-01-07 10:21 ` Linus Walleij

Linux-Amlogic Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-amlogic/0 linux-amlogic/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-amlogic linux-amlogic/ https://lore.kernel.org/linux-amlogic \
		linux-amlogic@lists.infradead.org
	public-inbox-index linux-amlogic

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-amlogic


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git