diff mbox series

pinctrl: mediatek: fix mode encoding

Message ID 20210608150656.29007-1-matthias.bgg@kernel.org (mailing list archive)
State New, archived
Headers show
Series pinctrl: mediatek: fix mode encoding | expand

Commit Message

Matthias Brugger June 8, 2021, 3:06 p.m. UTC
From: Matthias Brugger <mbrugger@suse.com>

Pin modes are encoded in the SoC data structure. Use that value to set
IES SMT.

Cc: Fabien Parent <fparent@baylibre.com>
Cc: Sean Wang <sean.wang@kernel.org>
Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Cc: linux-mediatek@lists.infradead.org
Fixes: 696beef77521 ("pinctrl: mediatek: move bit assignment")
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---

 drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Linus Walleij June 9, 2021, 11:18 a.m. UTC | #1
On Tue, Jun 8, 2021 at 5:07 PM <matthias.bgg@kernel.org> wrote:

> From: Matthias Brugger <mbrugger@suse.com>
>
> Pin modes are encoded in the SoC data structure. Use that value to set
> IES SMT.
>
> Cc: Fabien Parent <fparent@baylibre.com>
> Cc: Sean Wang <sean.wang@kernel.org>
> Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> Cc: linux-mediatek@lists.infradead.org
> Fixes: 696beef77521 ("pinctrl: mediatek: move bit assignment")
> Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
> Signed-off-by: Matthias Brugger <mbrugger@suse.com>

Patch applied!

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index 525b1aa7f7a6..5f7c421ab6e7 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -134,13 +134,13 @@  static int mtk_pconf_set_ies_smt(struct mtk_pinctrl *pctl, unsigned pin,
 			pin, pctl->devdata->port_align, value, arg);
 	}
 
-	bit = BIT(pin & 0xf);
-
 	if (arg == PIN_CONFIG_INPUT_ENABLE)
 		offset = pctl->devdata->ies_offset;
 	else
 		offset = pctl->devdata->smt_offset;
 
+	bit = BIT(offset & pctl->devdata->mode_mask);
+
 	if (value)
 		reg_addr = SET_ADDR(mtk_get_port(pctl, pin) + offset, pctl);
 	else