@@ -1204,7 +1204,7 @@ out:
spin_unlock_irqrestore(&host->lock, flags);
}
-static int sdhci_get_ro(struct mmc_host *mmc)
+int sdhci_get_ro_helper(struct mmc_host *mmc)
{
struct sdhci_host *host;
unsigned long flags;
@@ -1226,6 +1226,18 @@ static int sdhci_get_ro(struct mmc_host *mmc)
return !(present & SDHCI_WRITE_PROTECT);
}
+int sdhci_get_ro(struct mmc_host *mmc)
+{
+ struct sdhci_host *host;
+
+ host = mmc_priv(mmc);
+
+ if (host->ops->get_ro)
+ return host->ops->get_ro(mmc);
+ else
+ return sdhci_get_ro_helper(mmc);
+}
+
static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable)
{
struct sdhci_host *host;
@@ -324,6 +324,7 @@ struct sdhci_ops {
unsigned int (*get_min_clock)(struct sdhci_host *host);
unsigned int (*get_timeout_clock)(struct sdhci_host *host);
void (*platform_specific_reset)(struct sdhci_host *host, u8 mask);
+ int (*get_ro)(struct mmc_host *mmc);
};
#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS