diff options
author | Dong Aisheng <b29396@freescale.com> | 2013-11-11 14:53:58 +0800 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:20:42 +0300 |
commit | 369f5757ad5a9e7a6c07fc2952dd3765dc2aed68 (patch) | |
tree | 499e2fa1d5f0a69bf33c714d7545417f0af83057 /drivers/mmc/host/sdhci-esdhc-imx.c | |
parent | 5111f040fab5333b273f66c222ddf1e034184779 (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 a773d04e1198..9b770781b4f0 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> @@ -1244,6 +1245,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); @@ -1311,6 +1315,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; @@ -1373,6 +1378,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; } @@ -1382,6 +1389,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); |