From: Tomi Valkeinen Date: Wed, 1 Jun 2011 12:56:39 +0000 (+0300) Subject: OMAP: DSS2: DSS: Fix context save/restore X-Git-Tag: next-20110802~78^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=69f06054aad122b314cd64fdafdf14fc3b8e5b7c;p=karo-tx-linux.git 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 --- diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c index 2424064c9cef..9423a2ee3aac 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c @@ -74,6 +74,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; @@ -109,12 +110,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) & @@ -122,6 +130,8 @@ static void dss_restore_context(void) RR(SDI_CONTROL); RR(PLL_CONTROL); } + + DSSDBG("context restored\n"); } #undef SR