From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Tue, 16 Jan 2018 18:13:24 +0100 Subject: [U-Boot] [PATCH 2/7] mmc: uniphier-sd: Properly handle pin voltage configuration In-Reply-To: References: <20180106192954.17753-1-marek.vasut+renesas@gmail.com> <20180106192954.17753-2-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 01/12/2018 10:15 AM, Jaehoon Chung wrote: > On 01/07/2018 04:29 AM, Marek Vasut wrote: >> Factor out the regulator handling into set_ios and add support for >> selecting pin configuration based on the voltage to support UHS modes. >> >> Signed-off-by: Marek Vasut >> Cc: Jaehoon Chung >> Cc: Masahiro Yamada >> --- >> drivers/mmc/uniphier-sd.c | 33 ++++++++++++++++++++++++--------- >> 1 file changed, 24 insertions(+), 9 deletions(-) >> >> diff --git a/drivers/mmc/uniphier-sd.c b/drivers/mmc/uniphier-sd.c >> index 552e37d852..ebcc12a8ae 100644 >> --- a/drivers/mmc/uniphier-sd.c >> +++ b/drivers/mmc/uniphier-sd.c >> @@ -10,6 +10,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -134,6 +135,9 @@ struct uniphier_sd_priv { >> #define UNIPHIER_SD_CAP_DMA_INTERNAL BIT(1) /* have internal DMA engine */ >> #define UNIPHIER_SD_CAP_DIV1024 BIT(2) /* divisor 1024 is available */ >> #define UNIPHIER_SD_CAP_64BIT BIT(3) /* Controller is 64bit */ >> +#ifdef CONFIG_DM_REGULATOR >> + struct udevice *vqmmc_dev; >> +#endif >> }; >> >> static u64 uniphier_sd_readq(struct uniphier_sd_priv *priv, unsigned int reg) >> @@ -676,6 +680,24 @@ static void uniphier_sd_set_clk_rate(struct uniphier_sd_priv *priv, >> udelay(1000); >> } >> >> +static void uniphier_sd_set_pins(struct udevice *dev) >> +{ >> + struct uniphier_sd_priv *priv = dev_get_priv(dev); >> + struct mmc *mmc = mmc_get_mmc_dev(dev); >> + >> + if (priv->vqmmc_dev) { > > You added #ifdef CONFIG_DM_REGULATOR in struct uniphier_sd_priv. > If CONFIG_DM_REGULATOR is disabled, it can't refer the vqmmc_dev.? Oh, thanks. V2 is coming. -- Best regards, Marek Vasut