[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1469765703-30999-5-git-send-email-shawn.lin@rock-chips.com>
Date: Fri, 29 Jul 2016 12:15:02 +0800
From: Shawn Lin <shawn.lin@...k-chips.com>
To: Heiko Stuebner <heiko@...ech.de>, Rob Herring <robh+dt@...nel.org>,
Jaehoon Chung <jh80.chung@...sung.com>,
Ulf Hansson <ulf.hansson@...aro.org>
Cc: linux-mmc@...r.kernel.org, devicetree@...r.kernel.org,
linux-rockchip@...ts.infradead.org,
Douglas Anderson <dianders@...omium.org>,
Brian Norris <briannorris@...omium.org>,
Feng Xiao <xf@...k-chips.com>,
Elaine Zhang <zhangqing@...k-chips.com>,
linux-kernel@...r.kernel.org, Shawn Lin <shawn.lin@...k-chips.com>
Subject: [PATCH 4/5] mmc: dw_mmc: add power domain support
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@...k-chips.com>
---
drivers/mmc/host/dw_mmc.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 32380d5..8b39168 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -22,6 +22,8 @@
#include <linux/ioport.h>
#include <linux/module.h>
#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
+#include <linux/pm_opp.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/stat.h>
@@ -3024,6 +3026,9 @@ int dw_mci_probe(struct dw_mci *host)
host->bus_hz = clk_get_rate(host->ciu_clk);
}
+ pm_runtime_enable(host->dev);
+ pm_runtime_get_sync(host->dev);
+
if (!host->bus_hz) {
dev_err(host->dev,
"Platform data must supply bus speed\n");
@@ -3197,6 +3202,9 @@ err_clk_biu:
if (!IS_ERR(host->biu_clk))
clk_disable_unprepare(host->biu_clk);
+ pm_runtime_put(host->dev);
+ pm_runtime_disable(host->dev);
+
return ret;
}
EXPORT_SYMBOL(dw_mci_probe);
@@ -3226,6 +3234,9 @@ void dw_mci_remove(struct dw_mci *host)
if (!IS_ERR(host->biu_clk))
clk_disable_unprepare(host->biu_clk);
+
+ pm_runtime_put(host->dev);
+ pm_runtime_disable(host->dev);
}
EXPORT_SYMBOL(dw_mci_remove);
--
2.3.7
Powered by blists - more mailing lists