public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: mxs-mmc: Add support for non-removable cards
@ 2013-04-05  4:18 Alexandre Pereira da Silva
  2013-04-05  6:37 ` Marek Vasut
  2013-04-05  9:13 ` Shawn Guo
  0 siblings, 2 replies; 6+ messages in thread
From: Alexandre Pereira da Silva @ 2013-04-05  4:18 UTC (permalink / raw)
  To: cjb, shawn.guo, marex, fabio.estevam, otavio, broonie, linux-mmc,
	linux-kernel
  Cc: Alexandre Pereira da Silva

Some boards and card slots doesn't have card detect feature available.
In that case allow to mark the cards as non-removable, via devicetree.

Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
---
 drivers/mmc/host/mxs-mmc.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 4efe302..7d2cd74 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -95,6 +95,9 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
 	struct mxs_mmc_host *host = mmc_priv(mmc);
 	struct mxs_ssp *ssp = &host->ssp;
 
+	if (mmc->caps & MMC_CAP_NONREMOVABLE)
+		return 1;
+
 	return !(readl(ssp->base + HW_SSP_STATUS(ssp)) &
 		 BM_SSP_STATUS_CARD_DETECT);
 }
@@ -691,6 +694,9 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	if (flags & OF_GPIO_ACTIVE_LOW)
 		host->wp_inverted = 1;
 
+	if (of_find_property(np, "non-removable", NULL))
+		mmc->caps |= MMC_CAP_NONREMOVABLE;
+
 	mmc->f_min = 400000;
 	mmc->f_max = 288000000;
 	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
-- 
1.7.10


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

* Re: [PATCH] mmc: mxs-mmc: Add support for non-removable cards
  2013-04-05  4:18 [PATCH] mmc: mxs-mmc: Add support for non-removable cards Alexandre Pereira da Silva
@ 2013-04-05  6:37 ` Marek Vasut
  2013-04-05  9:57   ` Mark Brown
  2013-04-05  9:13 ` Shawn Guo
  1 sibling, 1 reply; 6+ messages in thread
From: Marek Vasut @ 2013-04-05  6:37 UTC (permalink / raw)
  To: Alexandre Pereira da Silva
  Cc: cjb, shawn.guo, fabio.estevam, otavio, broonie, linux-mmc,
	linux-kernel

Dear Alexandre Pereira da Silva,

> Some boards and card slots doesn't have card detect feature available.
> In that case allow to mark the cards as non-removable, via devicetree.
> 
> Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

Looks good,

Reviewed-by: Marek Vasut <marex@denx.de>

btw. did you know you can let git send-email automatically handle CC for you so 
you don't have to type it into the command line by simply sticking

Cc: Us Er <e@ma.il>

in the commit message? Preferably under the SoB line.

> ---
>  drivers/mmc/host/mxs-mmc.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 4efe302..7d2cd74 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -95,6 +95,9 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
>  	struct mxs_mmc_host *host = mmc_priv(mmc);
>  	struct mxs_ssp *ssp = &host->ssp;
> 
> +	if (mmc->caps & MMC_CAP_NONREMOVABLE)
> +		return 1;
> +
>  	return !(readl(ssp->base + HW_SSP_STATUS(ssp)) &
>  		 BM_SSP_STATUS_CARD_DETECT);
>  }
> @@ -691,6 +694,9 @@ static int mxs_mmc_probe(struct platform_device *pdev)
>  	if (flags & OF_GPIO_ACTIVE_LOW)
>  		host->wp_inverted = 1;
> 
> +	if (of_find_property(np, "non-removable", NULL))
> +		mmc->caps |= MMC_CAP_NONREMOVABLE;
> +
>  	mmc->f_min = 400000;
>  	mmc->f_max = 288000000;
>  	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;

Best regards,
Marek Vasut

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

* Re: [PATCH] mmc: mxs-mmc: Add support for non-removable cards
  2013-04-05  4:18 [PATCH] mmc: mxs-mmc: Add support for non-removable cards Alexandre Pereira da Silva
  2013-04-05  6:37 ` Marek Vasut
@ 2013-04-05  9:13 ` Shawn Guo
  2013-04-05 11:49   ` Alexandre Pereira da Silva
  1 sibling, 1 reply; 6+ messages in thread
From: Shawn Guo @ 2013-04-05  9:13 UTC (permalink / raw)
  To: Alexandre Pereira da Silva
  Cc: cjb, marex, fabio.estevam, otavio, broonie, linux-mmc,
	linux-kernel

On Fri, Apr 05, 2013 at 01:18:38AM -0300, Alexandre Pereira da Silva wrote:
> Some boards and card slots doesn't have card detect feature available.
> In that case allow to mark the cards as non-removable, via devicetree.
> 
> Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>

Marc already sent a similar patch[1] for that.

Shawn

[1] http://thread.gmane.org/gmane.linux.kernel.mmc/19823/focus=19825

> ---
>  drivers/mmc/host/mxs-mmc.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 4efe302..7d2cd74 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -95,6 +95,9 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
>  	struct mxs_mmc_host *host = mmc_priv(mmc);
>  	struct mxs_ssp *ssp = &host->ssp;
>  
> +	if (mmc->caps & MMC_CAP_NONREMOVABLE)
> +		return 1;
> +
>  	return !(readl(ssp->base + HW_SSP_STATUS(ssp)) &
>  		 BM_SSP_STATUS_CARD_DETECT);
>  }
> @@ -691,6 +694,9 @@ static int mxs_mmc_probe(struct platform_device *pdev)
>  	if (flags & OF_GPIO_ACTIVE_LOW)
>  		host->wp_inverted = 1;
>  
> +	if (of_find_property(np, "non-removable", NULL))
> +		mmc->caps |= MMC_CAP_NONREMOVABLE;
> +
>  	mmc->f_min = 400000;
>  	mmc->f_max = 288000000;
>  	mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
> -- 
> 1.7.10
> 


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

* Re: [PATCH] mmc: mxs-mmc: Add support for non-removable cards
  2013-04-05  6:37 ` Marek Vasut
@ 2013-04-05  9:57   ` Mark Brown
  2013-04-05 16:07     ` Marek Vasut
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2013-04-05  9:57 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Alexandre Pereira da Silva, cjb, shawn.guo, fabio.estevam, otavio,
	linux-mmc, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 426 bytes --]

On Fri, Apr 05, 2013 at 08:37:39AM +0200, Marek Vasut wrote:

> btw. did you know you can let git send-email automatically handle CC for you so 
> you don't have to type it into the command line by simply sticking

> Cc: Us Er <e@ma.il>

> in the commit message? Preferably under the SoB line.

Though not everyone likes seeing things like that end up in the commit
log (or having to edit them out of commit logs).

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH] mmc: mxs-mmc: Add support for non-removable cards
  2013-04-05  9:13 ` Shawn Guo
@ 2013-04-05 11:49   ` Alexandre Pereira da Silva
  0 siblings, 0 replies; 6+ messages in thread
From: Alexandre Pereira da Silva @ 2013-04-05 11:49 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Chris Ball, marex, fabio.estevam, Otavio Salvador, Mark Brown,
	linux-mmc, LKML

On Fri, Apr 5, 2013 at 6:13 AM, Shawn Guo <shawn.guo@linaro.org> wrote:
>
> Marc already sent a similar patch[1] for that.

Thanks for pointing it out.

I will work on top of that patch.

> Shawn
>
> [1] http://thread.gmane.org/gmane.linux.kernel.mmc/19823/focus=19825
>

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

* Re: [PATCH] mmc: mxs-mmc: Add support for non-removable cards
  2013-04-05  9:57   ` Mark Brown
@ 2013-04-05 16:07     ` Marek Vasut
  0 siblings, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2013-04-05 16:07 UTC (permalink / raw)
  To: Mark Brown
  Cc: Alexandre Pereira da Silva, cjb, shawn.guo, fabio.estevam, otavio,
	linux-mmc, linux-kernel

Dear Mark Brown,

> On Fri, Apr 05, 2013 at 08:37:39AM +0200, Marek Vasut wrote:
> > btw. did you know you can let git send-email automatically handle CC for
> > you so you don't have to type it into the command line by simply
> > sticking
> > 
> > Cc: Us Er <e@ma.il>
> > 
> > in the commit message? Preferably under the SoB line.
> 
> Though not everyone likes seeing things like that end up in the commit
> log (or having to edit them out of commit logs).

Ah, all right.

Best regards,
Marek Vasut

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

end of thread, other threads:[~2013-04-05 16:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-05  4:18 [PATCH] mmc: mxs-mmc: Add support for non-removable cards Alexandre Pereira da Silva
2013-04-05  6:37 ` Marek Vasut
2013-04-05  9:57   ` Mark Brown
2013-04-05 16:07     ` Marek Vasut
2013-04-05  9:13 ` Shawn Guo
2013-04-05 11:49   ` Alexandre Pereira da Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox