From: Shawn Lin <shawn.lin@rock-chips.com>
To: Heiko Stuebner <heiko@sntech.de>,
Rob Herring <robh+dt@kernel.org>,
Jaehoon Chung <jh80.chung@samsung.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
linux-rockchip@lists.infradead.org,
Douglas Anderson <dianders@chromium.org>,
Brian Norris <briannorris@chromium.org>,
Feng Xiao <xf@rock-chips.com>,
Elaine Zhang <zhangqing@rock-chips.com>,
linux-kernel@vger.kernel.org,
Shawn Lin <shawn.lin@rock-chips.com>
Subject: [PATCH 5/5] mmc: sdhci-of-arasan: add power domain support
Date: Fri, 29 Jul 2016 12:16:45 +0800 [thread overview]
Message-ID: <1469765805-31049-1-git-send-email-shawn.lin@rock-chips.com> (raw)
In-Reply-To: <1469765703-30999-1-git-send-email-shawn.lin@rock-chips.com>
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 <shawn.lin@rock-chips.com>
---
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 <linux/of_device.h>
#include <linux/phy/phy.h>
#include <linux/regmap.h>
+#include <linux/pm_runtime.h>
+#include <linux/pm_opp.h>
#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;
}
--
2.3.7
next prev parent reply other threads:[~2016-07-29 4:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-29 4:14 [PATCH 0/5] Add power domain support for dw_mmc/sdhci-of-arasan Shawn Lin
[not found] ` <1469765703-30999-1-git-send-email-shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-07-29 4:14 ` [PATCH 1/5] Documentation: mmc: synopsys-dw-mshc: add power domain description Shawn Lin
2016-07-29 21:43 ` Rob Herring
2016-07-29 4:15 ` [PATCH 2/5] Documentation: mmc: sdhci-of-arasan: " Shawn Lin
[not found] ` <1469765703-30999-3-git-send-email-shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-07-29 21:43 ` Rob Herring
2016-07-29 4:15 ` [PATCH 3/5] arm64: dts: rockchip: Provide power-domains for sd/sdio/emmc controllers Shawn Lin
2016-07-29 4:15 ` [PATCH 4/5] mmc: dw_mmc: add power domain support Shawn Lin
2016-07-29 4:16 ` Shawn Lin [this message]
2016-07-29 9:21 ` [PATCH 0/5] Add power domain support for dw_mmc/sdhci-of-arasan Ulf Hansson
[not found] ` <CAPDyKFq6itpANwnLqgOqKHT0fJH4SvZi2FWrafa=HSBfiZE52w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-08-01 3:10 ` Shawn Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1469765805-31049-1-git-send-email-shawn.lin@rock-chips.com \
--to=shawn.lin@rock-chips.com \
--cc=briannorris@chromium.org \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=heiko@sntech.de \
--cc=jh80.chung@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=robh+dt@kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=xf@rock-chips.com \
--cc=zhangqing@rock-chips.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).