Skip to content

Commit

Permalink
mmc: dw_mmc: Keep vqmmc-supply enable count in balance
Browse files Browse the repository at this point in the history
With the commit 4fcba5d ("regulator: implement basic reference
counter"), keeping regulator enablement in balance become more important.

Disable vqmmc-supply before signal voltage is changed to keep regulator
enable counter in balance.

Signed-off-by: Jonas Karlman <[email protected]>
  • Loading branch information
Kwiboo authored and trini committed Aug 14, 2023
1 parent 9a2e9cc commit 01b2917
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/mmc/dw_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,10 @@ static int dwmci_set_ios(struct mmc *mmc)
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)
regulator_set_value(mmc->vqmmc_supply, 1800000);
else
Expand Down

0 comments on commit 01b2917

Please sign in to comment.