From patchwork Fri Apr 29 20:21:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Rakity X-Patchwork-Id: 742301 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 p3TKOjjZ005679 for ; Fri, 29 Apr 2011 20:24:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753557Ab1D2UYo (ORCPT ); Fri, 29 Apr 2011 16:24:44 -0400 Received: from na3sys009aog102.obsmtp.com ([74.125.149.69]:34826 "EHLO na3sys009aog102.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751061Ab1D2UYn convert rfc822-to-8bit (ORCPT ); Fri, 29 Apr 2011 16:24:43 -0400 Received: from sc-owa02.marvell.com ([65.219.4.130]) (using TLSv1) by na3sys009aob102.postini.com ([74.125.148.12]) with SMTP ID DSNKTbsei1saYhC8PQKRK+tG693RJV3iUJDG@postini.com; Fri, 29 Apr 2011 13:24:43 PDT Received: from SC-vEXCH3.marvell.com ([10.93.76.133]) by sc-owa02.marvell.com ([10.93.76.22]) with mapi; Fri, 29 Apr 2011 13:21:31 -0700 From: Philip Rakity To: "linux-mmc@vger.kernel.org" Date: Fri, 29 Apr 2011 13:21:29 -0700 Subject: [PATCH V2] mmc: sdhci add explicit callback to set f_max Thread-Topic: [PATCH V2] mmc: sdhci add explicit callback to set f_max Thread-Index: AcwGqwaZFLkwy2XDRS6fPoNw+gbd1A== Message-ID: <343135FB-1668-463C-A155-359004845845@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 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.6 (demeter1.kernel.org [140.211.167.41]); Fri, 29 Apr 2011 20:24:45 +0000 (UTC) We currently have callbacks for max_clk, f_min but are missing the callback for f_max. Signed-off-by: Philip Rakity --- drivers/mmc/host/sdhci.c | 9 ++++++--- drivers/mmc/host/sdhci.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 1709f8b..7a444f7 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2364,9 +2364,12 @@ int sdhci_add_host(struct sdhci_host *host) */ mmc->ops = &sdhci_ops; mmc->f_max = host->max_clk; - if (host->ops->get_min_clock) - mmc->f_min = host->ops->get_min_clock(host); - else if (host->version >= SDHCI_SPEC_300) { + if (host->ops->get_min_clock || host->ops->get_f_max_clock) { + if (host->ops->get_min_clock) + mmc->f_min = host->ops->get_min_clock(host); + if (host->ops->get_f_max_clock) + mmc->f_max = host->ops->get_f_max_clock(host); + } else if (host->version >= SDHCI_SPEC_300) { if (host->clk_mul) { mmc->f_min = (host->max_clk * host->clk_mul) / 1024; mmc->f_max = host->max_clk * host->clk_mul; diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 15cb026..7295c2a 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -264,6 +264,7 @@ struct sdhci_ops { void (*platform_reset_enter)(struct sdhci_host *host, u8 mask); void (*platform_reset_exit)(struct sdhci_host *host, u8 mask); int (*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs); + unsigned int (*get_f_max_clock)(struct sdhci_host *host); };