|
@@ -41,6 +41,8 @@ static int fb_notifier_callback(struct notifier_block *self,
|
|
{
|
|
{
|
|
struct backlight_device *bd;
|
|
struct backlight_device *bd;
|
|
struct fb_event *evdata = data;
|
|
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 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)
|
|
@@ -51,11 +53,22 @@ static int fb_notifier_callback(struct notifier_block *self,
|
|
if (bd->ops)
|
|
if (bd->ops)
|
|
if (!bd->ops->check_fb ||
|
|
if (!bd->ops->check_fb ||
|
|
bd->ops->check_fb(bd, evdata->info)) {
|
|
bd->ops->check_fb(bd, evdata->info)) {
|
|
- bd->props.fb_blank = *(int *)evdata->data;
|
|
|
|
- if (bd->props.fb_blank == FB_BLANK_UNBLANK)
|
|
|
|
- bd->props.state &= ~BL_CORE_FBBLANK;
|
|
|
|
- else
|
|
|
|
- bd->props.state |= BL_CORE_FBBLANK;
|
|
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
|
|
+ } 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;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
backlight_update_status(bd);
|
|
backlight_update_status(bd);
|
|
}
|
|
}
|
|
mutex_unlock(&bd->ops_lock);
|
|
mutex_unlock(&bd->ops_lock);
|