From: Zhou weixin Date: Wed, 31 Aug 2016 12:58:15 +0000 (+0800) Subject: backlight: move the backlight off operation to the front of the LCD X-Git-Tag: firefly_0821_release~1616 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6633ff603d26f915d92e42edf68f6bebfd8e7c1c;p=firefly-linux-kernel-4.4.55.git backlight: move the backlight off operation to the front of the LCD The backlight pwm operation depends on vop module if vop_pwm enabled. Change-Id: I5b87e4dabb4ef3767344a60e7e324d23fbbbc1cd Signed-off-by: Zhou weixin --- diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index bddc8b17a4d8..c2ab0cd0cf71 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -46,7 +46,8 @@ static int fb_notifier_callback(struct notifier_block *self, int fb_blank = 0; /* If we aren't interested in this event, skip it immediately ... */ - if (event != FB_EVENT_BLANK && event != FB_EVENT_CONBLANK) + if (event != FB_EVENT_BLANK && event != FB_EVENT_CONBLANK && + event != FB_EARLY_EVENT_BLANK) return 0; bd = container_of(self, struct backlight_device, fb_notif); @@ -56,7 +57,8 @@ static int fb_notifier_callback(struct notifier_block *self, bd->ops->check_fb(bd, evdata->info)) { fb_blank = *(int *)evdata->data; if (fb_blank == FB_BLANK_UNBLANK && - !bd->fb_bl_on[node]) { + !bd->fb_bl_on[node] && + event != FB_EARLY_EVENT_BLANK) { bd->fb_bl_on[node] = true; if (!bd->use_count++) { bd->props.state &= ~BL_CORE_FBBLANK; @@ -64,7 +66,8 @@ static int fb_notifier_callback(struct notifier_block *self, backlight_update_status(bd); } } else if (fb_blank != FB_BLANK_UNBLANK && - bd->fb_bl_on[node]) { + bd->fb_bl_on[node] && + event == FB_EARLY_EVENT_BLANK) { bd->fb_bl_on[node] = false; if (!(--bd->use_count)) { bd->props.state |= BL_CORE_FBBLANK;