aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2017-09-21 16:29:48 +0200
committerJaehoon Chung <jh80.chung@samsung.com>2018-01-12 18:11:03 +0900
commit06ec045feeea08993834e2f1d2d1e4ec52cdeff1 (patch)
tree46e34df953fa86cdf24b371bb22d08ddda72521a /drivers
parentbb7b4ef3704cfd25e30a36f76342df118ec24a25 (diff)
downloadu-boot-06ec045feeea08993834e2f1d2d1e4ec52cdeff1.zip
u-boot-06ec045feeea08993834e2f1d2d1e4ec52cdeff1.tar.gz
u-boot-06ec045feeea08993834e2f1d2d1e4ec52cdeff1.tar.bz2
mmc: dm: get the IO-line and main voltage regulators from the dts
Get a reference to the regulator devices from the dts and store them in the struct mmc for later use. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/mmc.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 8716ac7..73a4612 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1618,21 +1618,25 @@ __weak void board_mmc_power_init(void)
static int mmc_power_init(struct mmc *mmc)
{
#if CONFIG_IS_ENABLED(DM_MMC)
-#if defined(CONFIG_DM_REGULATOR) && !defined(CONFIG_SPL_BUILD)
- struct udevice *vmmc_supply;
+#if CONFIG_IS_ENABLED(DM_REGULATOR)
int ret;
ret = device_get_supply_regulator(mmc->dev, "vmmc-supply",
- &vmmc_supply);
- if (ret) {
+ &mmc->vmmc_supply);
+ if (ret)
debug("%s: No vmmc supply\n", mmc->dev->name);
- return 0;
- }
- ret = regulator_set_enable(vmmc_supply, true);
- if (ret) {
- puts("Error enabling VMMC supply\n");
- return ret;
+ ret = device_get_supply_regulator(mmc->dev, "vqmmc-supply",
+ &mmc->vqmmc_supply);
+ if (ret)
+ debug("%s: No vqmmc supply\n", mmc->dev->name);
+
+ if (mmc->vmmc_supply) {
+ ret = regulator_set_enable(mmc->vmmc_supply, true);
+ if (ret) {
+ puts("Error enabling VMMC supply\n");
+ return ret;
+ }
}
#endif
#else /* !CONFIG_DM_MMC */