>From 638535ec4f5f0b6299f423d2cf67fe9dd18e3679 Mon Sep 17 00:00:00 2001 From: Chuanxiao Dong <[email protected]> Date: Sat, 13 Nov 2010 19:51:41 +0800 Subject: [PATCH 4/4] mmc: implemented get_tmclk callback for sdhci host
get_tmclk callback will be used for calculating a suitable max_discard_sectors value Signed-off-by: Chuanxiao Dong <[email protected]> --- drivers/mmc/host/sdhci.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index f855efc..630dd0b 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1373,11 +1373,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, }; /*****************************************************************************\ -- 1.6.6.1 _______________________________________________ MeeGo-kernel mailing list [email protected] http://lists.meego.com/listinfo/meego-kernel
