Skip to content

Commit

Permalink
sdhci: Add support for hosts reporting inverted write-protect state
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Anton Vorontsov authored and Pierre Ossman committed Mar 24, 2009
1 parent 68d1fb7 commit c5075a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 2 additions & 0 deletions drivers/mmc/host/sdhci.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ struct sdhci_host {
#define SDHCI_QUIRK_NO_BUSY_IRQ (1<<14)
/* Controller has unreliable card detection */
#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 */
void __iomem * ioaddr; /* Mapped address */
Expand Down

0 comments on commit c5075a1

Please sign in to comment.