summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBitan Biswas <bbiswas@nvidia.com>2013-11-20 02:13:41 +0530
committerHarry Hong <hhong@nvidia.com>2013-12-12 20:11:46 -0800
commitbe06df21db5747aee304696004e1a0e31afd8f26 (patch)
tree40e2aa1703b86a53e63f4ce12520ca0eb1031bab
parent48bf8856224396d1c065525b328f51982119f3b8 (diff)
mmc: host: sdhci: delayed clock gate update
Changes are: - cancel delayed clock gate work before suspend - sdhci disable does not schedule delayed clock gate work if clock is already disabled bug 1372006 Change-Id: I55160b258d5a28b9e454420768a50ed70a127e9a Signed-off-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-on: http://git-master/r/338618 (cherry picked from commit 3bbbfb7d97825c80fe0f667ce2c7c9062c1660da) Reviewed-on: http://git-master/r/344119 (cherry picked from commit a7ebdd84dc9f7364c1669eddc0e33a34ec1eee39) Reviewed-on: http://git-master/r/345036 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Harry Hong <hhong@nvidia.com> Tested-by: Harry Hong <hhong@nvidia.com>
-rw-r--r--drivers/mmc/host/sdhci-tegra.c6
-rw-r--r--drivers/mmc/host/sdhci.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 8c38b69e871c..571962446e9d 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -1138,10 +1138,11 @@ static void tegra_sdhci_set_clock(struct sdhci_host *sdhci, unsigned int clock)
if (!tegra_host->clk_enabled) {
pm_runtime_get_sync(&pdev->dev);
clk_prepare_enable(pltfm_host->clk);
+ tegra_host->clk_enabled = true;
+ sdhci->is_clk_on = tegra_host->clk_enabled;
ctrl = sdhci_readb(sdhci, SDHCI_VNDR_CLK_CTRL);
ctrl |= SDHCI_VNDR_CLK_CTRL_SDMMC_CLK;
sdhci_writeb(sdhci, ctrl, SDHCI_VNDR_CLK_CTRL);
- tegra_host->clk_enabled = true;
}
tegra_sdhci_set_clk_rate(sdhci, clock);
@@ -1169,8 +1170,9 @@ static void tegra_sdhci_set_clock(struct sdhci_host *sdhci, unsigned int clock)
ctrl &= ~SDHCI_VNDR_CLK_CTRL_SDMMC_CLK;
sdhci_writeb(sdhci, ctrl, SDHCI_VNDR_CLK_CTRL);
clk_disable_unprepare(pltfm_host->clk);
- pm_runtime_put_sync(&pdev->dev);
tegra_host->clk_enabled = false;
+ sdhci->is_clk_on = tegra_host->clk_enabled;
+ pm_runtime_put_sync(&pdev->dev);
}
sdhci->is_clk_on = tegra_host->clk_enabled;
}
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index cafcad2a894c..f49cb1d5565d 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2110,8 +2110,9 @@ int sdhci_disable(struct mmc_host *mmc)
return 0;
if (IS_DELAYED_CLK_GATE(host)) {
- schedule_delayed_work(&host->delayed_clk_gate_wrk,
- DELAYED_CLK_GATING_TICK_TMOUT);
+ if (host->is_clk_on)
+ schedule_delayed_work(&host->delayed_clk_gate_wrk,
+ DELAYED_CLK_GATING_TICK_TMOUT);
return 0;
}
@@ -2680,6 +2681,9 @@ int sdhci_suspend_host(struct sdhci_host *host)
sdhci_mask_irqs(host, SDHCI_INT_ALL_MASK);
+ /* cancel sdio clk gate work */
+ cancel_delayed_work_sync(&host->delayed_clk_gate_wrk);
+
if (host->irq)
disable_irq(host->irq);