backlight:fix resume backlight flash
authoryzq <yzq@rock-chips.com>
Thu, 17 Jan 2013 10:06:03 +0000 (18:06 +0800)
committeryzq <yzq@rock-chips.com>
Thu, 17 Jan 2013 10:06:03 +0000 (18:06 +0800)
drivers/video/backlight/rk29_backlight.c

index 7f2fa1640cb3c1b1811d9d5021f4a9e9a21c0468..5b4f473b626a7c9949f09ef1a0037d50d745c720 100755 (executable)
@@ -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: