]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00240740-3 IPUv3 fb:Workaround bootup ipu error
authorLiu Ying <Ying.liu@freescale.com>
Fri, 18 Jan 2013 08:33:00 +0000 (16:33 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:51 +0000 (08:35 +0200)
Enabling IPU hsp clock in mxcfb_probe() context by calling
ipu_init_channel() can avoid the IPU display channel(setup
in bootloader) from being damaged by some IPU common driver
APIS which enable/disable IPU hsp clock when doing driver
probe. However, somehow, after LDO bypass patch set is pushed
to kernel, this clock enablement can trigger IPU errors
(IPU_INT_STAT_5 - 0x00800000/IPU_INT_STAT_10 - 0x00100000) and
a display flash. A workaround is to enable IPU hsp clock when
we are at ipu_probe() context, which is earlier than mxcfb_probe()
context, and then to disable(cleanup) the clock once more when
fb_set_par() is triggered by the user for the first time. This
patch updates the comment for ipu_init_channel() and
ipu_enable_channel() in mxcfb_probe() context, and disables ipu
hsp clock when fb_set_par() is triggered by the user for the first
time.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
(cherry picked from commit 5528e415659a60f3c6d67db96692befb3302a58a)

drivers/video/mxc/mxc_ipuv3_fb.c

index 8038f3de81c58f13a6f4fd67e143233780844a1e..e8a33987280cd69f3c151dfa67decf3524f58b10 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2012 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright 2004-2013 Freescale Semiconductor, Inc. All Rights Reserved.
  */
 
 /*
@@ -481,6 +481,14 @@ static int mxcfb_set_par(struct fb_info *fbi)
        ipu_disable_irq(mxc_fbi->ipu, mxc_fbi->ipu_ch_nf_irq);
        ipu_disable_channel(mxc_fbi->ipu, mxc_fbi->ipu_ch, true);
        ipu_uninit_channel(mxc_fbi->ipu, mxc_fbi->ipu_ch);
+
+       /*
+        * Disable IPU hsp clock if it is enabled for an
+        * additional time in ipu common driver.
+        */
+       if (mxc_fbi->first_set_par && mxc_fbi->late_init)
+               ipu_disable_hsp_clk(mxc_fbi->ipu);
+
        mxcfb_set_fix(fbi);
 
        mem_len = fbi->var.yres_virtual * fbi->fix.line_length;
@@ -2035,15 +2043,7 @@ static int mxcfb_register(struct fb_info *fbi)
                /*
                 * Setup the channel again though bootloader
                 * has done this, then set_par() can stop the
-                * channel and re-initialize it. Moreover,
-                * ipu_init_channel() enables ipu hsp clock,
-                * so we may keep the clock on until user
-                * space triggers set_par(), i.e., any ipu
-                * interface which enables/disables ipu hsp
-                * clock with pair(called in IPUv3 fb driver
-                * or mxc v4l2 driver<probed after fb driver>)
-                * cannot eventually disables the clock to
-                * damage the channel.
+                * channel neatly and re-initialize it .
                 */
                if (mxcfbi->next_blank == FB_BLANK_UNBLANK) {
                        console_lock();