From 3288119c797e5d173db0b43063587a11bac57095 Mon Sep 17 00:00:00 2001 From: Kuogee Hsieh Date: Wed, 31 Oct 2012 13:29:48 -0700 Subject: [PATCH] msm_fb: display: force mdp clock off at suspend At suspend, turn off mdp related clocks off if clocks are not turned off by vsync disable request. Change-Id: I0949b00b9ee0aee05b9b553ac7318b647052d94d Signed-off-by: Kuogee Hsieh (cherry picked from commit 780557dc178fc5511f4c03b4840791d27499a5f6) --- drivers/video/msm/mdp4_overlay_dsi_cmd.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/video/msm/mdp4_overlay_dsi_cmd.c b/drivers/video/msm/mdp4_overlay_dsi_cmd.c index 5c4eff45cc6d..e11800e42bfd 100644 --- a/drivers/video/msm/mdp4_overlay_dsi_cmd.c +++ b/drivers/video/msm/mdp4_overlay_dsi_cmd.c @@ -1046,6 +1046,7 @@ int mdp4_dsi_cmd_off(struct platform_device *pdev) struct vsync_update *vp; int undx; int need_wait, cnt; + unsigned long flags; pr_debug("%s+: pid=%d\n", __func__, current->pid); @@ -1080,11 +1081,16 @@ int mdp4_dsi_cmd_off(struct platform_device *pdev) } } - /* message for system suspnded */ - if (cnt > 10) - pr_err("%s:Error, mdp clocks NOT off\n", __func__); - else - pr_debug("%s: mdp clocks off at cnt=%d\n", __func__, cnt); + if (cnt > 10) { + spin_lock_irqsave(&vctrl->spin_lock, flags); + vctrl->clk_control = 0; + vctrl->clk_enabled = 0; + vctrl->expire_tick = 0; + spin_unlock_irqrestore(&vctrl->spin_lock, flags); + mipi_dsi_clk_cfg(0); + mdp_clk_ctrl(0); + pr_err("%s: Error, SET_CLK_OFF by force\n", __func__); + } /* sanity check, free pipes besides base layer */ mdp4_overlay_unset_mixer(pipe->mixer_num);