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>
This commit is contained in:
parent
68d1fb7e22
commit
c5075a1089
|
@ -1149,6 +1149,8 @@ static int sdhci_get_ro(struct mmc_host *mmc)
|
||||||
|
|
||||||
spin_unlock_irqrestore(&host->lock, flags);
|
spin_unlock_irqrestore(&host->lock, flags);
|
||||||
|
|
||||||
|
if (host->quirks & SDHCI_QUIRK_INVERTED_WRITE_PROTECT)
|
||||||
|
return !!(present & SDHCI_WRITE_PROTECT);
|
||||||
return !(present & SDHCI_WRITE_PROTECT);
|
return !(present & SDHCI_WRITE_PROTECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -216,6 +216,8 @@ struct sdhci_host {
|
||||||
#define SDHCI_QUIRK_NO_BUSY_IRQ (1<<14)
|
#define SDHCI_QUIRK_NO_BUSY_IRQ (1<<14)
|
||||||
/* Controller has unreliable card detection */
|
/* Controller has unreliable card detection */
|
||||||
#define SDHCI_QUIRK_BROKEN_CARD_DETECTION (1<<15)
|
#define SDHCI_QUIRK_BROKEN_CARD_DETECTION (1<<15)
|
||||||
|
/* Controller reports inverted write-protect state */
|
||||||
|
#define SDHCI_QUIRK_INVERTED_WRITE_PROTECT (1<<16)
|
||||||
|
|
||||||
int irq; /* Device IRQ */
|
int irq; /* Device IRQ */
|
||||||
void __iomem * ioaddr; /* Mapped address */
|
void __iomem * ioaddr; /* Mapped address */
|
||||||
|
|
Loading…
Reference in a new issue