summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLiu Ying <Ying.Liu@freescale.com>2011-06-22 14:26:05 +0800
committerAlex Gonzalez <alex.gonzalez@digi.com>2011-12-15 17:11:46 +0100
commit9e2616a6886ee12d424c64f30dec9c3ea7d85d03 (patch)
tree000ef54225cdb1c4cde7439db063bda59503a66d /drivers
parent9dfb6dad82a6e0dd396f9c1fa722be16073d50a8 (diff)
ENGR00144112 TVE:Fix potential hang issue for suspend
Framebuffer suspend event comes before framebuffer blank event when system entering suspend mode. So, if another driver calls FB_EVENT_BLANK notifier chain, i.e, Android IPUv3 fb driver, the suspend and blank event handlers registered in TVE driver will be called. We used to disable TVE clock in suspend handler, so it causes system hang when we try to access TVE register when go to blank handler. This patch fixes this issue. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/mxc/tve.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/video/mxc/tve.c b/drivers/video/mxc/tve.c
index 3c7be5a21fe8..e57eb88689b0 100644
--- a/drivers/video/mxc/tve.c
+++ b/drivers/video/mxc/tve.c
@@ -101,6 +101,7 @@
#define IPU_DISP_PORT 1
static int enabled; /* enable power on or not */
+static int enabled_before_suspend;
DEFINE_SPINLOCK(tve_lock);
static struct fb_info *tve_fbi;
@@ -929,8 +930,11 @@ static int tve_suspend(void)
__raw_writel(0, tve.base + tve_regs->tve_int_cont_reg);
__raw_writel(0, tve.base + tve_regs->tve_cd_cont_reg);
__raw_writel(0, tve.base + tve_regs->tve_com_conf_reg);
- clk_disable(tve.clk);
- }
+ tve_disable();
+ enabled_before_suspend = 1;
+ } else
+ enabled_before_suspend = 0;
+
return 0;
}
@@ -938,7 +942,7 @@ static int tve_resume(struct fb_info *fbi)
{
int mode;
- if (enabled) {
+ if (enabled_before_suspend) {
clk_enable(tve.clk);
/* Setup cable detect */