summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorDong Aisheng <b29396@freescale.com>2014-01-17 10:23:22 +0800
committerNitin Garg <nitin.garg@freescale.com>2015-01-15 21:18:01 -0600
commit4a72202581e2c19653776dfb9be382122890566f (patch)
treed6bb3ab2f2925538510319e9bf8219d5c08afd30 /drivers/mmc
parente1421fd2da3cdf861146f32ff2294f8c51099e74 (diff)
ENGR00295564 mmc: sdhci-esdhc-imx: no need busfreq for imx6qdl
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)
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 9b5968027907..a3959fd0902c 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -117,6 +117,8 @@
#define ESDHC_FLAG_HAVE_CAP1 BIT(6)
/* The IP has errata ERR004536 */
#define ESDHC_FLAG_ERR004536 BIT(7)
+/* need request bus freq during low power */
+#define ESDHC_FLAG_BUSFREQ BIT(8)
struct esdhc_soc_data {
u32 flags;
@@ -144,7 +146,8 @@ 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_HAVE_CAP1 | ESDHC_FLAG_ERR004536
+ | ESDHC_FLAG_BUSFREQ,
};
struct pltfm_imx_data {
@@ -1012,7 +1015,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);
@@ -1166,7 +1170,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;
@@ -1209,7 +1214,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);
+ if (imx_data->socdata->flags & ESDHC_FLAG_BUSFREQ)
+ release_bus_freq(BUS_FREQ_HIGH);
return ret;
}
@@ -1220,7 +1226,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);
+ 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);