summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci.c
diff options
context:
space:
mode:
authorAnton Vorontsov2009-03-16 22:13:54 +0100
committerPierre Ossman2009-03-24 21:30:09 +0100
commitc5075a1089e808d8f471ce21b02810cc98ab2692 (patch)
tree25780a5db4a56e51a736c45bfb2cc8fe132fbd11 /drivers/mmc/host/sdhci.c
parentsdhci: Add support for card-detection polling (diff)
downloadkernel-qcow2-linux-c5075a1089e808d8f471ce21b02810cc98ab2692.tar.gz
kernel-qcow2-linux-c5075a1089e808d8f471ce21b02810cc98ab2692.tar.xz
kernel-qcow2-linux-c5075a1089e808d8f471ce21b02810cc98ab2692.zip
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>
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r--drivers/mmc/host/sdhci.c2
1 files changed, 2 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)
spin_unlock_irqrestore(&host->lock, flags);
+ if (host->quirks & SDHCI_QUIRK_INVERTED_WRITE_PROTECT)
+ return !!(present & SDHCI_WRITE_PROTECT);
return !(present & SDHCI_WRITE_PROTECT);
}