lkml.org 
[lkml]   [2016]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/5] mmc: dw_mmc: add power domain support
Date
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/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

\
 
 \ /
  Last update: 2016-07-29 07:02    [W:0.093 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site