From patchwork Thu Nov 11 09:05:53 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chuanxiao.Dong" X-Patchwork-Id: 316902 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAB96tRw008735 for ; Thu, 11 Nov 2010 09:07:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752474Ab0KKJHn (ORCPT ); Thu, 11 Nov 2010 04:07:43 -0500 Received: from mga14.intel.com ([143.182.124.37]:8354 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751042Ab0KKJHn convert rfc822-to-8bit (ORCPT ); Thu, 11 Nov 2010 04:07:43 -0500 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 11 Nov 2010 01:07:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.59,181,1288594800"; d="scan'208,223";a="347385479" Received: from unknown (HELO intel.com) ([172.16.120.128]) by azsmga001.ch.intel.com with ESMTP; 11 Nov 2010 01:07:41 -0800 Date: Thu, 11 Nov 2010 17:05:53 +0800 From: "Chuanxiao.Dong" 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 Message-ID: <20101111090553.GD18170@intel.com> Reply-To: "Chuanxiao.Dong" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 11 Nov 2010 09:07:44 +0000 (UTC) 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, }; /*****************************************************************************\