summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorDong Aisheng <b29396@freescale.com>2013-11-11 14:53:58 +0800
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 08:47:09 -0500
commiteb22f8818c423968993d478014059fed2f1874e4 (patch)
tree06b5837e47e9b858664eccdcefe6c354ab747802 /drivers/mmc
parent59dcd71f323dde9ddc019baad92362a65b0e2b54 (diff)
ENGR00287331-2 sdhci-esdhc-imx: use bus freq in runtime pm
Request BUS_FREQ_HIGH when bus is busy and then release BUS_FREQ_HIGH when bus becomes idle. Signed-off-by: Dong Aisheng <b29396@freescale.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 3faf738b7f45..26a0f762d644 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -11,6 +11,7 @@
* the Free Software Foundation; either version 2 of the License.
*/
+#include <linux/busfreq-imx6.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/err.h>
@@ -1021,6 +1022,8 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
pltfm_host->clk = imx_data->clk_per;
+ request_bus_freq(BUS_FREQ_HIGH);
+
clk_prepare_enable(imx_data->clk_per);
clk_prepare_enable(imx_data->clk_ipg);
clk_prepare_enable(imx_data->clk_ahb);
@@ -1157,6 +1160,7 @@ disable_clk:
clk_disable_unprepare(imx_data->clk_per);
clk_disable_unprepare(imx_data->clk_ipg);
clk_disable_unprepare(imx_data->clk_ahb);
+ release_bus_freq(BUS_FREQ_HIGH);
free_sdhci:
sdhci_pltfm_free(pdev);
return err;
@@ -1197,6 +1201,8 @@ static int sdhci_esdhc_runtime_suspend(struct device *dev)
clk_disable_unprepare(imx_data->clk_ipg);
clk_disable_unprepare(imx_data->clk_ahb);
+ release_bus_freq(BUS_FREQ_HIGH);
+
return ret;
}
@@ -1206,6 +1212,8 @@ static int sdhci_esdhc_runtime_resume(struct device *dev)
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct pltfm_imx_data *imx_data = pltfm_host->priv;
+ request_bus_freq(BUS_FREQ_HIGH);
+
clk_prepare_enable(imx_data->clk_per);
clk_prepare_enable(imx_data->clk_ipg);
clk_prepare_enable(imx_data->clk_ahb);