diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2007-02-09 04:46:45 -0500 |
---|---|---|
committer | Richard Purdie <rpurdie@rpsys.net> | 2007-02-20 03:38:45 -0500 |
commit | 994efacdf9a087b52f71e620b58dfa526b0cf928 (patch) | |
tree | 2b2668df970fe350ce2ab4a7bb7ae91d6313ce0f | |
parent | 34f18a71d9bc55e8210c3fe02938336f82f40b30 (diff) |
backlight/fbcon: Add FB_EVENT_CONBLANK
The backlight class wants notification whenever the console is blanked
but doesn't get this when hardware blanking fails and software blanking
is used. Changing FB_EVENT_BLANK to report both would be a behaviour
change which could confuse the console layer so add a new event for
software blanking and have the backlight class listen for both.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
-rw-r--r-- | drivers/video/backlight/backlight.c | 2 | ||||
-rw-r--r-- | drivers/video/console/fbcon.c | 7 | ||||
-rw-r--r-- | include/linux/fb.h | 4 |
3 files changed, 11 insertions, 2 deletions
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 4f987c40b72d..5490b2ae5134 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c | |||
@@ -28,7 +28,7 @@ static int fb_notifier_callback(struct notifier_block *self, | |||
28 | struct fb_event *evdata = data; | 28 | struct fb_event *evdata = data; |
29 | 29 | ||
30 | /* If we aren't interested in this event, skip it immediately ... */ | 30 | /* If we aren't interested in this event, skip it immediately ... */ |
31 | if (event != FB_EVENT_BLANK) | 31 | if (event != FB_EVENT_BLANK && event != FB_EVENT_CONBLANK) |
32 | return 0; | 32 | return 0; |
33 | 33 | ||
34 | bd = container_of(self, struct backlight_device, fb_notif); | 34 | bd = container_of(self, struct backlight_device, fb_notif); |
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index be3f2c3f132c..0429fd2cece0 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -2233,6 +2233,8 @@ static int fbcon_switch(struct vc_data *vc) | |||
2233 | static void fbcon_generic_blank(struct vc_data *vc, struct fb_info *info, | 2233 | static void fbcon_generic_blank(struct vc_data *vc, struct fb_info *info, |
2234 | int blank) | 2234 | int blank) |
2235 | { | 2235 | { |
2236 | struct fb_event event; | ||
2237 | |||
2236 | if (blank) { | 2238 | if (blank) { |
2237 | unsigned short charmask = vc->vc_hi_font_mask ? | 2239 | unsigned short charmask = vc->vc_hi_font_mask ? |
2238 | 0x1ff : 0xff; | 2240 | 0x1ff : 0xff; |
@@ -2243,6 +2245,11 @@ static void fbcon_generic_blank(struct vc_data *vc, struct fb_info *info, | |||
2243 | fbcon_clear(vc, 0, 0, vc->vc_rows, vc->vc_cols); | 2245 | fbcon_clear(vc, 0, 0, vc->vc_rows, vc->vc_cols); |
2244 | vc->vc_video_erase_char = oldc; | 2246 | vc->vc_video_erase_char = oldc; |
2245 | } | 2247 | } |
2248 | |||
2249 | |||
2250 | event.info = info; | ||
2251 | event.data = ␣ | ||
2252 | fb_notifier_call_chain(FB_EVENT_CONBLANK, &event); | ||
2246 | } | 2253 | } |
2247 | 2254 | ||
2248 | static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) | 2255 | static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) |
diff --git a/include/linux/fb.h b/include/linux/fb.h index a78e25683f82..bf7158b59b25 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -516,13 +516,15 @@ struct fb_cursor_user { | |||
516 | #define FB_EVENT_GET_CONSOLE_MAP 0x07 | 516 | #define FB_EVENT_GET_CONSOLE_MAP 0x07 |
517 | /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ | 517 | /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ |
518 | #define FB_EVENT_SET_CONSOLE_MAP 0x08 | 518 | #define FB_EVENT_SET_CONSOLE_MAP 0x08 |
519 | /* A display blank is requested */ | 519 | /* A hardware display blank change occured */ |
520 | #define FB_EVENT_BLANK 0x09 | 520 | #define FB_EVENT_BLANK 0x09 |
521 | /* Private modelist is to be replaced */ | 521 | /* Private modelist is to be replaced */ |
522 | #define FB_EVENT_NEW_MODELIST 0x0A | 522 | #define FB_EVENT_NEW_MODELIST 0x0A |
523 | /* The resolution of the passed in fb_info about to change and | 523 | /* The resolution of the passed in fb_info about to change and |
524 | all vc's should be changed */ | 524 | all vc's should be changed */ |
525 | #define FB_EVENT_MODE_CHANGE_ALL 0x0B | 525 | #define FB_EVENT_MODE_CHANGE_ALL 0x0B |
526 | /* A software display blank change occured */ | ||
527 | #define FB_EVENT_CONBLANK 0x0C | ||
526 | 528 | ||
527 | struct fb_event { | 529 | struct fb_event { |
528 | struct fb_info *info; | 530 | struct fb_info *info; |