[PATCH 08/12] pinctrl: airoha: an7583: fix eMMC pin mux config

From: Zhengping Zhang

Date: Tue Nov 10 2026 - 05:00:11 EST


From: Robert Marko <robert.marko@xxxxxxxxxx>

The AN7583 eMMC group includes three pads shared with the first SPI
bus: pinctrl pins 45-47, corresponding to GPIO43-45. Their GPIO
operation is selected by bits 19-21 of REG_GPIO_PON_MODE.

The eMMC mux configuration only enables GPIO_EMMC_MODE_MASK, leaving
these pads in GPIO mode if their overrides were enabled by the
bootloader.

Clear the GPIO mode bits for these three pads when selecting eMMC.
Preserve bit 22, which controls the SPI MISO/GPIO46 pad outside the
eMMC group.

Signed-off-by: Robert Marko <robert.marko@xxxxxxxxxx>
Signed-off-by: Zhengping Zhang <zhengping.zhang@xxxxxxxxxx>
---
drivers/pinctrl/airoha/pinctrl-an7583.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/airoha/pinctrl-an7583.c b/drivers/pinctrl/airoha/pinctrl-an7583.c
index 986f10c9f1786..74628a03ca909 100644
--- a/drivers/pinctrl/airoha/pinctrl-an7583.c
+++ b/drivers/pinctrl/airoha/pinctrl-an7583.c
@@ -44,6 +44,7 @@
#define UART_RXD_GPIO_MODE_MASK BIT(24)
#define UART_TXD_GPIO_MODE_MASK BIT(23)
#define SPI_GPIO_MODE_MASK GENMASK(22, 19)
+#define EMMC_GPIO_MODE_MASK GENMASK(21, 19)
#define SPI_MISO_GPIO_MODE_MASK BIT(22)
#define SPI_MOSI_GPIO_MODE_MASK BIT(21)
#define SPI_CS_GPIO_MODE_MASK BIT(20)
@@ -991,7 +992,7 @@ static const struct airoha_pinctrl_func_group emmc_func_group[] = {
.regmap[0] = {
AIROHA_FUNC_MUX,
REG_GPIO_PON_MODE,
- GPIO_EMMC_MODE_MASK,
+ GPIO_EMMC_MODE_MASK | EMMC_GPIO_MODE_MASK,
GPIO_EMMC_MODE_MASK
},
.regmap_size = 1,
--
2.43.0