aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2011-06-01 15:56:39 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-06-06 10:24:41 +0300
commit3c6c34a31624acd4479086283a246d0f4b42f35e (patch)
tree3c6a812d4f312e78cceff4f30b4a9ec3bde1c923
parent81c0514b628c3e730d8f25ef82247cfa976fc370 (diff)
downloadkernel_samsung_tuna-3c6c34a31624acd4479086283a246d0f4b42f35e.zip
kernel_samsung_tuna-3c6c34a31624acd4479086283a246d0f4b42f35e.tar.gz
kernel_samsung_tuna-3c6c34a31624acd4479086283a246d0f4b42f35e.tar.bz2
OMAP: DSS2: DSS: Fix context save/restore
The current method of saving and restoring the context could cause a restore before saving, effectively "restoring" zero values to registers. Add ctx_valid field to indicate if the saved context is valid and can be restored. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/omap2/dss/dss.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 91572b6..964eb08 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -77,6 +77,7 @@ static struct {
enum omap_dss_clk_source dispc_clk_source;
enum omap_dss_clk_source lcd_clk_source[MAX_DSS_LCD_MANAGERS];
+ bool ctx_valid;
u32 ctx[DSS_SZ_REGS / sizeof(u32)];
} dss;
@@ -112,12 +113,19 @@ static void dss_save_context(void)
SR(SDI_CONTROL);
SR(PLL_CONTROL);
}
+
+ dss.ctx_valid = true;
+
+ DSSDBG("context saved\n");
}
static void dss_restore_context(void)
{
DSSDBG("dss_restore_context\n");
+ if (!dss.ctx_valid)
+ return;
+
RR(CONTROL);
if (dss_feat_get_supported_displays(OMAP_DSS_CHANNEL_LCD) &
@@ -125,6 +133,8 @@ static void dss_restore_context(void)
RR(SDI_CONTROL);
RR(PLL_CONTROL);
}
+
+ DSSDBG("context restored\n");
}
#undef SR