diff mbox

[U-Boot,1/4] mmc: fsl_esdhc: make GPIO support optional

Message ID 1481082873-36322-1-git-send-email-yangbo.lu@nxp.com
State Accepted
Commit fc8048a88e7b5467a77512bf31e5225c0e5a2a0b
Delegated to: York Sun
Headers show

Commit Message

Yangbo Lu Dec. 7, 2016, 3:54 a.m. UTC
There would be compiling error as below when enable driver model for esdhc.
undefined reference to `dm_gpio_get_value'
undefined reference to `gpio_request_by_name_nodev'
This patch is to make GPIO support optional with CONFIG_DM_GPIO. Because
all boards of QorIQ platform don't need it and they just check register for
CD/WP status, only some boards of i.MX platform require this.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
 drivers/mmc/fsl_esdhc.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

York Sun Jan. 4, 2017, 7:52 p.m. UTC | #1
On 12/06/2016 08:08 PM, Yangbo Lu wrote:
> There would be compiling error as below when enable driver model for esdhc.
> undefined reference to `dm_gpio_get_value'
> undefined reference to `gpio_request_by_name_nodev'
> This patch is to make GPIO support optional with CONFIG_DM_GPIO. Because
> all boards of QorIQ platform don't need it and they just check register for
> CD/WP status, only some boards of i.MX platform require this.
>
> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> ---
>  drivers/mmc/fsl_esdhc.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
> index 9796d39..da3a151 100644
> --- a/drivers/mmc/fsl_esdhc.c
> +++ b/drivers/mmc/fsl_esdhc.c
> @@ -104,8 +104,10 @@ struct fsl_esdhc_priv {
>  	struct udevice *dev;
>  	int non_removable;
>  	int wp_enable;
> +#ifdef CONFIG_DM_GPIO
>  	struct gpio_desc cd_gpio;
>  	struct gpio_desc wp_gpio;
> +#endif
>  };
>
>  /* Return the XFERTYP flags for a given command and data packet */
> @@ -687,10 +689,11 @@ static int esdhc_getcd(struct mmc *mmc)
>  #ifdef CONFIG_DM_MMC
>  	if (priv->non_removable)
>  		return 1;
> -
> +#ifdef CONFIG_DM_GPIO
>  	if (dm_gpio_is_valid(&priv->cd_gpio))
>  		return dm_gpio_get_value(&priv->cd_gpio);
>  #endif
> +#endif
>
>  	while (!(esdhc_read32(&regs->prsstat) & PRSSTAT_CINS) && --timeout)
>  		udelay(1000);
> @@ -967,17 +970,20 @@ static int fsl_esdhc_probe(struct udevice *dev)
>  		priv->non_removable = 1;
>  	 } else {
>  		priv->non_removable = 0;
> +#ifdef CONFIG_DM_GPIO
>  		gpio_request_by_name_nodev(fdt, node, "cd-gpios", 0,
>  					   &priv->cd_gpio, GPIOD_IS_IN);
> +#endif
>  	}
>
>  	priv->wp_enable = 1;
>
> +#ifdef CONFIG_DM_GPIO
>  	ret = gpio_request_by_name_nodev(fdt, node, "wp-gpios", 0,
>  					 &priv->wp_gpio, GPIOD_IS_IN);
>  	if (ret)
>  		priv->wp_enable = 0;
> -
> +#endif
>  	/*
>  	 * TODO:
>  	 * Because lack of clk driver, if SDHC clk is not enabled,
>

Jaehoon,

This set looks OK to me. Please review and comment. I can merge it with 
your ack.

Yangbo,

For MMC or SD patches, please CC Jaehoon.

York
Jaehoon Chung Jan. 5, 2017, 12:33 a.m. UTC | #2
Hi, 

On 01/05/2017 04:52 AM, york sun wrote:
> On 12/06/2016 08:08 PM, Yangbo Lu wrote:
>> There would be compiling error as below when enable driver model for esdhc.
>> undefined reference to `dm_gpio_get_value'
>> undefined reference to `gpio_request_by_name_nodev'
>> This patch is to make GPIO support optional with CONFIG_DM_GPIO. Because
>> all boards of QorIQ platform don't need it and they just check register for
>> CD/WP status, only some boards of i.MX platform require this.
>>
>> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
>> ---
>>  drivers/mmc/fsl_esdhc.c | 10 ++++++++--
>>  1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
>> index 9796d39..da3a151 100644
>> --- a/drivers/mmc/fsl_esdhc.c
>> +++ b/drivers/mmc/fsl_esdhc.c
>> @@ -104,8 +104,10 @@ struct fsl_esdhc_priv {
>>  	struct udevice *dev;
>>  	int non_removable;
>>  	int wp_enable;
>> +#ifdef CONFIG_DM_GPIO
>>  	struct gpio_desc cd_gpio;
>>  	struct gpio_desc wp_gpio;
>> +#endif
>>  };
>>
>>  /* Return the XFERTYP flags for a given command and data packet */
>> @@ -687,10 +689,11 @@ static int esdhc_getcd(struct mmc *mmc)
>>  #ifdef CONFIG_DM_MMC
>>  	if (priv->non_removable)
>>  		return 1;
>> -
>> +#ifdef CONFIG_DM_GPIO
>>  	if (dm_gpio_is_valid(&priv->cd_gpio))
>>  		return dm_gpio_get_value(&priv->cd_gpio);
>>  #endif
>> +#endif
>>
>>  	while (!(esdhc_read32(&regs->prsstat) & PRSSTAT_CINS) && --timeout)
>>  		udelay(1000);
>> @@ -967,17 +970,20 @@ static int fsl_esdhc_probe(struct udevice *dev)
>>  		priv->non_removable = 1;
>>  	 } else {
>>  		priv->non_removable = 0;
>> +#ifdef CONFIG_DM_GPIO
>>  		gpio_request_by_name_nodev(fdt, node, "cd-gpios", 0,
>>  					   &priv->cd_gpio, GPIOD_IS_IN);
>> +#endif
>>  	}
>>
>>  	priv->wp_enable = 1;
>>
>> +#ifdef CONFIG_DM_GPIO
>>  	ret = gpio_request_by_name_nodev(fdt, node, "wp-gpios", 0,
>>  					 &priv->wp_gpio, GPIOD_IS_IN);
>>  	if (ret)
>>  		priv->wp_enable = 0;
>> -
>> +#endif
>>  	/*
>>  	 * TODO:
>>  	 * Because lack of clk driver, if SDHC clk is not enabled,
>>
> 
> Jaehoon,
> 
> This set looks OK to me. Please review and comment. I can merge it with 
> your ack.

Sorry for late. I missed this patch. It looks good to me.

Acked-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> 
> Yangbo,
> 
> For MMC or SD patches, please CC Jaehoon.
> 
> York
> 
> 
>
Yangbo Lu Jan. 5, 2017, 6:14 a.m. UTC | #3
> -----Original Message-----
> From: york sun
> Sent: Thursday, January 05, 2017 3:52 AM
> To: Y.B. Lu
> Cc: u-boot@lists.denx.de; Jaehoon Chung
> Subject: Re: [PATCH 1/4] mmc: fsl_esdhc: make GPIO support optional
> 
> On 12/06/2016 08:08 PM, Yangbo Lu wrote:
> > There would be compiling error as below when enable driver model for
> esdhc.
> > undefined reference to `dm_gpio_get_value'
> > undefined reference to `gpio_request_by_name_nodev'
> > This patch is to make GPIO support optional with CONFIG_DM_GPIO.
> > Because all boards of QorIQ platform don't need it and they just check
> > register for CD/WP status, only some boards of i.MX platform require
> this.
> >
> > Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> > ---
> >  drivers/mmc/fsl_esdhc.c | 10 ++++++++--
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index
> > 9796d39..da3a151 100644
> > --- a/drivers/mmc/fsl_esdhc.c
> > +++ b/drivers/mmc/fsl_esdhc.c
> > @@ -104,8 +104,10 @@ struct fsl_esdhc_priv {
> >  	struct udevice *dev;
> >  	int non_removable;
> >  	int wp_enable;
> > +#ifdef CONFIG_DM_GPIO
> >  	struct gpio_desc cd_gpio;
> >  	struct gpio_desc wp_gpio;
> > +#endif
> >  };
> >
> >  /* Return the XFERTYP flags for a given command and data packet */ @@
> > -687,10 +689,11 @@ static int esdhc_getcd(struct mmc *mmc)  #ifdef
> > CONFIG_DM_MMC
> >  	if (priv->non_removable)
> >  		return 1;
> > -
> > +#ifdef CONFIG_DM_GPIO
> >  	if (dm_gpio_is_valid(&priv->cd_gpio))
> >  		return dm_gpio_get_value(&priv->cd_gpio);
> >  #endif
> > +#endif
> >
> >  	while (!(esdhc_read32(&regs->prsstat) & PRSSTAT_CINS) && --timeout)
> >  		udelay(1000);
> > @@ -967,17 +970,20 @@ static int fsl_esdhc_probe(struct udevice *dev)
> >  		priv->non_removable = 1;
> >  	 } else {
> >  		priv->non_removable = 0;
> > +#ifdef CONFIG_DM_GPIO
> >  		gpio_request_by_name_nodev(fdt, node, "cd-gpios", 0,
> >  					   &priv->cd_gpio, GPIOD_IS_IN);
> > +#endif
> >  	}
> >
> >  	priv->wp_enable = 1;
> >
> > +#ifdef CONFIG_DM_GPIO
> >  	ret = gpio_request_by_name_nodev(fdt, node, "wp-gpios", 0,
> >  					 &priv->wp_gpio, GPIOD_IS_IN);
> >  	if (ret)
> >  		priv->wp_enable = 0;
> > -
> > +#endif
> >  	/*
> >  	 * TODO:
> >  	 * Because lack of clk driver, if SDHC clk is not enabled,
> >
> 
> Jaehoon,
> 
> This set looks OK to me. Please review and comment. I can merge it with
> your ack.
> 
> Yangbo,
> 
> For MMC or SD patches, please CC Jaehoon.

[Lu Yangbo-B47093] Ok, York. And sorry for that.

> 
> York
Yangbo Lu Jan. 5, 2017, 6:17 a.m. UTC | #4
> -----Original Message-----
> From: Jaehoon Chung [mailto:jh80.chung@samsung.com]
> Sent: Thursday, January 05, 2017 8:33 AM
> To: york sun; Y.B. Lu
> Cc: u-boot@lists.denx.de
> Subject: Re: [PATCH 1/4] mmc: fsl_esdhc: make GPIO support optional
> 
> Hi,
> 
> On 01/05/2017 04:52 AM, york sun wrote:
> > On 12/06/2016 08:08 PM, Yangbo Lu wrote:
> >> There would be compiling error as below when enable driver model for
> esdhc.
> >> undefined reference to `dm_gpio_get_value'
> >> undefined reference to `gpio_request_by_name_nodev'
> >> This patch is to make GPIO support optional with CONFIG_DM_GPIO.
> >> Because all boards of QorIQ platform don't need it and they just
> >> check register for CD/WP status, only some boards of i.MX platform
> require this.
> >>
> >> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> >> ---
> >>  drivers/mmc/fsl_esdhc.c | 10 ++++++++--
> >>  1 file changed, 8 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index
> >> 9796d39..da3a151 100644
> >> --- a/drivers/mmc/fsl_esdhc.c
> >> +++ b/drivers/mmc/fsl_esdhc.c
> >> @@ -104,8 +104,10 @@ struct fsl_esdhc_priv {
> >>  	struct udevice *dev;
> >>  	int non_removable;
> >>  	int wp_enable;
> >> +#ifdef CONFIG_DM_GPIO
> >>  	struct gpio_desc cd_gpio;
> >>  	struct gpio_desc wp_gpio;
> >> +#endif
> >>  };
> >>
> >>  /* Return the XFERTYP flags for a given command and data packet */
> >> @@ -687,10 +689,11 @@ static int esdhc_getcd(struct mmc *mmc)  #ifdef
> >> CONFIG_DM_MMC
> >>  	if (priv->non_removable)
> >>  		return 1;
> >> -
> >> +#ifdef CONFIG_DM_GPIO
> >>  	if (dm_gpio_is_valid(&priv->cd_gpio))
> >>  		return dm_gpio_get_value(&priv->cd_gpio);
> >>  #endif
> >> +#endif
> >>
> >>  	while (!(esdhc_read32(&regs->prsstat) & PRSSTAT_CINS) && --timeout)
> >>  		udelay(1000);
> >> @@ -967,17 +970,20 @@ static int fsl_esdhc_probe(struct udevice *dev)
> >>  		priv->non_removable = 1;
> >>  	 } else {
> >>  		priv->non_removable = 0;
> >> +#ifdef CONFIG_DM_GPIO
> >>  		gpio_request_by_name_nodev(fdt, node, "cd-gpios", 0,
> >>  					   &priv->cd_gpio, GPIOD_IS_IN);
> >> +#endif
> >>  	}
> >>
> >>  	priv->wp_enable = 1;
> >>
> >> +#ifdef CONFIG_DM_GPIO
> >>  	ret = gpio_request_by_name_nodev(fdt, node, "wp-gpios", 0,
> >>  					 &priv->wp_gpio, GPIOD_IS_IN);
> >>  	if (ret)
> >>  		priv->wp_enable = 0;
> >> -
> >> +#endif
> >>  	/*
> >>  	 * TODO:
> >>  	 * Because lack of clk driver, if SDHC clk is not enabled,
> >>
> >
> > Jaehoon,
> >
> > This set looks OK to me. Please review and comment. I can merge it
> > with your ack.
> 
> Sorry for late. I missed this patch. It looks good to me.
> 
> Acked-by: Jaehoon Chung <jh80.chung@samsung.com>

[Lu Yangbo-B47093] Thanks a lot for your reviewing, Jaehoon :)
> 
> Best Regards,
> Jaehoon Chung
> 
> >
> > Yangbo,
> >
> > For MMC or SD patches, please CC Jaehoon.
> >
> > York
> >
> >
> >
Yangbo Lu Jan. 12, 2017, 1:39 a.m. UTC | #5
Hi York,

Could you help to merge this patchset if there is no any changes needed?
Thanks :)

Best regards,
Yangbo Lu

> -----Original Message-----
> From: Jaehoon Chung [mailto:jh80.chung@samsung.com]
> Sent: Thursday, January 05, 2017 8:33 AM
> To: york sun; Y.B. Lu
> Cc: u-boot@lists.denx.de
> Subject: Re: [PATCH 1/4] mmc: fsl_esdhc: make GPIO support optional
> 
> Hi,
> 
> On 01/05/2017 04:52 AM, york sun wrote:
> > On 12/06/2016 08:08 PM, Yangbo Lu wrote:
> >> There would be compiling error as below when enable driver model for
> esdhc.
> >> undefined reference to `dm_gpio_get_value'
> >> undefined reference to `gpio_request_by_name_nodev'
> >> This patch is to make GPIO support optional with CONFIG_DM_GPIO.
> >> Because all boards of QorIQ platform don't need it and they just
> >> check register for CD/WP status, only some boards of i.MX platform
> require this.
> >>
> >> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> >> ---
> >>  drivers/mmc/fsl_esdhc.c | 10 ++++++++--
> >>  1 file changed, 8 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index
> >> 9796d39..da3a151 100644
> >> --- a/drivers/mmc/fsl_esdhc.c
> >> +++ b/drivers/mmc/fsl_esdhc.c
> >> @@ -104,8 +104,10 @@ struct fsl_esdhc_priv {
> >>  	struct udevice *dev;
> >>  	int non_removable;
> >>  	int wp_enable;
> >> +#ifdef CONFIG_DM_GPIO
> >>  	struct gpio_desc cd_gpio;
> >>  	struct gpio_desc wp_gpio;
> >> +#endif
> >>  };
> >>
> >>  /* Return the XFERTYP flags for a given command and data packet */
> >> @@ -687,10 +689,11 @@ static int esdhc_getcd(struct mmc *mmc)  #ifdef
> >> CONFIG_DM_MMC
> >>  	if (priv->non_removable)
> >>  		return 1;
> >> -
> >> +#ifdef CONFIG_DM_GPIO
> >>  	if (dm_gpio_is_valid(&priv->cd_gpio))
> >>  		return dm_gpio_get_value(&priv->cd_gpio);
> >>  #endif
> >> +#endif
> >>
> >>  	while (!(esdhc_read32(&regs->prsstat) & PRSSTAT_CINS) && --timeout)
> >>  		udelay(1000);
> >> @@ -967,17 +970,20 @@ static int fsl_esdhc_probe(struct udevice *dev)
> >>  		priv->non_removable = 1;
> >>  	 } else {
> >>  		priv->non_removable = 0;
> >> +#ifdef CONFIG_DM_GPIO
> >>  		gpio_request_by_name_nodev(fdt, node, "cd-gpios", 0,
> >>  					   &priv->cd_gpio, GPIOD_IS_IN);
> >> +#endif
> >>  	}
> >>
> >>  	priv->wp_enable = 1;
> >>
> >> +#ifdef CONFIG_DM_GPIO
> >>  	ret = gpio_request_by_name_nodev(fdt, node, "wp-gpios", 0,
> >>  					 &priv->wp_gpio, GPIOD_IS_IN);
> >>  	if (ret)
> >>  		priv->wp_enable = 0;
> >> -
> >> +#endif
> >>  	/*
> >>  	 * TODO:
> >>  	 * Because lack of clk driver, if SDHC clk is not enabled,
> >>
> >
> > Jaehoon,
> >
> > This set looks OK to me. Please review and comment. I can merge it
> > with your ack.
> 
> Sorry for late. I missed this patch. It looks good to me.
> 
> Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
> 
> Best Regards,
> Jaehoon Chung
> 
> >
> > Yangbo,
> >
> > For MMC or SD patches, please CC Jaehoon.
> >
> > York
> >
> >
> >
York Sun Jan. 13, 2017, 5:11 p.m. UTC | #6
On 01/11/2017 05:39 PM, Y.B. Lu wrote:
> Hi York,
>
> Could you help to merge this patchset if there is no any changes needed?
> Thanks :)
>

It's in my queue.

York
York Sun Jan. 19, 2017, 5:35 p.m. UTC | #7
On 12/06/2016 08:08 PM, Yangbo Lu wrote:
> There would be compiling error as below when enable driver model for esdhc.
> undefined reference to `dm_gpio_get_value'
> undefined reference to `gpio_request_by_name_nodev'
> This patch is to make GPIO support optional with CONFIG_DM_GPIO. Because
> all boards of QorIQ platform don't need it and they just check register for
> CD/WP status, only some boards of i.MX platform require this.
>
> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> ---

This set is applied to fsl-qoriq master, awaiting upstream. Thanks.

York
diff mbox

Patch

diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
index 9796d39..da3a151 100644
--- a/drivers/mmc/fsl_esdhc.c
+++ b/drivers/mmc/fsl_esdhc.c
@@ -104,8 +104,10 @@  struct fsl_esdhc_priv {
 	struct udevice *dev;
 	int non_removable;
 	int wp_enable;
+#ifdef CONFIG_DM_GPIO
 	struct gpio_desc cd_gpio;
 	struct gpio_desc wp_gpio;
+#endif
 };
 
 /* Return the XFERTYP flags for a given command and data packet */
@@ -687,10 +689,11 @@  static int esdhc_getcd(struct mmc *mmc)
 #ifdef CONFIG_DM_MMC
 	if (priv->non_removable)
 		return 1;
-
+#ifdef CONFIG_DM_GPIO
 	if (dm_gpio_is_valid(&priv->cd_gpio))
 		return dm_gpio_get_value(&priv->cd_gpio);
 #endif
+#endif
 
 	while (!(esdhc_read32(&regs->prsstat) & PRSSTAT_CINS) && --timeout)
 		udelay(1000);
@@ -967,17 +970,20 @@  static int fsl_esdhc_probe(struct udevice *dev)
 		priv->non_removable = 1;
 	 } else {
 		priv->non_removable = 0;
+#ifdef CONFIG_DM_GPIO
 		gpio_request_by_name_nodev(fdt, node, "cd-gpios", 0,
 					   &priv->cd_gpio, GPIOD_IS_IN);
+#endif
 	}
 
 	priv->wp_enable = 1;
 
+#ifdef CONFIG_DM_GPIO
 	ret = gpio_request_by_name_nodev(fdt, node, "wp-gpios", 0,
 					 &priv->wp_gpio, GPIOD_IS_IN);
 	if (ret)
 		priv->wp_enable = 0;
-
+#endif
 	/*
 	 * TODO:
 	 * Because lack of clk driver, if SDHC clk is not enabled,