linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / 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 related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-07 10:22 UTC | newest]

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

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