summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrja Rannikko <urjaman@gmail.com>2019-05-13 13:25:27 +0000
committerKever Yang <kever.yang@rock-chips.com>2019-07-31 09:07:30 +0800
commit2b157019bb4c11303497f58b659f08f5ef9d064a (patch)
tree4f8ef79ff1c532ce2e462bcf7bbf56ac12dee6ae
parentd0d07ba86afc8074d79e436b1ba4478fa0f0c1b5 (diff)
dw_mmc: turn on the IO supply
Fixes the microSD slot on the ASUS C201. Signed-off-by: Urja Rannikko <urjaman@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com<mailto:peng.fan@nxp.com>>
-rw-r--r--drivers/mmc/dw_mmc.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
index 1992d61182..22f6c7eefd 100644
--- a/drivers/mmc/dw_mmc.c
+++ b/drivers/mmc/dw_mmc.c
@@ -13,6 +13,7 @@
#include <mmc.h>
#include <dwmmc.h>
#include <wait_bit.h>
+#include <power/regulator.h>
#define PAGE_SIZE 4096
@@ -493,6 +494,21 @@ static int dwmci_set_ios(struct mmc *mmc)
if (host->clksel)
host->clksel(host);
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
+ if (mmc->vqmmc_supply) {
+ int ret;
+
+ 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;
}