From patchwork Tue Sep 28 07:39:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Rakity X-Patchwork-Id: 214102 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 o8S7f3hp025403 for ; Tue, 28 Sep 2010 07:41:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754219Ab0I1HlS (ORCPT ); Tue, 28 Sep 2010 03:41:18 -0400 Received: from na3sys009aog112.obsmtp.com ([74.125.149.207]:48966 "HELO na3sys009aog112.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754173Ab0I1HlS convert rfc822-to-8bit (ORCPT ); Tue, 28 Sep 2010 03:41:18 -0400 Received: from source ([65.219.4.130]) (using TLSv1) by na3sys009aob112.postini.com ([74.125.148.12]) with SMTP ID DSNKTKGcHS2E5FDLLoz1SxWbTz+Gtd2b6gvG@postini.com; Tue, 28 Sep 2010 00:41:18 PDT Received: from SC-vEXCH3.marvell.com ([10.93.76.133]) by sc-owa02.marvell.com ([10.93.76.22]) with mapi; Tue, 28 Sep 2010 00:39:48 -0700 From: Philip Rakity To: "linux-mmc@vger.kernel.org" CC: Anton Vorontsov Date: Tue, 28 Sep 2010 00:39:47 -0700 Subject: [RFC] remove quirk for broken clock - redundant since ops->max_clock defined Thread-Topic: [RFC] remove quirk for broken clock - redundant since ops->max_clock defined Thread-Index: Acte4FPgEf5WHzgvRGOnE2P/LdamqA== Message-ID: <23CB1625-7451-41BD-AD43-73C588A1593F@marvell.com> References: <8C0FC31B-681F-4541-AD64-43578FC926F6@marvell.com> In-Reply-To: <8C0FC31B-681F-4541-AD64-43578FC926F6@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.3 (demeter1.kernel.org [140.211.167.41]); Tue, 28 Sep 2010 07:41:19 +0000 (UTC) diff --git a/drivers/mmc/host/sdhci-cns3xxx.c b/drivers/mmc/host/sdhci-cns3xxx.c index b7050b3..27c896d 100644 --- a/drivers/mmc/host/sdhci-cns3xxx.c +++ b/drivers/mmc/host/sdhci-cns3xxx.c @@ -91,7 +91,6 @@ struct sdhci_pltfm_data sdhci_cns3xxx_pdata = { .quirks = SDHCI_QUIRK_BROKEN_DMA | SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | SDHCI_QUIRK_INVERTED_WRITE_PROTECT | - SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | SDHCI_QUIRK_NONSTANDARD_CLOCK, }; diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 451fad3..64af676 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1799,18 +1799,20 @@ int sdhci_add_host(struct sdhci_host *host) mmc_dev(host->mmc)->dma_mask = &host->dma_mask; } - host->max_clk = - (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; - host->max_clk *= 1000000; - if (host->max_clk == 0 || host->quirks & - SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN) { - if (!host->ops->get_max_clock) { - printk(KERN_ERR - "%s: Hardware doesn't specify base clock " - "frequency.\n", mmc_hostname(mmc)); - return -ENODEV; - } + if (host->ops->get_max_clock) { host->max_clk = host->ops->get_max_clock(host); + } else { + host->max_clk = + (caps & SDHCI_CLOCK_BASE_MASK) + >> SDHCI_CLOCK_BASE_SHIFT; + host->max_clk *= 1000000; + } + + if (host->max_clk == 0 ) { + printk(KERN_ERR + "%s: Hardware doesn't specify base clock " + "frequency.\n", mmc_hostname(mmc)); + return -ENODEV; } host->timeout_clk = diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index f8c18cd..7c15bc5 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -237,8 +237,6 @@ struct sdhci_host { #define SDHCI_QUIRK_DELAY_AFTER_POWER (1<<23) /* Controller uses SDCLK instead of TMCLK for data timeouts */ #define SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK (1<<24) -/* Controller reports wrong base clock capability */ -#define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN (1<<25) /* Controller cannot support End Attribute in NOP ADMA descriptor */ #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC (1<<26) /* Controller is missing device caps. Use caps provided by host */