From patchwork Fri Nov 1 07:19:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Popov X-Patchwork-Id: 287714 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 8232E2C0402 for ; Fri, 1 Nov 2013 18:19:30 +1100 (EST) Received: from mail-la0-x22c.google.com (mail-la0-x22c.google.com [IPv6:2a00:1450:4010:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 0B7F42C03FE for ; Fri, 1 Nov 2013 18:16:29 +1100 (EST) Received: by mail-la0-f44.google.com with SMTP id ep20so3098702lab.17 for ; Fri, 01 Nov 2013 00:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=/Qq6Yh1TYyYQUI+OcsXiI8Q5ohyNoftFyZ6Tx8DTutg=; b=B8dRMk3Y2DJVkmov0l1mQF6dKmDdjsLGA7xJaoeLaD6mC4ygJOty8HBBOii11UNjpi bgUD9Yvg0nbULs7ynHzLMIuuVoIzzM0m1XE+HVqrhjl6K946xMKZSY99OgbSRrlKnX4n rzotnRkEaCyI20EIUx8TLdie97ZOWqTQQ2RqKL9dFshrpPo/cGm1IzKajqpdb4p3dGc/ wQ5Z5GyYpPGmuEkRD8Vte3w6iemEkRQfi8+MJ1zwOopYN/ZYbBcDmlMARWtvpIE0LSDC hEcM6nGt733LpSUTS4vVPEQUS7YJym8rlkvdVzlWEGJ8Mpn4SE60DoujzE0VlWMaaZ/1 Tzvg== X-Received: by 10.152.28.7 with SMTP id x7mr991487lag.26.1383290185602; Fri, 01 Nov 2013 00:16:25 -0700 (PDT) Received: from a13xCCC.localdomain (mail.tecon.ru. [89.175.104.62]) by mx.google.com with ESMTPSA id qj3sm5410018lbb.6.2013.11.01.00.16.24 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 01 Nov 2013 00:16:24 -0700 (PDT) From: Alexander Popov To: Gerhard Sittig , Dan Williams , Vinod Koul , Lars-Peter Clausen , Arnd Bergmann , Anatolij Gustschin , Alexander Popov , linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org Subject: [PATCH RFC v5 5/5] HACK mmc: mxcmmc: enable clocks for the MPC512x Date: Fri, 1 Nov 2013 11:19:34 +0400 Message-Id: <1383290374-17484-6-git-send-email-a13xp0p0v88@gmail.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1383290374-17484-1-git-send-email-a13xp0p0v88@gmail.com> References: <1383290374-17484-1-git-send-email-a13xp0p0v88@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16rc2 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Gerhard Sittig Q&D HACK to enable SD card support without correct COMMON_CLK support, best viewed with 'git diff -w -b', NOT acceptable for mainline (NAKed) Signed-off-by: Gerhard Sittig --- drivers/mmc/host/mxcmmc.c | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index c174c6a..ae13bc9 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c @@ -1123,20 +1123,29 @@ static int mxcmci_probe(struct platform_device *pdev) host->res = r; host->irq = irq; - host->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); - if (IS_ERR(host->clk_ipg)) { - ret = PTR_ERR(host->clk_ipg); - goto out_iounmap; - } + if (!is_mpc512x_mmc(host)) { + host->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); + if (IS_ERR(host->clk_ipg)) { + ret = PTR_ERR(host->clk_ipg); + goto out_iounmap; + } - host->clk_per = devm_clk_get(&pdev->dev, "per"); - if (IS_ERR(host->clk_per)) { - ret = PTR_ERR(host->clk_per); - goto out_iounmap; + host->clk_per = devm_clk_get(&pdev->dev, "per"); + if (IS_ERR(host->clk_per)) { + ret = PTR_ERR(host->clk_per); + goto out_iounmap; + } + } else { + host->clk_per = devm_clk_get(&pdev->dev, "sdhc_clk"); + if (IS_ERR(host->clk_per)) { + ret = PTR_ERR(host->clk_per); + goto out_iounmap; + } } clk_prepare_enable(host->clk_per); - clk_prepare_enable(host->clk_ipg); + if (host->clk_ipg) + clk_prepare_enable(host->clk_ipg); mxcmci_softreset(host); @@ -1206,7 +1215,8 @@ out_free_dma: dma_release_channel(host->dma); out_clk_put: clk_disable_unprepare(host->clk_per); - clk_disable_unprepare(host->clk_ipg); + if (host->clk_ipg) + clk_disable_unprepare(host->clk_ipg); out_iounmap: iounmap(host->base); out_free: @@ -1236,7 +1246,8 @@ static int mxcmci_remove(struct platform_device *pdev) dma_release_channel(host->dma); clk_disable_unprepare(host->clk_per); - clk_disable_unprepare(host->clk_ipg); + if (host->clk_ipg) + clk_disable_unprepare(host->clk_ipg); release_mem_region(host->res->start, resource_size(host->res)); @@ -1255,7 +1266,8 @@ static int mxcmci_suspend(struct device *dev) if (mmc) ret = mmc_suspend_host(mmc); clk_disable_unprepare(host->clk_per); - clk_disable_unprepare(host->clk_ipg); + if (host->clk_ipg) + clk_disable_unprepare(host->clk_ipg); return ret; } @@ -1267,7 +1279,8 @@ static int mxcmci_resume(struct device *dev) int ret = 0; clk_prepare_enable(host->clk_per); - clk_prepare_enable(host->clk_ipg); + if (host->clk_ipg) + clk_prepare_enable(host->clk_ipg); if (mmc) ret = mmc_resume_host(mmc);