Skip to contentSkip to conversation

sdhci-2: add host's own get_ro func to support the controller that used it's own WP mechanism

PATCH New Richard Zhu 1 participant 1 message Sep 1, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/9 sdhci-2: add host's own get_ro func to support the controller that used it's own WP mechanism

Some controllers have their own WP mechanism when implement the get_ro, add one get_ro api to supported them.

---
 drivers/mmc/host/sdhci.c |    3 +++
 drivers/mmc/host/sdhci.h |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)
drivers/mmc/host/sdhci.c +3 -0
index 2a93c27..e7e2611 100644
@@ -1213,6 +1213,9 @@ static int sdhci_get_ro(struct mmc_host *mmc)
 
 	host = mmc_priv(mmc);
 
+	if (host->ops->get_ro)
+		return host->ops->get_ro(host);
+
 	spin_lock_irqsave(&host->lock, flags);
 
 	if (host->flags & SDHCI_DEVICE_DEAD)
drivers/mmc/host/sdhci.h +1 -0
index d420b4e..a4db2cc 100644
@@ -322,6 +322,7 @@ struct sdhci_ops {
 	unsigned int	(*get_max_clock)(struct sdhci_host *host);
 	unsigned int	(*get_min_clock)(struct sdhci_host *host);
 	unsigned int	(*get_timeout_clock)(struct sdhci_host *host);
+	unsigned int	(*get_ro)(struct sdhci_host *host);
 };
 
 #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
Signature · 1 line
1.7.0