diff options
author | Dong Aisheng <b29396@freescale.com> | 2013-11-11 14:53:58 +0800 |
---|---|---|
committer | Octavian Purdila <octavian.purdila@nxp.com> | 2017-02-23 14:21:42 +0200 |
commit | d1752d2a94d9fe60e85f09a2cf741680b9fc6c8c (patch) | |
tree | 37596c30753b011e82bc4b3abe7f173c344c147a /drivers/mmc/host/sdhci-esdhc-imx.c | |
parent | 1af216a1642e09343285c5325b2fd1f99b30e859 (diff) |
MLK-11685-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>
(cherry picked from commit 64994f7115573c9ede53b51536b2c15f7cf0112a)
Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
Conflicts:
drivers/mmc/host/sdhci-esdhc-imx.c
Diffstat (limited to 'drivers/mmc/host/sdhci-esdhc-imx.c')
-rw-r--r-- | drivers/mmc/host/sdhci-esdhc-imx.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 165c919223df..4528df638d8d 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-imx.h> #include <linux/io.h> #include <linux/delay.h> #include <linux/err.h> @@ -1243,6 +1244,9 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) pltfm_host->clk = imx_data->clk_per; pltfm_host->clock = clk_get_rate(pltfm_host->clk); + + 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); @@ -1310,6 +1314,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; @@ -1372,6 +1377,8 @@ static int sdhci_esdhc_runtime_suspend(struct device *dev) } clk_disable_unprepare(imx_data->clk_ahb); + release_bus_freq(BUS_FREQ_HIGH); + return ret; } @@ -1381,6 +1388,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 = sdhci_pltfm_priv(pltfm_host); + request_bus_freq(BUS_FREQ_HIGH); + if (!sdhci_sdio_irq_enabled(host)) { clk_prepare_enable(imx_data->clk_per); clk_prepare_enable(imx_data->clk_ipg); |