[PATCH] sdhci: add quirk for controllers that don't support write only detect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Some board designs for embedded systems  do not always bring up the SD Host Write Protect Signal.  
This patch defines a new quirk that when enabled enables write access.

>From 032242c62e0fe22eb6f5a4e0311eaab67ef54cbe Mon Sep 17 00:00:00 2001
From: Philip Rakity <prakity@xxxxxxxxxxx>
Date: Sun, 19 Sep 2010 14:34:02 -0700
Subject: [PATCH] sdhci: add quirk for controllers that don't support write only detect
 Signed-off-by: Philip Rakity <prakity@xxxxxxxxxxx>

---
 drivers/mmc/host/sdhci.c |    2 ++
 drivers/mmc/host/sdhci.h |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 401527d..e2b1f32 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1213,6 +1213,8 @@ static int sdhci_get_ro(struct mmc_host *mmc)
 
 	if (host->flags & SDHCI_DEVICE_DEAD)
 		present = 0;
+	else if (host->quirks & SDHCI_NO_SUPPORT_FOR_WRITE_PROTECT)
+		present = SDHCI_WRITE_PROTECT;
 	else
 		present = sdhci_readl(host, SDHCI_PRESENT_STATE);
 
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index d316bc7..290b5a8 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -247,6 +247,8 @@ struct sdhci_host {
 #define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12		(1<<28)
 /* Controller doesn't have HISPD bit field in HI-SPEED SD card */
 #define SDHCI_QUIRK_NO_HISPD_BIT			(1<<29)
+/* Controller does not have write protect signal		*/
+#define SDHCI_NO_SUPPORT_FOR_WRITE_PROTECT		(1<<30)
 
 	int			irq;		/* Device IRQ */
 	void __iomem *		ioaddr;		/* Mapped address */
-- 
1.6.0.4
 --
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux