diff mbox series

mmc: sdhci-msm: Slot indexing for distinguishing multiple SDCC instances

Message ID 20241022141828.618-1-quic_sachgupt@quicinc.com (mailing list archive)
State New
Headers show
Series mmc: sdhci-msm: Slot indexing for distinguishing multiple SDCC instances | expand

Commit Message

Sachin Gupta Oct. 22, 2024, 2:18 p.m. UTC
This update addresses the requirement for accurate slot indexing
in the sdhci-msm driver to differentiate between multiple SDCC
(Secure Digital Card Controller) instances, such as eMMC, SD card,
and SDIO.

Additionally, it revises the slot indexing logic to comply with
the new device tree (DT) specifications.

Signed-off-by: Ram Prakash Gupta <quic_rampraka@quicinc.com>
Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com>
Signed-off-by: Maramaina Naresh <quic_mnaresh@quicinc.com>
Signed-off-by: Ziqi Chen <quic_ziqichen@quicinc.com>
Signed-off-by: Sachin Gupta <quic_sachgupt@quicinc.com>
---
 drivers/mmc/host/sdhci-msm.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index e113b99a3eab..3cb79117916f 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -292,6 +292,8 @@  struct sdhci_msm_host {
 	bool vqmmc_enabled;
 };
 
+static struct sdhci_msm_host *sdhci_slot[3];
+
 static const struct sdhci_msm_offset *sdhci_priv_msm_offset(struct sdhci_host *host)
 {
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
@@ -2426,6 +2428,14 @@  static int sdhci_msm_probe(struct platform_device *pdev)
 	if (ret)
 		goto pltfm_free;
 
+	if (node) {
+		ret = of_alias_get_id(pdev->dev.of_node, "mmc");
+		if (ret < 0)
+			dev_err(&pdev->dev, "get slot index failed %d\n", ret);
+		else
+			sdhci_slot[ret] = msm_host;
+	}
+
 	/*
 	 * Based on the compatible string, load the required msm host info from
 	 * the data associated with the version info.