From patchwork Fri Jul 29 04:16:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Lin X-Patchwork-Id: 9252047 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DBBF9601C0 for ; Fri, 29 Jul 2016 04:20:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D161527E63 for ; Fri, 29 Jul 2016 04:20:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4F9F27F88; Fri, 29 Jul 2016 04:20:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 18CC327E63 for ; Fri, 29 Jul 2016 04:20:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bSzHR-0005Bi-Mv; Fri, 29 Jul 2016 04:20:13 +0000 Received: from lucky1.263xmail.com ([211.157.147.134]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bSzHP-000412-QO for linux-rockchip@lists.infradead.org; Fri, 29 Jul 2016 04:20:12 +0000 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.159]) by lucky1.263xmail.com (Postfix) with SMTP id CB61C856; Fri, 29 Jul 2016 12:19:49 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.263.net (Postfix) with ESMTP id 1A1DA3735; Fri, 29 Jul 2016 12:19:36 +0800 (CST) X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: heiko@sntech.de X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: <95f5b665d36cccaa501077f77c2e658b> X-ATTACHMENT-NUM: 0 X-SENDER: lintao@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 5362JZIXZO; Fri, 29 Jul 2016 12:19:38 +0800 (CST) From: Shawn Lin To: Heiko Stuebner , Rob Herring , Jaehoon Chung , Ulf Hansson Subject: [PATCH 5/5] mmc: sdhci-of-arasan: add power domain support Date: Fri, 29 Jul 2016 12:16:45 +0800 Message-Id: <1469765805-31049-1-git-send-email-shawn.lin@rock-chips.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1469765703-30999-1-git-send-email-shawn.lin@rock-chips.com> References: <1469765703-30999-1-git-send-email-shawn.lin@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160728_212012_174319_073BFBD9 X-CRM114-Status: UNSURE ( 5.42 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Elaine Zhang , Feng Xiao , Shawn Lin , Brian Norris , linux-mmc@vger.kernel.org, Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP We should enable power domain once provided. Otherwise we take risk of bus err as it's maybe in off state before probing. Signed-off-by: Shawn Lin --- drivers/mmc/host/sdhci-of-arasan.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index e0f193f..e507e94 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include "sdhci-pltfm.h" #define SDHCI_ARASAN_CLK_CTRL_OFFSET 0x2c @@ -515,6 +517,9 @@ static int sdhci_arasan_probe(struct platform_device *pdev) goto clk_dis_ahb; } + pm_runtime_enable(host->dev); + pm_runtime_get_sync(host->dev); + sdhci_get_of_property(pdev); pltfm_host->clk = clk_xin; @@ -577,6 +582,8 @@ clk_dis_ahb: clk_disable_unprepare(sdhci_arasan->clk_ahb); err_pltfm_free: sdhci_pltfm_free(pdev); + pm_runtime_put(host->dev); + pm_runtime_disable(host->dev); return ret; } @@ -599,6 +606,9 @@ static int sdhci_arasan_remove(struct platform_device *pdev) clk_disable_unprepare(clk_ahb); + pm_runtime_put(host->dev); + pm_runtime_disable(host->dev); + return ret; }