@@ -1311,11 +1311,28 @@ out:
spin_unlock_irqrestore(&host->lock, flags);
}
+/*
+ * get the host controller timeout clock which will
+ * be used to calculate a suitable max_discard_sectors
+ * value for mmc queue
+ * */
+static unsigned int sdhci_get_tmclk(struct mmc_host *mmc)
+{
+ struct sdhci_host *host;
+ host = mmc_priv(mmc);
+
+ if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)
+ host->timeout_clk = host->clock / 1000;
+
+ return host->timeout_clk;
+}
+
static const struct mmc_host_ops sdhci_ops = {
.request = sdhci_request,
.set_ios = sdhci_set_ios,
.get_ro = sdhci_get_ro,
.enable_sdio_irq = sdhci_enable_sdio_irq,
+ .get_tmclk = sdhci_get_tmclk,
};
/*****************************************************************************\