From patchwork Wed Dec 22 07:08:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Rakity X-Patchwork-Id: 426261 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 oBM7DxxL022734 for ; Wed, 22 Dec 2010 07:14:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752454Ab0LVHOW (ORCPT ); Wed, 22 Dec 2010 02:14:22 -0500 Received: from na3sys009aog110.obsmtp.com ([74.125.149.203]:37875 "HELO na3sys009aog110.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752418Ab0LVHOV (ORCPT ); Wed, 22 Dec 2010 02:14:21 -0500 Received: from source ([65.219.4.130]) (using TLSv1) by na3sys009aob110.postini.com ([74.125.148.12]) with SMTP ID DSNKTRGlOZ3FuycGO8q+XzvAqZjj1d2eXBAX@postini.com; Tue, 21 Dec 2010 23:14:21 PST Received: from SC-vEXCH3.marvell.com ([10.93.76.133]) by sc-owa02.marvell.com ([10.93.76.22]) with mapi; Tue, 21 Dec 2010 23:08:46 -0800 From: Philip Rakity To: "linux-mmc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" CC: Mark Brown Date: Tue, 21 Dec 2010 23:08:44 -0800 Subject: [PATCH 8/23] Alternative mmc structure to support pxa168, pxa910, mmp2 family SD Thread-Topic: [PATCH 8/23] Alternative mmc structure to support pxa168, pxa910, mmp2 family SD Thread-Index: AcuhpxK8n5k7wYmDTXidWIO68LlXoQ== Message-ID: <3DA195EF-0D31-4C76-BB61-B52BAE9D9689@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes 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.3 (demeter1.kernel.org [140.211.167.41]); Wed, 22 Dec 2010 07:14:22 +0000 (UTC) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index f439881..6486009 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1884,7 +1884,13 @@ int sdhci_add_host(struct sdhci_host *host) else mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_200; - mmc->f_max = host->max_clk; + if (host->ops->get_f_max_clock) { + mmc->f_max = host->ops->get_f_max_clock(host); + if (mmc->f_max > host->max_clk) + mmc->f_max = host->max_clk; + } else + mmc->f_max = host->max_clk; + mmc->caps |= MMC_CAP_SDIO_IRQ; /* diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 9dd7bc1..a8c43c9 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -224,6 +224,7 @@ struct sdhci_ops { unsigned int (*get_ro)(struct sdhci_host *host); void (*platform_reset_enter)(struct sdhci_host *host, u8 mask); void (*platform_reset_exit)(struct sdhci_host *host, u8 mask); + unsigned int (*get_f_max_clock)(struct sdhci_host *host); }; #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS