From: yzq Date: Thu, 17 Jan 2013 10:06:03 +0000 (+0800) Subject: backlight:fix resume backlight flash X-Git-Tag: firefly_0821_release~7899 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ab20ea947e9477d12f5ef81400a0a7673d2357b4;p=firefly-linux-kernel-4.4.55.git backlight:fix resume backlight flash --- diff --git a/drivers/video/backlight/rk29_backlight.c b/drivers/video/backlight/rk29_backlight.c index 7f2fa1640cb3..5b4f473b626a 100755 --- a/drivers/video/backlight/rk29_backlight.c +++ b/drivers/video/backlight/rk29_backlight.c @@ -122,6 +122,13 @@ static int rk29_bl_update_status(struct backlight_device *bl) }else if(!(bl->props.state & BL_CORE_DRIVER2) && suspend_flag ){ suspend_flag = 0; } + div_total = read_pwm_reg(PWM_REG_LRC); + if (ref) { + divh = div_total*brightness/BL_STEP; + } else { + divh = div_total*(BL_STEP-brightness)/BL_STEP; + } + rk_pwm_setup(id, PWM_DIV, divh, div_total); //BL_CORE_DRIVER1 is the flag if backlight pwm is closed. if ((bl->props.state & BL_CORE_DRIVER1) && brightness ==0 ){ @@ -137,13 +144,6 @@ static int rk29_bl_update_status(struct backlight_device *bl) msleep(1); } - div_total = read_pwm_reg(PWM_REG_LRC); - if (ref) { - divh = div_total*brightness/BL_STEP; - } else { - divh = div_total*(BL_STEP-brightness)/BL_STEP; - } - rk_pwm_setup(id, PWM_DIV, divh, div_total); DBG("%s:line=%d,brightness = %d, div_total = %d, divh = %d state=%x \n",__FUNCTION__,__LINE__,brightness, div_total, divh,bl->props.state); out: