summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiu Ying <Ying.Liu@freescale.com>2013-06-25 17:13:33 +0800
committerLiu Ying <Ying.Liu@freescale.com>2013-06-25 17:35:38 +0800
commite419bfbf38111e991370b0bbaa978ef217121b95 (patch)
tree268fee2a054f2f080a862f1d6b24ce22309f9b95
parente6fca52e3cffbabe65bf3f8dd277ddfdc29fdbf7 (diff)
ENGR00268508 backlight:Correct the setting for bd props.fb_blank
The patch of "ENGR00264855 backlight: Support backlight shared by multiple fbs" doesn't consider that bd->props.fb_blank could be shared by several framebuffers which use the same backlight device. This causes the pwm backlight wrongly check the fb blank status. This patch corrects the setting for the fb blank status by considering all the framebuffers in question to fix the issue. Signed-off-by: Liu Ying <Ying.Liu@freescale.com> (cherry picked from commit 68b97d114629f22f64b3d8c14d0a0b7d07d6ebb2)
-rw-r--r--drivers/video/backlight/backlight.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index dd973b01e244..384205ef0ff2 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -39,6 +39,7 @@ static int fb_notifier_callback(struct notifier_block *self,
struct backlight_device *bd;
struct fb_event *evdata = data;
int node = evdata->info->node;
+ int fb_blank = 0;
/* If we aren't interested in this event, skip it immediately ... */
if (event != FB_EVENT_BLANK && event != FB_EVENT_CONBLANK)
@@ -49,19 +50,21 @@ static int fb_notifier_callback(struct notifier_block *self,
if (bd->ops)
if (!bd->ops->check_fb ||
bd->ops->check_fb(bd, evdata->info)) {
- bd->props.fb_blank = *(int *)evdata->data;
- if (bd->props.fb_blank == FB_BLANK_UNBLANK &&
+ fb_blank = *(int *)evdata->data;
+ if (fb_blank == FB_BLANK_UNBLANK &&
!bd->fb_bl_on[node]) {
bd->fb_bl_on[node] = true;
if (!bd->use_count++) {
bd->props.state &= ~BL_CORE_FBBLANK;
+ bd->props.fb_blank = FB_BLANK_UNBLANK;
backlight_update_status(bd);
}
- } else if (bd->props.fb_blank != FB_BLANK_UNBLANK &&
+ } else if (fb_blank != FB_BLANK_UNBLANK &&
bd->fb_bl_on[node]) {
bd->fb_bl_on[node] = false;
if (!(--bd->use_count)) {
bd->props.state |= BL_CORE_FBBLANK;
+ bd->props.fb_blank = FB_BLANK_POWERDOWN;
backlight_update_status(bd);
}
}