[U-Boot] [PATCH v2 05/22] mmc: fsl_esdhc: Fix DM_REGULATOR ifdefs for SPL builds

Abel Vesa abel.vesa at nxp.com
Wed Jan 30 12:15:52 UTC 2019


On 19-01-29 13:29:04, Peng Fan wrote:
> Hi Abel,
> 
> > -----Original Message-----
> > From: Abel Vesa
> > Sent: 2019年1月29日 19:31
> > To: Tom Rini <trini at konsulko.com>; Fabio Estevam
> > <fabio.estevam at nxp.com>; u-boot at lists.denx.de; dl-uboot-imx
> > <uboot-imx at nxp.com>; Peng Fan <peng.fan at nxp.com>
> > Cc: Nitin Garg <nitin.garg at nxp.com>; Abel Vesa <abel.vesa at nxp.com>
> > Subject: [PATCH v2 05/22] mmc: fsl_esdhc: Fix DM_REGULATOR ifdefs for SPL
> > builds
> > 
> > Since the fsl_esdhc will also be used by SPL, make the preprocessor switches
> > more generic to allow any kind of build.
> > 
> > Signed-off-by: Abel Vesa <abel.vesa at nxp.com>
> > ---
> >  drivers/mmc/fsl_esdhc.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index
> > b8171ba..47f2a8f 100644
> > --- a/drivers/mmc/fsl_esdhc.c
> > +++ b/drivers/mmc/fsl_esdhc.c
> > @@ -804,7 +804,7 @@ static int esdhc_set_voltage(struct mmc *mmc)
> >  	case MMC_SIGNAL_VOLTAGE_330:
> >  		if (priv->vs18_enable)
> >  			return -EIO;
> > -#ifdef CONFIG_DM_REGULATOR
> > +#if CONFIG_IS_ENABLED(DM_REGULATOR)
> 
> If you need SPL DM REGULATOR, this is not enough, you might also need SPL_DM_REGULATOR.
> 

According to the definition:

/*
 * CONFIG_IS_ENABLED(FOO) evaluates to
 *  1 if CONFIG_SPL_BUILD is undefined and CONFIG_FOO is set to 'y' or 'm',
 *  1 if CONFIG_SPL_BUILD is defined and CONFIG_SPL_FOO is set to 'y' or 'm',
 *  0 otherwise.                                                                  
 */
#define CONFIG_IS_ENABLED(option) \
        (config_enabled(CONFIG_VAL(option)) ||          \
         config_enabled(CONFIG_VAL(option##_MODULE))

if the building for SPL and SPL_DM_REGULATOR is enabled, then build in whatever is inside.

What exactly am I missing here ?

> Regards,
> Peng.
> 
> >  		if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
> >  			ret = regulator_set_value(priv->vqmmc_dev, 3300000);
> >  			if (ret) {
> > @@ -823,7 +823,7 @@ static int esdhc_set_voltage(struct mmc *mmc)
> > 
> >  		return -EAGAIN;
> >  	case MMC_SIGNAL_VOLTAGE_180:
> > -#ifdef CONFIG_DM_REGULATOR
> > +#if CONFIG_IS_ENABLED(DM_REGULATOR)
> >  		if (!IS_ERR_OR_NULL(priv->vqmmc_dev)) {
> >  			ret = regulator_set_value(priv->vqmmc_dev, 1800000);
> >  			if (ret) {
> > @@ -1442,7 +1442,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
> >  	int node = dev_of_offset(dev);
> >  	struct esdhc_soc_data *data =
> >  		(struct esdhc_soc_data *)dev_get_driver_data(dev); -#ifdef
> > CONFIG_DM_REGULATOR
> > +#if CONFIG_IS_ENABLED(DM_REGULATOR)
> >  	struct udevice *vqmmc_dev;
> >  #endif
> >  	fdt_addr_t addr;
> > @@ -1500,7 +1500,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
> > 
> >  	priv->vs18_enable = 0;
> > 
> > -#ifdef CONFIG_DM_REGULATOR
> > +#if CONFIG_IS_ENABLED(DM_REGULATOR)
> >  	/*
> >  	 * If emmc I/O has a fixed voltage at 1.8V, this must be provided,
> >  	 * otherwise, emmc will work abnormally.
> > --
> > 2.7.4
> 


More information about the U-Boot mailing list