1 From f19b8f13079c5593c31a5eb381ba5ac734779f84 Mon Sep 17 00:00:00 2001
 
   2 From: Liu Ying <Ying.Liu@freescale.com>
 
   3 Date: Tue, 15 Nov 2011 16:21:25 +0800
 
   4 Subject: [PATCH] ENGR00162195 IPUv3M:Clear IDMAC_LOCK_EN_1 for tough single display
 
   6 This patch clears IDMAC_LOCK_EN_1 for tough single display(dmfc=3).
 
   7 For example, 1080P50/1080P60 with 32bpp fb.
 
   9 Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
 
  10 (cherry picked from commit 204a5fb6af1426c499332224dff00f52bdbef39b)
 
  12  drivers/mxc/ipu3/ipu_common.c |    6 +++++-
 
  13  1 files changed, 5 insertions(+), 1 deletions(-)
 
  15 diff --git a/drivers/mxc/ipu3/ipu_common.c b/drivers/mxc/ipu3/ipu_common.c
 
  16 index baf22dd..18d46b3 100644
 
  17 --- a/drivers/mxc/ipu3/ipu_common.c
 
  18 +++ b/drivers/mxc/ipu3/ipu_common.c
 
  19 @@ -991,7 +991,9 @@ void ipu_uninit_channel(ipu_channel_t channel)
 
  20         __raw_writel(ipu_conf, IPU_CONF);
 
  22         /* Restore IDMAC_LOCK_EN when we don't use dual display */
 
  23 +       /* and the video mode for single display is not tough */
 
  24         if (!(ipu_di_use_count[0] && ipu_di_use_count[1]) &&
 
  25 +           dmfc_type_setup != DMFC_HIGH_RESOLUTION_ONLY_DP &&
 
  26             _ipu_is_dmfc_chan(in_dma) && g_ipu_hw_rev == 3)
 
  27                 __raw_writel(0x003F0000, IDMAC_CH_LOCK_EN_1);
 
  29 @@ -1807,8 +1809,10 @@ int32_t ipu_enable_channel(ipu_channel_t channel)
 
  30         __raw_writel(ipu_conf, IPU_CONF);
 
  32         /* Clear IDMAC_LOCK_EN to workaround black flash for dual display */
 
  33 +       /* and for tough video mode of single display */
 
  34         if (g_ipu_hw_rev == 3 && _ipu_is_dmfc_chan(in_dma)) {
 
  35 -               if (ipu_di_use_count[1] && ipu_di_use_count[0])
 
  36 +               if ((ipu_di_use_count[1] && ipu_di_use_count[0]) ||
 
  37 +                   (dmfc_type_setup == DMFC_HIGH_RESOLUTION_ONLY_DP))
 
  38                         __raw_writel(0x0, IDMAC_CH_LOCK_EN_1);
 
  40                         __raw_writel(0x003F0000, IDMAC_CH_LOCK_EN_1);