Skip to contentSkip to conversation

pinctrl: mediatek: fix mode encoding

PATCH In review [email protected] 2 participants 2 messages Jun 8, 2021 – Jun 9, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: mediatek: fix mode encoding

From: Matthias Brugger <[email protected]>

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

Cc Fabien Parent <[email protected]>
Cc Sean Wang <[email protected]>
Cc Mattijs Korpershoek <[email protected]>
Fixes 696beef77521 ("pinctrl: mediatek: move bit assignment")

---

 drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/mediatek/pinctrl-mtk-common.c +2 -2
index 525b1aa7f7a6..5f7c421ab6e7 100644
@@ -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
Signature · 1 line
2.31.1
#1 lore raw
Quoted 5 lines · On Tue, Jun 8, 2021 at 5:07 PM <[email protected]> wrote:

From: Matthias Brugger <[email protected]>

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

Quoted 7 lines
Cc Fabien Parent <[email protected]>
Cc Sean Wang <[email protected]>
Cc Mattijs Korpershoek <[email protected]>
Fixes 696beef77521 ("pinctrl: mediatek: move bit assignment")

Patch applied!

Yours,
Linus Walleij