[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210608150656.29007-1-matthias.bgg@kernel.org>
Date: Tue, 8 Jun 2021 17:06:56 +0200
From: matthias.bgg@...nel.org
To: Linus Walleij <linus.walleij@...aro.org>,
Sean Wang <sean.wang@...nel.org>
Cc: linux-gpio@...r.kernel.org, linux-mediatek@...ts.infradead.org,
Matthias Brugger <matthias.bgg@...il.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Matthias Brugger <mbrugger@...e.com>,
Fabien Parent <fparent@...libre.com>,
Mattijs Korpershoek <mkorpershoek@...libre.com>
Subject: [PATCH] pinctrl: mediatek: fix mode encoding
From: Matthias Brugger <mbrugger@...e.com>
Pin modes are encoded in the SoC data structure. Use that value to set
IES SMT.
Cc: Fabien Parent <fparent@...libre.com>
Cc: Sean Wang <sean.wang@...nel.org>
Cc: Mattijs Korpershoek <mkorpershoek@...libre.com>
Cc: linux-mediatek@...ts.infradead.org
Fixes: 696beef77521 ("pinctrl: mediatek: move bit assignment")
Signed-off-by: Matthias Brugger <matthias.bgg@...il.com>
Signed-off-by: Matthias Brugger <mbrugger@...e.com>
---
drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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
--
2.31.1
Powered by blists - more mailing lists