From: Rich.jiangyk Date: Thu, 16 Sep 2010 07:00:10 +0000 (+0800) Subject: update rk2818_backlight.c to correct bl suspend and resume X-Git-Tag: firefly_0821_release~11134 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=29b3db33b44bcbb0d9c399aad9939446927c9516;p=firefly-linux-kernel-4.4.55.git update rk2818_backlight.c to correct bl suspend and resume 1. old rk2818_backlight.c use CONFIG_ANDROID_POWER macro, which is no longer supported, lyx changed to use CONFIG_HAS_EARLYSUSPEND. This sovled lcd blanking when resuming. 2. changed backlight module init into late_initcall from rootfs_initcall, this solve the problem of blanking when powered on. 3. updated: close dbg info and comments. note: code mod by lyx, commited by jyk --- diff --git a/drivers/video/backlight/rk2818_backlight.c b/drivers/video/backlight/rk2818_backlight.c index e44f2e3d1db5..759b79adc239 100644 --- a/drivers/video/backlight/rk2818_backlight.c +++ b/drivers/video/backlight/rk2818_backlight.c @@ -41,7 +41,7 @@ /* * Debug */ -#if 1 +#if 0 #define DBG(x...) printk(KERN_INFO x) #else #define DBG(x...) @@ -193,7 +193,9 @@ static void rk2818_bl_suspend(struct early_suspend *h) } else { divh = div_total; } - DBG("%s: ========== jyk suspend =============== \n",__func__); + + DBG("%s: ========== suspend =============== \n",__func__); + write_pwm_reg(id, PWM_REG_HRC, divh); suspend_flag = 1; @@ -242,7 +244,7 @@ static int rk2818_backlight_probe(struct platform_device *pdev) u32 divh, div_total; struct clk* arm_pclk; - DBG("%s::============== jyk ==========================\n",__func__); + DBG("%s::=======================================\n",__func__); if (rk2818_bl) { DBG(KERN_CRIT "%s: backlight device register has existed \n",