All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Chuanxiao.Dong" <chuanxiao.dong@intel.com>
To: cjb@laptop.org
Cc: adrian.hunter@nokia.com, linux-mmc@vger.kernel.org
Subject: [PATCH v1 3/3]implemented get_tmclk callback for SDHCI host
Date: Thu, 11 Nov 2010 17:05:53 +0800	[thread overview]
Message-ID: <20101111090553.GD18170@intel.com> (raw)

>From 30b712a99e25cb4e90807d20d2524fb74963e25e Mon Sep 17 00:00:00 2001
From: Chuanxiao Dong <chuanxiao.dong@intel.com>
Date: Thu, 11 Nov 2010 15:49:11 +0800
Subject: [PATCH 3/3] 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 <chuanxiao.dong@intel.com>
---
 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 79fcca2..1575bfa 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -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,
 };
 
 /*****************************************************************************\
-- 
1.6.6.1


                 reply	other threads:[~2010-11-11  9:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101111090553.GD18170@intel.com \
    --to=chuanxiao.dong@intel.com \
    --cc=adrian.hunter@nokia.com \
    --cc=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.