diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2009-03-16 17:13:54 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2009-03-24 16:30:09 -0400 |
commit | c5075a1089e808d8f471ce21b02810cc98ab2692 (patch) | |
tree | 25780a5db4a56e51a736c45bfb2cc8fe132fbd11 | |
parent | 68d1fb7e229c6f95be4fbbe3eb46b24e41184924 (diff) |
sdhci: Add support for hosts reporting inverted write-protect state
This patch adds SDHCI_QUIRK_INVERTED_WRITE_PROTECT quirk. When
specified, the sdhci driver will invert WP state.
p.s. Actually, the quirk is more board-specific than
controller-specific.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
-rw-r--r-- | drivers/mmc/host/sdhci.c | 2 | ||||
-rw-r--r-- | 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 fc7cb489bdb7..c814220d214e 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -1149,6 +1149,8 @@ static int sdhci_get_ro(struct mmc_host *mmc) | |||
1149 | 1149 | ||
1150 | spin_unlock_irqrestore(&host->lock, flags); | 1150 | spin_unlock_irqrestore(&host->lock, flags); |
1151 | 1151 | ||
1152 | if (host->quirks & SDHCI_QUIRK_INVERTED_WRITE_PROTECT) | ||
1153 | return !!(present & SDHCI_WRITE_PROTECT); | ||
1152 | return !(present & SDHCI_WRITE_PROTECT); | 1154 | return !(present & SDHCI_WRITE_PROTECT); |
1153 | } | 1155 | } |
1154 | 1156 | ||
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 968d713950f1..6980f2725b85 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h | |||
@@ -216,6 +216,8 @@ struct sdhci_host { | |||
216 | #define SDHCI_QUIRK_NO_BUSY_IRQ (1<<14) | 216 | #define SDHCI_QUIRK_NO_BUSY_IRQ (1<<14) |
217 | /* Controller has unreliable card detection */ | 217 | /* Controller has unreliable card detection */ |
218 | #define SDHCI_QUIRK_BROKEN_CARD_DETECTION (1<<15) | 218 | #define SDHCI_QUIRK_BROKEN_CARD_DETECTION (1<<15) |
219 | /* Controller reports inverted write-protect state */ | ||
220 | #define SDHCI_QUIRK_INVERTED_WRITE_PROTECT (1<<16) | ||
219 | 221 | ||
220 | int irq; /* Device IRQ */ | 222 | int irq; /* Device IRQ */ |
221 | void __iomem * ioaddr; /* Mapped address */ | 223 | void __iomem * ioaddr; /* Mapped address */ |