MLK-11685-5 mmc: sdhci-esdhc-imx: no need busfreq for imx6qdl
authorDong Aisheng <b29396@freescale.com>
Fri, 17 Jan 2014 02:23:22 +0000 (10:23 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:48:50 +0000 (14:48 -0500)
The usdhc of i.MX6Q/DL can work well under low power mode without
request high bus freq. So we do not need request bus freq for i.MX6Q/DL.
It can save power for i.MX6D/DL due to it saves a lot busfreq switch
cost as well as the CPU time runing on high bus freq after switch
during low power mode.

A new flag ESDHC_FLAG_BUSFREQ is added to indicated this requirement.
Currently only i.MX6SL is using it.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
(cherry picked from commit 3b954ce55b56dfce195d65b84913ff3c0fcb9f82)
Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
Conflicts:
drivers/mmc/host/sdhci-esdhc-imx.c

drivers/mmc/host/sdhci-esdhc-imx.c

index 9b77078..3e97b79 100644 (file)
 #define ESDHC_FLAG_HS200               BIT(8)
 /* The IP supports HS400 mode */
 #define ESDHC_FLAG_HS400               BIT(9)
+/* need request bus freq during low power */
+#define ESDHC_FLAG_BUSFREQ             BIT(10)
 
 /* A higher clock ferquency than this rate requires strobell dll control */
 #define ESDHC_STROBE_DLL_CLK_FREQ      100000000
@@ -180,7 +182,7 @@ static struct esdhc_soc_data usdhc_imx6q_data = {
 static struct esdhc_soc_data usdhc_imx6sl_data = {
        .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
                        | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_ERR004536
-                       | ESDHC_FLAG_HS200,
+                       | ESDHC_FLAG_HS200 | ESDHC_FLAG_BUSFREQ,
 };
 
 static struct esdhc_soc_data usdhc_imx6sx_data = {
@@ -1246,7 +1248,8 @@ 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);
+       if (imx_data->socdata->flags & ESDHC_FLAG_BUSFREQ)
+               request_bus_freq(BUS_FREQ_HIGH);
 
        clk_prepare_enable(imx_data->clk_per);
        clk_prepare_enable(imx_data->clk_ipg);
@@ -1315,7 +1318,8 @@ 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);
+       if (imx_data->socdata->flags & ESDHC_FLAG_BUSFREQ)
+               release_bus_freq(BUS_FREQ_HIGH);
 free_sdhci:
        sdhci_pltfm_free(pdev);
        return err;
@@ -1378,7 +1382,8 @@ static int sdhci_esdhc_runtime_suspend(struct device *dev)
        }
        clk_disable_unprepare(imx_data->clk_ahb);
 
-       release_bus_freq(BUS_FREQ_HIGH);
+       if (imx_data->socdata->flags & ESDHC_FLAG_BUSFREQ)
+               release_bus_freq(BUS_FREQ_HIGH);
 
        return ret;
 }
@@ -1389,7 +1394,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 (imx_data->socdata->flags & ESDHC_FLAG_BUSFREQ)
+               request_bus_freq(BUS_FREQ_HIGH);
 
        if (!sdhci_sdio_irq_enabled(host)) {
                clk_prepare_enable(imx_data->clk_per);