From 585dcf2413f4c50a0554c0bbf4aaaad7f692ef6e Mon Sep 17 00:00:00 2001 From: Shawn Lin Date: Thu, 19 Aug 2021 09:09:15 +0800 Subject: [PATCH] mmc: dw_mmc: Set vqmmc to 3v3 before disabling it Disabling vqmmc without setting IO domain could cause SoC damage found in some Rockchip platforms. To cope with the fix from IO domain, add this patch Signed-off-by: Shawn Lin Change-Id: I05c53e78c073737cd0f7af9a206b9f588ffa4636 --- drivers/mmc/host/dw_mmc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index bbd85c451a6c..8412afeaa0cc 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1554,8 +1554,11 @@ static void dw_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) if (!IS_ERR(mmc->supply.vmmc)) mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); - if (!IS_ERR(mmc->supply.vqmmc) && slot->host->vqmmc_enabled) + if (!IS_ERR(mmc->supply.vqmmc) && slot->host->vqmmc_enabled) { + ios->signal_voltage = MMC_SIGNAL_VOLTAGE_330; + mmc_regulator_set_vqmmc(mmc, ios); regulator_disable(mmc->supply.vqmmc); + } slot->host->vqmmc_enabled = false; regs = mci_readl(slot->host, PWREN);