From 56f7baefe24f20c9e7b134bd8c904d08ee9e7a70 Mon Sep 17 00:00:00 2001 From: Liu Ying Date: Fri, 7 Jun 2013 09:05:59 +0800 Subject: ENGR00267118-1 IPU disp:Align setting with kernel To align with kernel display setting so that we may avoid a blank interval during smooth UI transition from uboot to Android desktop on LVDS0(LVDS1 is OK). The code change refers to the following CR: "ENGR00127358 ipuv3: make display data signal negative during blanking period" Signed-off-by: Liu Ying --- drivers/video/ipu_disp.c | 54 +++++++++++++++++++++++++++++------------------- drivers/video/ipu_regs.h | 3 ++- 2 files changed, 35 insertions(+), 22 deletions(-) (limited to 'drivers') diff --git a/drivers/video/ipu_disp.c b/drivers/video/ipu_disp.c index 8f9c583..b9281ff 100644 --- a/drivers/video/ipu_disp.c +++ b/drivers/video/ipu_disp.c @@ -6,7 +6,7 @@ * * Linux IPU driver * - * (C) Copyright 2005-2011 Freescale Semiconductor, Inc. + * (C) Copyright 2005-2013 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -272,22 +272,34 @@ static void ipu_dc_map_clear(int map) } static void ipu_dc_write_tmpl(int word, u32 opcode, u32 operand, int map, - int wave, int glue, int sync) + int wave, int glue, int sync, int stop) { u32 reg; - int stop = 1; - - reg = sync; - reg |= (glue << 4); - reg |= (++wave << 11); - reg |= (++map << 15); - reg |= (operand << 20) & 0xFFF00000; - __raw_writel(reg, ipu_dc_tmpl_reg + word * 2); - - reg = (operand >> 12); - reg |= opcode << 4; - reg |= (stop << 9); - __raw_writel(reg, ipu_dc_tmpl_reg + word * 2 + 1); + + if (opcode == WRG) { + reg = sync; + reg |= (glue << 4); + reg |= (++wave << 11); + reg |= ((operand & 0x1FFFF) << 15); + __raw_writel(reg, ipu_dc_tmpl_reg + word * 2); + + reg = (operand >> 17); + reg |= opcode << 7; + reg |= (stop << 9); + __raw_writel(reg, ipu_dc_tmpl_reg + word * 2 + 1); + } else { + reg = sync; + reg |= (glue << 4); + reg |= (++wave << 11); + reg |= (++map << 15); + reg |= (operand << 20) & 0xFFF00000; + __raw_writel(reg, ipu_dc_tmpl_reg + word * 2); + + reg = (operand >> 12); + reg |= opcode << 4; + reg |= (stop << 9); + __raw_writel(reg, ipu_dc_tmpl_reg + word * 2 + 1); + } } static void ipu_dc_link_event(int chan, int event, int addr, int priority) @@ -1195,13 +1207,13 @@ int32_t ipu_init_sync_panel(int disp, uint32_t pixel_clk, /* Init template microcode */ if (disp) { - ipu_dc_write_tmpl(2, WROD(0), 0, map, SYNC_WAVE, 8, 5); - ipu_dc_write_tmpl(3, WROD(0), 0, map, SYNC_WAVE, 4, 5); - ipu_dc_write_tmpl(4, WROD(0), 0, map, SYNC_WAVE, 0, 5); + ipu_dc_write_tmpl(2, WROD(0), 0, map, SYNC_WAVE, 8, 5, 1); + ipu_dc_write_tmpl(3, WROD(0), 0, map, SYNC_WAVE, 4, 5, 1); + ipu_dc_write_tmpl(4, WROD(0), 0, map, SYNC_WAVE, 0, 5, 1); } else { - ipu_dc_write_tmpl(5, WROD(0), 0, map, SYNC_WAVE, 8, 5); - ipu_dc_write_tmpl(6, WROD(0), 0, map, SYNC_WAVE, 4, 5); - ipu_dc_write_tmpl(7, WROD(0), 0, map, SYNC_WAVE, 0, 5); + ipu_dc_write_tmpl(5, WROD(0), 0, map, SYNC_WAVE, 8, 5, 1); + ipu_dc_write_tmpl(6, WROD(0), 0, map, SYNC_WAVE, 4, 5, 1); + ipu_dc_write_tmpl(7, WROD(0), 0, map, SYNC_WAVE, 0, 5, 1); } if (sig.Hsync_pol) diff --git a/drivers/video/ipu_regs.h b/drivers/video/ipu_regs.h index a60c2b8..4836a41 100644 --- a/drivers/video/ipu_regs.h +++ b/drivers/video/ipu_regs.h @@ -6,7 +6,7 @@ * * Linux IPU driver: * - * (C) Copyright 2005-2011 Freescale Semiconductor, Inc. + * (C) Copyright 2005-2013 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -445,5 +445,6 @@ static inline struct ipu_dc_ch *dc_ch_offset(int ch) /* DC template opcodes */ #define WROD(lf) (0x18 | (lf << 1)) +#define WRG (0x01) #endif -- cgit v1.1