[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250521112042.266111-1-ziniu.wang_1@nxp.com>
Date: Wed, 21 May 2025 19:20:42 +0800
From: ziniu.wang_1@....com
To: haibo.chen@....com,
adrian.hunter@...el.com,
ulf.hansson@...aro.org,
linux-mmc@...r.kernel.org
Cc: shawnguo@...nel.org,
s.hauer@...gutronix.de,
kernel@...gutronix.de,
festevam@...il.com,
imx@...ts.linux.dev,
s32@....com,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] mmc: sdhci-esdhc-imx: inherit pins_100mhz from pins_200mhz when unconfigured
From: Luke Wang <ziniu.wang_1@....com>
On some new i.MX platforms, hardware guidelines recommend using identical
pin configurations for SDR50/DDR50 (100MHz) and SDR104/HS400 (200MHz)
modes. But defining two identical pinctrl for 100MHz and 200MHz in dts
creates redundancy. In this case, omit explicit 100MHz configuration,
driver will inherit 100MHz pinctrl from 200MHz.
Preserves existing behavior if 100MHz is configured but 200MHz not (e.g,
imx8mp-navq.dts usdhc1 supports SDR50/DDR50 but SDR104/HS400 not).
Signed-off-by: Luke Wang <ziniu.wang_1@....com>
---
drivers/mmc/host/sdhci-esdhc-imx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index f206b562a6e3..dfd8be5000c8 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1810,6 +1810,9 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
ESDHC_PINCTRL_STATE_100MHZ);
imx_data->pins_200mhz = pinctrl_lookup_state(imx_data->pinctrl,
ESDHC_PINCTRL_STATE_200MHZ);
+
+ if (IS_ERR_OR_NULL(imx_data->pins_100mhz))
+ imx_data->pins_100mhz = imx_data->pins_200mhz;
}
/* call to generic mmc_of_parse to support additional capabilities */
--
2.34.1
Powered by blists - more mailing lists