public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] mmc: mxs-mmc: implement broken-cd
@ 2012-09-07 11:45 Lauri Hintsala
  2012-09-10  6:08 ` Shawn Guo
  0 siblings, 1 reply; 10+ messages in thread
From: Lauri Hintsala @ 2012-09-07 11:45 UTC (permalink / raw)
  To: linux-arm-kernel

This feature allows to use SDIO bus without wiring card detect
signal. This is relevant in cases where SDIO device is connected to
SDIO bus and there is no way to disconnect device from bus (device
is always present).

Signed-off-by: Lauri Hintsala <lauri.hintsala@bluegiga.com>
---
 drivers/mmc/host/mxs-mmc.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index ad3fcea..992760e 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -165,6 +165,7 @@ struct mxs_mmc_host {
 	int				sdio_irq_en;
 	int				wp_gpio;
 	bool				wp_inverted;
+	bool				broken_cd;
 };
 
 static int mxs_mmc_get_ro(struct mmc_host *mmc)
@@ -187,6 +188,9 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
 {
 	struct mxs_mmc_host *host = mmc_priv(mmc);
 
+	if (host->broken_cd)
+		return -ENOSYS;
+
 	return !(readl(host->base + HW_SSP_STATUS(host)) &
 		 BM_SSP_STATUS_CARD_DETECT);
 }
@@ -808,6 +812,9 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 							&flags);
 		if (flags & OF_GPIO_ACTIVE_LOW)
 			host->wp_inverted = 1;
+
+		if (of_get_property(np, "broken-cd", NULL))
+			host->broken_cd = 1;
 	} else {
 		if (pdata->flags & SLOTF_8_BIT_CAPABLE)
 			mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
-- 
1.7.9.5

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

end of thread, other threads:[~2012-09-20  4:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-07 11:45 [PATCH] mmc: mxs-mmc: implement broken-cd Lauri Hintsala
2012-09-10  6:08 ` Shawn Guo
2012-09-10 10:04   ` Lauri Hintsala
2012-09-10 13:50     ` Shawn Guo
2012-09-20  4:45       ` Lauri Hintsala
2012-09-10 14:58     ` Matt Sealey
2012-09-12 14:06       ` Lauri Hintsala
2012-09-17 13:43         ` Lauri Hintsala
2012-09-17 14:01           ` Chris Ball
2012-09-17 14:40             ` Lauri Hintsala

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