linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 4/4] MXS-MMC: Add wp-inverted property
       [not found] ` <1337562140-5739-4-git-send-email-marex@denx.de>
@ 2012-05-21  1:39   ` Shawn Guo
  2012-05-21  2:38     ` Marek Vasut
  0 siblings, 1 reply; 8+ messages in thread
From: Shawn Guo @ 2012-05-21  1:39 UTC (permalink / raw)
  To: Marek Vasut; +Cc: linux-arm-kernel, Fabio Estevam, Chris Ball, linux-mmc

Copy Chris and linux-mmc, as I assume that the patch should go via mmc
tree after the merge window.

On Mon, May 21, 2012 at 03:02:20AM +0200, Marek Vasut wrote:
> The write-protect GPIO is inverted on some boards. Handle such case.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>

Acked-by: Shawn Guo <shawn.guo@linaro.org>

A coupe of nits though:

The subject prefix can better be "mmc: mxs-mmc: ".

> ---
>  Documentation/devicetree/bindings/mmc/mxs-mmc.txt |    1 +
>  drivers/mmc/host/mxs-mmc.c                        |   11 ++++++++++-
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> index 14d870a..0a7d2cd 100644
> --- a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> @@ -13,6 +13,7 @@ Required properties:
>  
>  Optional properties:
>  - wp-gpios: Specify GPIOs for write protection
> +- wp-inverted: Set if the write protection GPIO is inverted
>  
>  Examples:
>  
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 277161d..119beb9 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -164,16 +164,23 @@ struct mxs_mmc_host {
>  	spinlock_t			lock;
>  	int				sdio_irq_en;
>  	int				wp_gpio;
> +	int				wp_inverted:1;
>  };
>  
>  static int mxs_mmc_get_ro(struct mmc_host *mmc)
>  {
>  	struct mxs_mmc_host *host = mmc_priv(mmc);
> +	int ret;
>  
>  	if (!gpio_is_valid(host->wp_gpio))
>  		return -EINVAL;
>  
> -	return gpio_get_value(host->wp_gpio);
> +	ret = gpio_get_value(host->wp_gpio);
> +
> +	if (host->wp_inverted)
> +		ret = !ret;
> +
> +	return ret;

The above lines can just be the one below?

	return (host->wp_inverted) ? !ret : ret;

>  }

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/4] MXS-MMC: Add wp-inverted property
  2012-05-21  1:39   ` [PATCH 4/4] MXS-MMC: Add wp-inverted property Shawn Guo
@ 2012-05-21  2:38     ` Marek Vasut
  2012-05-21  2:48       ` Shawn Guo
  0 siblings, 1 reply; 8+ messages in thread
From: Marek Vasut @ 2012-05-21  2:38 UTC (permalink / raw)
  To: Shawn Guo; +Cc: linux-arm-kernel, Fabio Estevam, Chris Ball, linux-mmc

Dear Shawn Guo,

> Copy Chris and linux-mmc, as I assume that the patch should go via mmc
> tree after the merge window.
> 
> On Mon, May 21, 2012 at 03:02:20AM +0200, Marek Vasut wrote:
> > The write-protect GPIO is inverted on some boards. Handle such case.
> > 
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Acked-by: Shawn Guo <shawn.guo@linaro.org>
> 
> A coupe of nits though:
> 
> The subject prefix can better be "mmc: mxs-mmc: ".

Want me to resend it ?

> 
> > ---
> > 
> >  Documentation/devicetree/bindings/mmc/mxs-mmc.txt |    1 +
> >  drivers/mmc/host/mxs-mmc.c                        |   11 ++++++++++-
> >  2 files changed, 11 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> > b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt index
> > 14d870a..0a7d2cd 100644
> > --- a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> > +++ b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> > 
> > @@ -13,6 +13,7 @@ Required properties:
> >  Optional properties:
> >  - wp-gpios: Specify GPIOs for write protection
> > 
> > +- wp-inverted: Set if the write protection GPIO is inverted
> > 
> >  Examples:
> > diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> > index 277161d..119beb9 100644
> > --- a/drivers/mmc/host/mxs-mmc.c
> > +++ b/drivers/mmc/host/mxs-mmc.c
> > @@ -164,16 +164,23 @@ struct mxs_mmc_host {
> > 
> >  	spinlock_t			lock;
> >  	int				sdio_irq_en;
> >  	int				wp_gpio;
> > 
> > +	int				wp_inverted:1;
> > 
> >  };
> >  
> >  static int mxs_mmc_get_ro(struct mmc_host *mmc)
> >  {
> >  
> >  	struct mxs_mmc_host *host = mmc_priv(mmc);
> > 
> > +	int ret;
> > 
> >  	if (!gpio_is_valid(host->wp_gpio))
> >  	
> >  		return -EINVAL;
> > 
> > -	return gpio_get_value(host->wp_gpio);
> > +	ret = gpio_get_value(host->wp_gpio);
> > +
> > +	if (host->wp_inverted)
> > +		ret = !ret;
> > +
> > +	return ret;
> 
> The above lines can just be the one below?
> 
> 	return (host->wp_inverted) ? !ret : ret;

I'd prefer to avoid the ternary operator, it's more readable as it is.

> 
> >  }

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/4] MXS-MMC: Add wp-inverted property
  2012-05-21  2:38     ` Marek Vasut
@ 2012-05-21  2:48       ` Shawn Guo
  2012-05-21  3:22         ` Chris Ball
  0 siblings, 1 reply; 8+ messages in thread
From: Shawn Guo @ 2012-05-21  2:48 UTC (permalink / raw)
  To: Marek Vasut; +Cc: linux-arm-kernel, Fabio Estevam, Chris Ball, linux-mmc

On 21 May 2012 10:38, Marek Vasut <marex@denx.de> wrote:
>> The subject prefix can better be "mmc: mxs-mmc: ".
>
> Want me to resend it ?
>
It's Chris' call.

Regards,
Shawn

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/4] MXS-MMC: Add wp-inverted property
  2012-05-21  2:48       ` Shawn Guo
@ 2012-05-21  3:22         ` Chris Ball
  2012-05-21  3:36           ` Marek Vasut
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Ball @ 2012-05-21  3:22 UTC (permalink / raw)
  To: Shawn Guo; +Cc: Marek Vasut, linux-arm-kernel, Fabio Estevam, linux-mmc

Hi,

On Sun, May 20 2012, Shawn Guo wrote:
> On 21 May 2012 10:38, Marek Vasut <marex@denx.de> wrote:
>>> The subject prefix can better be "mmc: mxs-mmc: ".
>>
>> Want me to resend it ?
>>
> It's Chris' call.

Yes, please -- actually not just because of the subject prefix, which I
wouldn't mind fixing myself, but because I like having patches posted to
linux-mmc@ before they're applied.

Thanks!

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/4] MXS-MMC: Add wp-inverted property
  2012-05-21  3:22         ` Chris Ball
@ 2012-05-21  3:36           ` Marek Vasut
  0 siblings, 0 replies; 8+ messages in thread
From: Marek Vasut @ 2012-05-21  3:36 UTC (permalink / raw)
  To: Chris Ball; +Cc: Shawn Guo, linux-arm-kernel, Fabio Estevam, linux-mmc

Dear Chris Ball,

> Hi,
> 
> On Sun, May 20 2012, Shawn Guo wrote:
> > On 21 May 2012 10:38, Marek Vasut <marex@denx.de> wrote:
> >>> The subject prefix can better be "mmc: mxs-mmc: ".
> >> 
> >> Want me to resend it ?
> > 
> > It's Chris' call.
> 
> Yes, please -- actually not just because of the subject prefix, which I
> wouldn't mind fixing myself, but because I like having patches posted to
> linux-mmc@ before they're applied.

Fixed now

> 
> Thanks!

You're welcome :)

> 
> - Chris.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM
  2012-05-21  4:09   ` [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM Shawn Guo
@ 2012-05-21  3:52     ` Chris Ball
  2012-05-21  4:33       ` Marek Vasut
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Ball @ 2012-05-21  3:52 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Marek Vasut, linux-arm-kernel, Fabio Estevam, Shawn Guo,
	linux-mmc

Hi,

On Mon, May 21 2012, Shawn Guo wrote:
> Do you want me to queue this up for 3.5-rc with arm-soc tree or you can
> do that with mmc tree?  In case you can take care of it:
>
> Acked-by: Shawn Guo <shawn.guo@linaro.org>
>
> Marek,
>
> In case Chris want to take the patch and would ask you to repost it to
> copy linux-mmc, please fix the subject prefix also.

Thanks; yes, I'd like to take care of it, I'll make sure to add your ACK.
Marek, please repost this one too.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM
       [not found] ` <1337562140-5739-3-git-send-email-marex@denx.de>
@ 2012-05-21  4:09   ` Shawn Guo
  2012-05-21  3:52     ` Chris Ball
  0 siblings, 1 reply; 8+ messages in thread
From: Shawn Guo @ 2012-05-21  4:09 UTC (permalink / raw)
  To: Marek Vasut, Chris Ball
  Cc: linux-arm-kernel, Fabio Estevam, Shawn Guo, linux-mmc

Hi Chris,

Do you want me to queue this up for 3.5-rc with arm-soc tree or you can
do that with mmc tree?  In case you can take care of it:

Acked-by: Shawn Guo <shawn.guo@linaro.org>

Marek,

In case Chris want to take the patch and would ask you to repost it to
copy linux-mmc, please fix the subject prefix also.

Regards,
Shawn

On Mon, May 21, 2012 at 03:02:19AM +0200, Marek Vasut wrote:
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/mmc/host/mxs-mmc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 34a9026..277161d 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -894,8 +894,8 @@ static struct platform_driver mxs_mmc_driver = {
>  		.owner	= THIS_MODULE,
>  #ifdef CONFIG_PM
>  		.pm	= &mxs_mmc_pm_ops,
> -		.of_match_table = mxs_mmc_dt_ids,
>  #endif
> +		.of_match_table = mxs_mmc_dt_ids,
>  	},
>  };
>  
> -- 
> 1.7.10
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM
  2012-05-21  3:52     ` Chris Ball
@ 2012-05-21  4:33       ` Marek Vasut
  0 siblings, 0 replies; 8+ messages in thread
From: Marek Vasut @ 2012-05-21  4:33 UTC (permalink / raw)
  To: Chris Ball
  Cc: Shawn Guo, linux-arm-kernel, Fabio Estevam, Shawn Guo, linux-mmc

Dear Chris Ball,

> Hi,
> 
> On Mon, May 21 2012, Shawn Guo wrote:
> > Do you want me to queue this up for 3.5-rc with arm-soc tree or you can
> > do that with mmc tree?  In case you can take care of it:
> > 
> > Acked-by: Shawn Guo <shawn.guo@linaro.org>
> > 
> > Marek,
> > 
> > In case Chris want to take the patch and would ask you to repost it to
> > copy linux-mmc, please fix the subject prefix also.
> 
> Thanks; yes, I'd like to take care of it, I'll make sure to add your ACK.
> Marek, please repost this one too.

Will do, and will be careful about the MLs next time.

> 
> - Chris.

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-05-21  4:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1337562140-5739-1-git-send-email-marex@denx.de>
     [not found] ` <1337562140-5739-4-git-send-email-marex@denx.de>
2012-05-21  1:39   ` [PATCH 4/4] MXS-MMC: Add wp-inverted property Shawn Guo
2012-05-21  2:38     ` Marek Vasut
2012-05-21  2:48       ` Shawn Guo
2012-05-21  3:22         ` Chris Ball
2012-05-21  3:36           ` Marek Vasut
     [not found] ` <1337562140-5739-3-git-send-email-marex@denx.de>
2012-05-21  4:09   ` [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM Shawn Guo
2012-05-21  3:52     ` Chris Ball
2012-05-21  4:33       ` Marek Vasut

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).