summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/video/mxsfb.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 571b6f0..44004b1 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -28,6 +28,7 @@
#endif
#define PS2KHZ(ps) (1000000000UL / (ps))
+#define WAIT_FOR_VSYNC_TIMEOUT 1000000
static GraphicDevice panel;
struct mxs_dma_desc desc;
@@ -166,15 +167,18 @@ static void mxs_lcd_init(GraphicDevice *panel,
void lcdif_power_down()
{
- u32 val;
struct mxs_lcdif_regs *regs = (struct mxs_lcdif_regs *)(panel.isaBase);
+ int timeout = WAIT_FOR_VSYNC_TIMEOUT;
writel(panel.frameAdrs, &regs->hw_lcdif_cur_buf);
writel(panel.frameAdrs, &regs->hw_lcdif_next_buf);
-
- /* Stop lcdif */
- val = LCDIF_CTRL_SFTRST | LCDIF_CTRL_CLKGATE;
- writel(val, &regs->hw_lcdif_ctrl);
+ writel(LCDIF_CTRL1_VSYNC_EDGE_IRQ, &regs->hw_lcdif_ctrl1_clr);
+ while (--timeout) {
+ if (readl(&regs->hw_lcdif_ctrl1) & LCDIF_CTRL1_VSYNC_EDGE_IRQ)
+ break;
+ udelay(1);
+ }
+ mxs_reset_block((struct mxs_register_32 *)&regs->hw_lcdif_ctrl);
}
void *video_hw_init(void)