From mboxrd@z Thu Jan 1 00:00:00 1970 From: Urja Rannikko Date: Fri, 22 Mar 2019 19:14:36 +0000 Subject: [U-Boot] [PATCH 4/4] dw_mmc: turn on the IO supply In-Reply-To: <20190322191436.6268-1-urjaman@gmail.com> References: <20190322191436.6268-1-urjaman@gmail.com> Message-ID: <20190322191436.6268-5-urjaman@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Fixes the microSD slot on the ASUS C201. Signed-off-by: Urja Rannikko --- drivers/mmc/dw_mmc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index 93a836eac3..e1960b213a 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -13,6 +13,7 @@ #include #include #include +#include #define PAGE_SIZE 4096 @@ -440,6 +441,7 @@ static int dwmci_set_ios(struct mmc *mmc) #endif struct dwmci_host *host = (struct dwmci_host *)mmc->priv; u32 ctype, regs; + int ret; debug("Buswidth = %d, clock: %d\n", mmc->bus_width, mmc->clock); @@ -469,6 +471,19 @@ static int dwmci_set_ios(struct mmc *mmc) if (host->clksel) host->clksel(host); +#ifdef CONFIG_DM_REGULATOR + if (mmc->vqmmc_supply) { + if (mmc->signal_voltage == MMC_SIGNAL_VOLTAGE_180) + regulator_set_value(mmc->vqmmc_supply, 1800000); + else + regulator_set_value(mmc->vqmmc_supply, 3300000); + + ret = regulator_set_enable_if_allowed(mmc->vqmmc_supply, true); + if (ret) + return ret; + } +#endif + return 0; } -- 2.21.0