From: Liu Ying Date: Fri, 18 Jan 2013 08:33:00 +0000 (+0800) Subject: ENGR00240740-3 IPUv3 fb:Workaround bootup ipu error X-Git-Tag: v3.0.35-fsl~145 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c7b0326aaf73dd297258571ff12860f6c99c4110;p=karo-tx-linux.git ENGR00240740-3 IPUv3 fb:Workaround bootup ipu error 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 (cherry picked from commit 5528e415659a60f3c6d67db96692befb3302a58a) --- diff --git a/drivers/video/mxc/mxc_ipuv3_fb.c b/drivers/video/mxc/mxc_ipuv3_fb.c index 8038f3de81c5..e8a33987280c 100644 --- a/drivers/video/mxc/mxc_ipuv3_fb.c +++ b/drivers/video/mxc/mxc_ipuv3_fb.c @@ -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) - * cannot eventually disables the clock to - * damage the channel. + * channel neatly and re-initialize it . */ if (mxcfbi->next_blank == FB_BLANK_UNBLANK) { console_lock();