Skip to contentSkip to conversation

mmc: fsl_esdhc: Fix SDR104 and HS200 support

PATCH New Marek Vasut 2 participants 2 messages May 22, 2020 – May 27, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: fsl_esdhc: Fix SDR104 and HS200 support

The 3V3/1V8 switching could never have worked on any of the iMXes ever since 51313b49f2 ("mmc: fsl_esdhc: support SDR104 and HS200"), because that commit uses priv->vqmmc_dev when switching voltages on mode switch, while local vqmmc_dev in probe to store the regulator pointer. Those are two different variables with the same name. So the priv->vqmmc_dev was always NULL and thus voltage switch between modes never really suceeded.

Fix this by assigning priv->vqmmc_dev with value of the vqmmc_dev in probe.

Fixes 51313b49f2 ("mmc: fsl_esdhc: support SDR104 and HS200")
Cc Fabio Estevam <[email protected]>
Cc Jaehoon Chung <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
---
 drivers/mmc/fsl_esdhc_imx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mmc/fsl_esdhc_imx.c +1 -0
index 588d6a9d76..f3101a061a 100644
@@ -1455,6 +1455,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
 	if (ret) {
 		dev_dbg(dev, "no vqmmc-supply\n");
 	} else {
+		priv->vqmmc_dev = vqmmc_dev;
 		ret = regulator_set_enable(vqmmc_dev, true);
 		if (ret) {
 			dev_err(dev, "fail to enable vqmmc-supply\n");
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 mmc: fsl_esdhc: Fix SDR104 and HS200 support

Quoted 11 lines · Marek Vasut

The 3V3/1V8 switching could never have worked on any of the iMXes ever since 51313b49f2 ("mmc: fsl_esdhc: support SDR104 and HS200"), because that commit uses priv->vqmmc_dev when switching voltages on mode switch, while local vqmmc_dev in probe to store the regulator pointer. Those are two different variables with the same name. So the priv->vqmmc_dev was always NULL and thus voltage switch between modes never really suceeded.

Fix this by assigning priv->vqmmc_dev with value of the vqmmc_dev in probe.

Quoted 6 lines
Fixes 51313b49f2 ("mmc: fsl_esdhc: support SDR104 and HS200")
Cc Fabio Estevam <[email protected]>
Cc Jaehoon Chung <[email protected]>
Cc Peng Fan <[email protected]>
Cc Stefano Babic <[email protected]>
Quoted 17 lines
---
 drivers/mmc/fsl_esdhc_imx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/mmc/fsl_esdhc_imx.c +1 -0
index 588d6a9d76..f3101a061a 100644
@@ -1455,6 +1455,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
 	if (ret) {
 		dev_dbg(dev, "no vqmmc-supply\n");
 	} else {
+		priv->vqmmc_dev = vqmmc_dev;
 		ret = regulator_set_enable(vqmmc_dev, true);
 		if (ret) {
 			dev_err(dev, "fail to enable vqmmc-supply\n");