From patchwork Fri Oct 3 15:55:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Hesselbarth X-Patchwork-Id: 5023541 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CCEE49F32B for ; Fri, 3 Oct 2014 15:57:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E3A482017E for ; Fri, 3 Oct 2014 15:57:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E34E5201C8 for ; Fri, 3 Oct 2014 15:57:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754109AbaJCP5a (ORCPT ); Fri, 3 Oct 2014 11:57:30 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:62490 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754108AbaJCPz7 (ORCPT ); Fri, 3 Oct 2014 11:55:59 -0400 Received: by mail-wi0-f174.google.com with SMTP id cc10so7691534wib.1 for ; Fri, 03 Oct 2014 08:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DCDxh2VDuyYowM/SimxjR0CHt/p3AP9V5OLHwlSLANE=; b=rJ/PvhQpg5Kt4uNnWDO+p9OZ/UJB8bt6krtzbrkTxAsR+Q5SQ0MvNMICoY92x/mF6n vauPGCaN2ZqEGEp+ufAhEiLwo96s55RJVzUtxW2HXJoUe1waIvozDqjYzma+qWxKN7eJ lwLA5E+opAwsvvKxZqTMcdgfCk+GCVOuijqAYONpjdNjh3lrI5m2Xi2kSc/8Ej3q8e0J ov/A3HSHCRP4xlPaL50VIBOr69bREHwDfEBjuyvj+vEu6WriPJ7Kk/2rC4G+BUm0pr9V OyJDKPs1e11llvAhr9dMP+mJnKgCdqCSsfKyD+7l0a4bhi2FUCvl/zvn1dMOb/lD5Qae wKJw== X-Received: by 10.194.237.164 with SMTP id vd4mr8491814wjc.46.1412351757636; Fri, 03 Oct 2014 08:55:57 -0700 (PDT) Received: from topkick.lan (f051009242.adsl.alicedsl.de. [78.51.9.242]) by mx.google.com with ESMTPSA id cy1sm8381692wjc.20.2014.10.03.08.55.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Oct 2014 08:55:56 -0700 (PDT) From: Sebastian Hesselbarth To: Sebastian Hesselbarth Cc: Chris Ball , Ulf Hansson , Antoine Tenart , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/12] mmc: sdhci-pxav3: Move I/O clock to private data Date: Fri, 3 Oct 2014 17:55:41 +0200 Message-Id: <1412351747-4188-7-git-send-email-sebastian.hesselbarth@gmail.com> In-Reply-To: <1412351747-4188-1-git-send-email-sebastian.hesselbarth@gmail.com> References: <1412351747-4188-1-git-send-email-sebastian.hesselbarth@gmail.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As we are using references to the I/O clock throughout the driver, move it to the private data. Also, in preparation for core clock, rename it to clk_io. Signed-off-by: Sebastian Hesselbarth --- Cc: Chris Ball Cc: Ulf Hansson Cc: Antoine Tenart Cc: linux-mmc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/mmc/host/sdhci-pxav3.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c index e52bbbb09d88..a34a589670e6 100644 --- a/drivers/mmc/host/sdhci-pxav3.c +++ b/drivers/mmc/host/sdhci-pxav3.c @@ -59,6 +59,7 @@ #define SDCE_MISC_INT_EN (1<<1) struct sdhci_pxa { + struct clk *clk_io; u8 power_mode; }; @@ -288,9 +289,7 @@ static int sdhci_pxav3_probe(struct platform_device *pdev) struct sdhci_host *host = NULL; struct sdhci_pxa *pxa = NULL; const struct of_device_id *match; - int ret; - struct clk *clk; pxa = devm_kzalloc(&pdev->dev, sizeof(struct sdhci_pxa), GFP_KERNEL); if (!pxa) @@ -310,14 +309,14 @@ static int sdhci_pxav3_probe(struct platform_device *pdev) pltfm_host = sdhci_priv(host); pltfm_host->priv = pxa; - clk = devm_clk_get(dev, NULL); - if (IS_ERR(clk)) { + pxa->clk_io = devm_clk_get(dev, NULL); + if (IS_ERR(pxa->clk_io)) { dev_err(dev, "failed to get io clock\n"); - ret = PTR_ERR(clk); + ret = PTR_ERR(pxa->clk_io); goto err_clk_get; } - pltfm_host->clk = clk; - clk_prepare_enable(clk); + pltfm_host->clk = pxa->clk_io; + clk_prepare_enable(pxa->clk_io); /* enable 1/8V DDR capable */ host->mmc->caps |= MMC_CAP_1_8V_DDR; @@ -390,7 +389,7 @@ err_add_host: pm_runtime_disable(&pdev->dev); err_of_parse: err_cd_req: - clk_disable_unprepare(clk); + clk_disable_unprepare(pxa->clk_io); err_clk_get: err_mbus_win: sdhci_pltfm_free(pdev); @@ -401,12 +400,13 @@ static int sdhci_pxav3_remove(struct platform_device *pdev) { struct sdhci_host *host = platform_get_drvdata(pdev); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct sdhci_pxa *pxa = pltfm_host->priv; pm_runtime_get_sync(&pdev->dev); sdhci_remove_host(host, 1); pm_runtime_disable(&pdev->dev); - clk_disable_unprepare(pltfm_host->clk); + clk_disable_unprepare(pxa->clk_io); sdhci_pltfm_free(pdev); @@ -446,13 +446,14 @@ static int sdhci_pxav3_runtime_suspend(struct device *dev) { struct sdhci_host *host = dev_get_drvdata(dev); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct sdhci_pxa *pxa = pltfm_host->priv; unsigned long flags; spin_lock_irqsave(&host->lock, flags); host->runtime_suspended = true; spin_unlock_irqrestore(&host->lock, flags); - clk_disable_unprepare(pltfm_host->clk); + clk_disable_unprepare(pxa->clk_io); return 0; } @@ -461,9 +462,10 @@ static int sdhci_pxav3_runtime_resume(struct device *dev) { struct sdhci_host *host = dev_get_drvdata(dev); struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct sdhci_pxa *pxa = pltfm_host->priv; unsigned long flags; - clk_prepare_enable(pltfm_host->clk); + clk_prepare_enable(pxa->clk_io); spin_lock_irqsave(&host->lock, flags); host->runtime_suspended = false;