From 1b5400db39e16551d960e784d2b18478d36f34ce Mon Sep 17 00:00:00 2001 From: Dong Aisheng Date: Mon, 11 Nov 2013 14:53:58 +0800 Subject: [PATCH] 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 (cherry picked from commit 64994f7115573c9ede53b51536b2c15f7cf0112a) Signed-off-by: Haibo Chen Conflicts: drivers/mmc/host/sdhci-esdhc-imx.c --- drivers/mmc/host/sdhci-esdhc-imx.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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 #include #include #include @@ -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); -- 2.17.1