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 5/5] mmc: sdhci-of-arasan: 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/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

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