diff mbox

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

Message ID A9891FF4-9D4D-4F5C-ACE9-B272B53CCC08@marvell.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Philip Rakity Sept. 19, 2010, 9:46 p.m. UTC
None
diff mbox

Patch

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 */