* [U-Boot] [PATCH] mmc: fsl_esdhc: Move ifdef to CONFIG_IS_ENABLED
@ 2019-01-10 21:21 Adam Ford
2019-01-10 22:46 ` Lukasz Majewski
0 siblings, 1 reply; 2+ messages in thread
From: Adam Ford @ 2019-01-10 21:21 UTC (permalink / raw)
To: u-boot
For some boards, DM_REGULATOR and DM_GPIO may not be enabled in
SPL but enabled in U-Boot. So switching to CONFIG_IS_ENABLED from
ifdef allows the esdhc driver to function with some limited
functionality in SPL.
Signed-off-by: Adam Ford <aford173@gmail.com>
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 74007e2ad4..1faae1987a 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -1395,7 +1395,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;
@@ -1436,7 +1436,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
priv->non_removable = 1;
} else {
priv->non_removable = 0;
-#ifdef CONFIG_DM_GPIO
+#if CONFIG_IS_ENABLED(DM_GPIO)
gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio,
GPIOD_IS_IN);
#endif
@@ -1453,7 +1453,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.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] mmc: fsl_esdhc: Move ifdef to CONFIG_IS_ENABLED
2019-01-10 21:21 [U-Boot] [PATCH] mmc: fsl_esdhc: Move ifdef to CONFIG_IS_ENABLED Adam Ford
@ 2019-01-10 22:46 ` Lukasz Majewski
0 siblings, 0 replies; 2+ messages in thread
From: Lukasz Majewski @ 2019-01-10 22:46 UTC (permalink / raw)
To: u-boot
Hi Adam,
> For some boards, DM_REGULATOR and DM_GPIO may not be enabled in
> SPL but enabled in U-Boot. So switching to CONFIG_IS_ENABLED from
> ifdef allows the esdhc driver to function with some limited
> functionality in SPL.
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
>
> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
> index 74007e2ad4..1faae1987a 100644
> --- a/drivers/mmc/fsl_esdhc.c
> +++ b/drivers/mmc/fsl_esdhc.c
> @@ -1395,7 +1395,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;
> @@ -1436,7 +1436,7 @@ static int fsl_esdhc_probe(struct udevice *dev)
> priv->non_removable = 1;
> } else {
> priv->non_removable = 0;
> -#ifdef CONFIG_DM_GPIO
> +#if CONFIG_IS_ENABLED(DM_GPIO)
> gpio_request_by_name(dev, "cd-gpios", 0,
> &priv->cd_gpio, GPIOD_IS_IN);
> #endif
> @@ -1453,7 +1453,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.
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190110/b5576faa/attachment.sig>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-10 22:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-10 21:21 [U-Boot] [PATCH] mmc: fsl_esdhc: Move ifdef to CONFIG_IS_ENABLED Adam Ford
2019-01-10 22:46 ` Lukasz Majewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox