public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: mxs-mmc: Add broken-cd devicetree property
@ 2013-04-06 13:43 Alexandre Pereira da Silva
  2013-04-06 13:58 ` Marc Kleine-Budde
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Pereira da Silva @ 2013-04-06 13:43 UTC (permalink / raw)
  To: cjb, shawn.guo, marex, fabio.estevam, otavio, broonie, mkl,
	linux-mmc, linux-kernel
  Cc: Alexandre Pereira da Silva

In case of broken card detect support, assume the card is non-removable

Signed-off-by: Alexandre Pereira da Silva <aletes.xgr@gmail.com>
---

This patch depends on Marc Kleine-Budde series adding support for non-removable.

 drivers/mmc/host/mxs-mmc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index c231881..8418928 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -689,7 +689,8 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 		mmc->caps |= MMC_CAP_4_BIT_DATA;
 	else if (bus_width == 8)
 		mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
-	host->non_removable = of_property_read_bool(np, "non-removable");
+	host->non_removable = of_property_read_bool(np, "non-removable") |
+		of_property_read_bool(np, "broken-cd");
 	if (host->non_removable)
 		mmc->caps |= MMC_CAP_NONREMOVABLE;
 	host->wp_gpio = of_get_named_gpio_flags(np, "wp-gpios", 0, &flags);
-- 
1.7.10

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

* Re: [PATCH] mmc: mxs-mmc: Add broken-cd devicetree property
  2013-04-06 13:43 [PATCH] mmc: mxs-mmc: Add broken-cd devicetree property Alexandre Pereira da Silva
@ 2013-04-06 13:58 ` Marc Kleine-Budde
  2013-04-06 14:19   ` Alexandre Pereira da Silva
  0 siblings, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2013-04-06 13:58 UTC (permalink / raw)
  To: Alexandre Pereira da Silva
  Cc: cjb, shawn.guo, marex, fabio.estevam, otavio, broonie, linux-mmc,
	linux-kernel

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

On 04/06/2013 03:43 PM, Alexandre Pereira da Silva wrote:
> In case of broken card detect support, assume the card is non-removable

According to the documentation broken card detect is something different
than non-removable:

>   - broken-cd: There is no card detection available; polling must be used.
>   - non-removable: non-removable slot (like eMMC); assume always present.

But mxs-mmc set MMC_CAP_NEEDS_POLL unconditionally.

http://lxr.free-electrons.com/source/drivers/mmc/host/mxs-mmc.c#L682

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

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

* Re: [PATCH] mmc: mxs-mmc: Add broken-cd devicetree property
  2013-04-06 13:58 ` Marc Kleine-Budde
@ 2013-04-06 14:19   ` Alexandre Pereira da Silva
  2013-04-06 15:06     ` Marek Vasut
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Pereira da Silva @ 2013-04-06 14:19 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: Chris Ball, Shawn Guo, Marek Vašut, fabio.estevam,
	Otavio Salvador, Mark Brown, linux-mmc, LKML

On Sat, Apr 6, 2013 at 10:58 AM, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> According to the documentation broken card detect is something different
> than non-removable:
>
> >   - broken-cd: There is no card detection available; polling must be used.
> >   - non-removable: non-removable slot (like eMMC); assume always present.
>
> But mxs-mmc set MMC_CAP_NEEDS_POLL unconditionally.

I will work on a better way to fix this.

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

* Re: [PATCH] mmc: mxs-mmc: Add broken-cd devicetree property
  2013-04-06 14:19   ` Alexandre Pereira da Silva
@ 2013-04-06 15:06     ` Marek Vasut
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2013-04-06 15:06 UTC (permalink / raw)
  To: Alexandre Pereira da Silva
  Cc: Marc Kleine-Budde, Chris Ball, Shawn Guo, fabio.estevam,
	Otavio Salvador, Mark Brown, linux-mmc, LKML

Dear Alexandre Pereira da Silva,

> On Sat, Apr 6, 2013 at 10:58 AM, Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> > According to the documentation broken card detect is something different
> > 
> > than non-removable:
> > >   - broken-cd: There is no card detection available; polling must be
> > >   used. - non-removable: non-removable slot (like eMMC); assume always
> > >   present.
> > 
> > But mxs-mmc set MMC_CAP_NEEDS_POLL unconditionally.
> 
> I will work on a better way to fix this.

NEEDS_POLL looks nice and seems to fit this case.

Best regards,
Marek Vasut

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

end of thread, other threads:[~2013-04-06 15:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-06 13:43 [PATCH] mmc: mxs-mmc: Add broken-cd devicetree property Alexandre Pereira da Silva
2013-04-06 13:58 ` Marc Kleine-Budde
2013-04-06 14:19   ` Alexandre Pereira da Silva
2013-04-06 15:06     ` Marek Vasut

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