[PATCH 1/7] mmc: sdhci-of-k1: no pinctrl state switching

Yixun Lan dlan at kernel.org
Wed Sep 2 01:04:22 PDT 2026


From: Long Wan <long.wan at linux.spacemit.com>

No need to switch pinctrl state if the SDHCI controller only support 1.8v
IO voltage which DT will only provide a "default" pinctrl state, otherwise
function pinctrl_select_state() will trigger a NULL pointer error.

Fixes: 00a97fc57c09 ("mmc: sdhci-of-k1: add regulator and pinctrl voltage switching support")
Signed-off-by: Long Wan <long.wan at linux.spacemit.com>
Signed-off-by: Yixun Lan <dlan at kernel.org>
---
 drivers/mmc/host/sdhci-of-k1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-of-k1.c b/drivers/mmc/host/sdhci-of-k1.c
index 37b0911e7cf2..0916340d3265 100644
--- a/drivers/mmc/host/sdhci-of-k1.c
+++ b/drivers/mmc/host/sdhci-of-k1.c
@@ -407,7 +407,8 @@ static int spacemit_sdhci_start_signal_voltage_switch(struct mmc_host *mmc,
 	if (ret)
 		return ret;
 
-	if (!sdhst->pinctrl)
+	/* No pinctrl or no "uhs" state */
+	if (!sdhst->pinctrl || !sdhst->pinctrl_uhs)
 		return 0;
 
 	/* Select appropriate pinctrl state based on signal voltage */

-- 
2.55.0




More information about the linux-riscv mailing list