summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/dc/dc.c
diff options
context:
space:
mode:
authorNitin Kumbhar <nkumbhar@nvidia.com>2012-03-14 19:40:38 +0530
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-03-21 23:46:45 -0700
commit1cc9675e7798066b16d33ab820e7c489b80e981b (patch)
tree638f50e644f09b3c2f0cdaa7639c0e83425966d0 /drivers/video/tegra/dc/dc.c
parent1857d4711aab59006e2d2d517b96487b170bf609 (diff)
video: tegra: dc: disable disp.emc clock when 0 new rate is requested
Not disabling emc clock when it's being set to zero results in incorrect reference count when a call is made to clear bandwidth. This happens when two worker threads try to handle dc emc rate. A deep-sleep/wake-up cycle easily shows this scenario. With this fix, disp.emc's ref count is properly managed even after multiple deep-sleep/wake-up cycles. Bug 947228 Change-Id: I045fafbd483af1e3d492b8d0395275e45642d059 Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com> Reviewed-on: http://git-master/r/90100 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/dc/dc.c')
-rw-r--r--drivers/video/tegra/dc/dc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c
index 080438b..ac024f6 100644
--- a/drivers/video/tegra/dc/dc.c
+++ b/drivers/video/tegra/dc/dc.c
@@ -993,8 +993,12 @@ static void tegra_dc_program_bandwidth(struct tegra_dc *dc)
/* going from 0 to non-zero */
if (!dc->emc_clk_rate && !tegra_is_clk_enabled(dc->emc_clk))
clk_enable(dc->emc_clk);
+
dc->emc_clk_rate = dc->new_emc_clk_rate;
clk_set_rate(dc->emc_clk, dc->emc_clk_rate);
+
+ if (!dc->new_emc_clk_rate) /* going from non-zero to 0 */
+ clk_disable(dc->emc_clk);
}
for (i = 0; i < DC_N_WINDOWS; i++) {