From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Mon, 25 Sep 2017 18:47:58 +0200 Subject: [U-Boot] [PATCH] mmc: uniphier-sd: Add vqmmc regulator support In-Reply-To: <20170915191054.28337-1-marek.vasut+renesas@gmail.com> References: <20170915191054.28337-1-marek.vasut+renesas@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 09/15/2017 09:10 PM, Marek Vasut wrote: > Add initial support for setting the vqmmc regulator. Since we do not > support 1V8 modes, set the regulator to 3V3 and enable it. > > Signed-off-by: Marek Vasut > Cc: Masahiro Yamada > Cc: Jaehoon Chung Anything ?! I don't see this in the PR ... > --- > drivers/mmc/uniphier-sd.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/drivers/mmc/uniphier-sd.c b/drivers/mmc/uniphier-sd.c > index 3c52161067..0d1203cb76 100644 > --- a/drivers/mmc/uniphier-sd.c > +++ b/drivers/mmc/uniphier-sd.c > @@ -14,6 +14,7 @@ > #include > #include > #include > +#include > #include > > DECLARE_GLOBAL_DATA_PTR; > @@ -756,6 +757,9 @@ static int uniphier_sd_probe(struct udevice *dev) > fdt_addr_t base; > struct clk clk; > int ret; > +#ifdef CONFIG_DM_REGULATOR > + struct udevice *vqmmc_dev; > +#endif > > base = devfdt_get_addr(dev); > if (base == FDT_ADDR_T_NONE) > @@ -765,6 +769,15 @@ static int uniphier_sd_probe(struct udevice *dev) > if (!priv->regbase) > return -ENOMEM; > > +#ifdef CONFIG_DM_REGULATOR > + ret = device_get_supply_regulator(dev, "vqmmc-supply", &vqmmc_dev); > + if (!ret) { > + /* Set the regulator to 3.3V until we support 1.8V modes */ > + regulator_set_value(vqmmc_dev, 3300000); > + regulator_set_enable(vqmmc_dev, true); > + } > +#endif > + > ret = clk_get_by_index(dev, 0, &clk); > if (ret < 0) { > dev_err(dev, "failed to get host clock\n"); > -- Best regards, Marek Vasut