From patchwork Mon Feb 14 06:59:28 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Rakity X-Patchwork-Id: 554111 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 p1E73UAD011132 for ; Mon, 14 Feb 2011 07:03:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751534Ab1BNHDi (ORCPT ); Mon, 14 Feb 2011 02:03:38 -0500 Received: from na3sys009aog114.obsmtp.com ([74.125.149.211]:39968 "EHLO na3sys009aog114.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751373Ab1BNHDh convert rfc822-to-8bit (ORCPT ); Mon, 14 Feb 2011 02:03:37 -0500 Received: from source ([65.219.4.130]) (using TLSv1) by na3sys009aob114.postini.com ([74.125.148.12]) with SMTP ID DSNKTVjTySjowiTssvmYKyL1fq1A/BaJDewd@postini.com; Sun, 13 Feb 2011 23:03:37 PST Received: from SC-vEXCH3.marvell.com ([10.93.76.133]) by sc-owa02.marvell.com ([10.93.76.22]) with mapi; Sun, 13 Feb 2011 22:59:31 -0800 From: Philip Rakity To: "linux-mmc@vger.kernel.org" CC: Mark Brown Date: Sun, 13 Feb 2011 22:59:28 -0800 Subject: [PATCH 2/5] sdhci: sdhci-pxa.c ensure clocks are enabled on all SD controllers Thread-Topic: [PATCH 2/5] sdhci: sdhci-pxa.c ensure clocks are enabled on all SD controllers Thread-Index: AcvMFLolpvO9wcXiTb+B2z6UANqkdg== Message-ID: <99D274AD-18F8-4C30-836B-189C143FF21A@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]); Mon, 14 Feb 2011 07:03:38 +0000 (UTC) diff --git a/drivers/mmc/host/sdhci-pxa.c b/drivers/mmc/host/sdhci-pxa.c index 4713238..8c60d5c 100644 --- a/drivers/mmc/host/sdhci-pxa.c +++ b/drivers/mmc/host/sdhci-pxa.c @@ -35,7 +35,7 @@ struct sdhci_pxa { struct clk *clk; struct resource *res; - u8 clk_enable; + u8 clk_enable; }; /*****************************************************************************\ @@ -43,25 +43,17 @@ struct sdhci_pxa { * SDHCI core callbacks * * * \*****************************************************************************/ -static void set_clock(struct sdhci_host *host, unsigned int clock) +static void enable_clock(struct sdhci_host *host) { struct sdhci_pxa *pxa = sdhci_priv(host); - if (clock == 0) { - if (pxa->clk_enable) { - clk_disable(pxa->clk); - pxa->clk_enable = 0; - } - } else { - if (0 == pxa->clk_enable) { - clk_enable(pxa->clk); - pxa->clk_enable = 1; - } + if (pxa->clk_enable == 0) { + clk_enable(pxa->clk); + pxa->clk_enable = 1; } } static struct sdhci_ops sdhci_pxa_ops = { - .set_clock = set_clock, }; /*****************************************************************************\ @@ -136,6 +128,9 @@ static int __devinit sdhci_pxa_probe(struct platform_device *pdev) if (pdata->flags & PXA_FLAG_SD_8_BIT_CAPABLE_SLOT) host->mmc->caps |= MMC_CAP_8_BIT_DATA; + /* do not rely on u-boot to enable the clocks */ + enable_clock(host); + ret = sdhci_add_host(host); if (ret) { dev_err(&pdev->dev, "failed to add host\n"); @@ -181,10 +176,6 @@ static int __devexit sdhci_pxa_remove(struct platform_device *pdev) if (pxa->res) release_mem_region(pxa->res->start, resource_size(pxa->res)); - if (pxa->clk_enable) { - clk_disable(pxa->clk); - pxa->clk_enable = 0; - } clk_put(pxa->clk); sdhci_free_host(host);