[U-Boot] [PATCH v3] dw_mmc: turn on the IO supply
Simon Glass
sjg at chromium.org
Sat May 18 16:08:21 UTC 2019
On Mon, 13 May 2019 at 07:25, Urja Rannikko <urjaman at gmail.com> wrote:
>
> Fixes the microSD slot on the ASUS C201.
>
> Signed-off-by: Urja Rannikko <urjaman at gmail.com>
> ---
> v2: use #if CONFIG_IS_ENABLED(DM_REGULATOR)
> v3: Move ret variable inside the if block (only used there)
> ---
> drivers/mmc/dw_mmc.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
Reviewed-by: Simon Glass <sjg at chromium.org>
>
> 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)
I wonder if we could use if() here instead?
> + 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;
> }
>
> --
> 2.21.0
>
More information about the U-Boot
mailing list