mmc: enable/disable VQMMC regulator only during MMC power cycle

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>
This commit is contained in:
Kaustabh Chakraborty 2025-10-17 20:54:11 +05:30 committed by Peng Fan
parent 0b75109b6a
commit 0f425edd10
2 changed files with 20 additions and 8 deletions

View File

@ -644,20 +644,12 @@ static int dwmci_set_ios(struct mmc *mmc)
if (mmc->vqmmc_supply) { if (mmc->vqmmc_supply) {
int ret; int ret;
ret = regulator_set_enable_if_allowed(mmc->vqmmc_supply, false);
if (ret)
return ret;
if (mmc->signal_voltage == MMC_SIGNAL_VOLTAGE_180) if (mmc->signal_voltage == MMC_SIGNAL_VOLTAGE_180)
ret = regulator_set_value(mmc->vqmmc_supply, 1800000); ret = regulator_set_value(mmc->vqmmc_supply, 1800000);
else else
ret = regulator_set_value(mmc->vqmmc_supply, 3300000); ret = regulator_set_value(mmc->vqmmc_supply, 3300000);
if (ret && ret != -ENOSYS) if (ret && ret != -ENOSYS)
return ret; return ret;
ret = regulator_set_enable_if_allowed(mmc->vqmmc_supply, true);
if (ret)
return ret;
} }
#endif #endif

View File

@ -2844,6 +2844,16 @@ static int mmc_power_on(struct mmc *mmc)
return ret; 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 #endif
return 0; return 0;
} }
@ -2861,6 +2871,16 @@ static int mmc_power_off(struct mmc *mmc)
return ret; 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 #endif
return 0; return 0;
} }