Disrupting the regulator voltage during ios configuration messes with
the MMC initialization sequence. Move the VQMMC regulator enable/disable
functions to the MMC power cycle function, similar to how its done for
the VMMC regulator.
Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
if (mmc->vqmmc_supply) {
int ret;
- ret = regulator_set_enable_if_allowed(mmc->vqmmc_supply, false);
- if (ret)
- return ret;
-
if (mmc->signal_voltage == MMC_SIGNAL_VOLTAGE_180)
ret = regulator_set_value(mmc->vqmmc_supply, 1800000);
else
ret = regulator_set_value(mmc->vqmmc_supply, 3300000);
if (ret && ret != -ENOSYS)
return ret;
-
- ret = regulator_set_enable_if_allowed(mmc->vqmmc_supply, true);
- if (ret)
- return ret;
}
#endif
return ret;
}
}
+
+ if (mmc->vqmmc_supply) {
+ int ret = regulator_set_enable_if_allowed(mmc->vqmmc_supply,
+ true);
+
+ if (ret && ret != -ENOSYS) {
+ printf("Error enabling VQMMC supply : %d\n", ret);
+ return ret;
+ }
+ }
#endif
return 0;
}
return ret;
}
}
+
+ if (mmc->vqmmc_supply) {
+ int ret = regulator_set_enable_if_allowed(mmc->vqmmc_supply,
+ false);
+
+ if (ret && ret != -ENOSYS) {
+ pr_debug("Error disabling VQMMC supply : %d\n", ret);
+ return ret;
+ }
+ }
#endif
return 0;
}