public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Urja Rannikko <urjaman@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] dw_mmc: turn on the IO supply
Date: Mon,  1 Apr 2019 17:44:22 +0000	[thread overview]
Message-ID: <20190401174422.10834-1-urjaman@gmail.com> (raw)
In-Reply-To: <20190322191436.6268-5-urjaman@gmail.com>

Fixes the microSD slot on the ASUS C201.

Signed-off-by: Urja Rannikko <urjaman@gmail.com>
---
v2: use #if CONFIG_IS_ENABLED(DM_REGULATOR)
-
 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..b04c1f9f41 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
 
@@ -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);
 
+#if CONFIG_IS_ENABLED(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

  parent reply	other threads:[~2019-04-01 17:44 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22 19:14 [U-Boot] [PATCH 0/4] Veyron Speedy / ASUS C201 fixes Urja Rannikko
2019-03-22 19:14 ` [U-Boot] [PATCH 1/4] pinctrl: exit pinconfig_post_bind if there are no subnodes Urja Rannikko
2019-03-30 21:18   ` Simon Glass
2019-04-21 18:41   ` [U-Boot] [U-Boot, " Philipp Tomsich
2019-04-23 14:33   ` Philipp Tomsich
2019-03-22 19:14 ` [U-Boot] [PATCH 2/4] rk3288-board: remove pinctrl call for debug uart Urja Rannikko
2019-03-30 21:18   ` Simon Glass
2019-03-31 21:54     ` Urja Rannikko
2019-04-21 18:41   ` [U-Boot] [U-Boot, " Philipp Tomsich
2019-04-23 14:33   ` Philipp Tomsich
2019-03-22 19:14 ` [U-Boot] [PATCH 3/4] rk3288-board: cosmetic: document selecting RK PWM Urja Rannikko
2019-03-30 21:18   ` Simon Glass
2019-03-31 21:46     ` Urja Rannikko
2019-03-22 19:14 ` [U-Boot] [PATCH 4/4] dw_mmc: turn on the IO supply Urja Rannikko
2019-03-29 14:09   ` Heiko Stübner
2019-03-31 19:45     ` Urja Rannikko
2019-04-02  8:25       ` Heiko Stuebner
2019-04-01 17:44   ` Urja Rannikko [this message]
2019-04-11 20:07     ` [U-Boot] [PATCH v2] " Urja Rannikko
2019-05-13 12:25       ` Urja Rannikko
2019-05-13 12:54     ` Heiko Stuebner
2019-05-13 13:25       ` [U-Boot] [PATCH v3] " Urja Rannikko
2019-05-18 16:08         ` Simon Glass
2019-05-20  7:03         ` Peng Fan
2019-07-26  7:06           ` Kever Yang
2019-07-30  0:47             ` Peng Fan
2019-03-29 13:56 ` [U-Boot] [PATCH 0/4] Veyron Speedy / ASUS C201 fixes Heiko Stübner
2019-03-31 19:34   ` Urja Rannikko
2019-03-31 20:44     ` Heiko Stübner
2019-03-31 22:19 ` Urja Rannikko
2019-04-11 20:14 ` Urja Rannikko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190401174422.10834-1-urjaman@gmail.com \
    --to=urjaman@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox