diff options
-rw-r--r-- | drivers/video/backlight/lcd.c | 18 | ||||
-rw-r--r-- | drivers/video/fbmem.c | 1 | ||||
-rw-r--r-- | include/linux/lcd.h | 3 |
3 files changed, 19 insertions, 3 deletions
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index b15b2b84a6f7..8e1731d3b228 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c | |||
@@ -27,14 +27,26 @@ static int fb_notifier_callback(struct notifier_block *self, | |||
27 | struct fb_event *evdata = data; | 27 | struct fb_event *evdata = data; |
28 | 28 | ||
29 | /* If we aren't interested in this event, skip it immediately ... */ | 29 | /* If we aren't interested in this event, skip it immediately ... */ |
30 | if (event != FB_EVENT_BLANK) | 30 | switch (event) { |
31 | case FB_EVENT_BLANK: | ||
32 | case FB_EVENT_MODE_CHANGE: | ||
33 | case FB_EVENT_MODE_CHANGE_ALL: | ||
34 | break; | ||
35 | default: | ||
31 | return 0; | 36 | return 0; |
37 | } | ||
32 | 38 | ||
33 | ld = container_of(self, struct lcd_device, fb_notif); | 39 | ld = container_of(self, struct lcd_device, fb_notif); |
40 | if (!ld->ops) | ||
41 | return 0; | ||
42 | |||
34 | mutex_lock(&ld->ops_lock); | 43 | mutex_lock(&ld->ops_lock); |
35 | if (ld->ops) | 44 | if (!ld->ops->check_fb || ld->ops->check_fb(ld, evdata->info)) { |
36 | if (!ld->ops->check_fb || ld->ops->check_fb(ld, evdata->info)) | 45 | if (event == FB_EVENT_BLANK) |
37 | ld->ops->set_power(ld, *(int *)evdata->data); | 46 | ld->ops->set_power(ld, *(int *)evdata->data); |
47 | else | ||
48 | ld->ops->set_mode(ld, evdata->data); | ||
49 | } | ||
38 | mutex_unlock(&ld->ops_lock); | 50 | mutex_unlock(&ld->ops_lock); |
39 | return 0; | 51 | return 0; |
40 | } | 52 | } |
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 98843c2ecf73..0737570030f5 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -979,6 +979,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) | |||
979 | 979 | ||
980 | info->flags &= ~FBINFO_MISC_USEREVENT; | 980 | info->flags &= ~FBINFO_MISC_USEREVENT; |
981 | event.info = info; | 981 | event.info = info; |
982 | event.data = &mode; | ||
982 | fb_notifier_call_chain(evnt, &event); | 983 | fb_notifier_call_chain(evnt, &event); |
983 | } | 984 | } |
984 | } | 985 | } |
diff --git a/include/linux/lcd.h b/include/linux/lcd.h index 173febac6656..c67fecafff90 100644 --- a/include/linux/lcd.h +++ b/include/linux/lcd.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/device.h> | 11 | #include <linux/device.h> |
12 | #include <linux/mutex.h> | 12 | #include <linux/mutex.h> |
13 | #include <linux/notifier.h> | 13 | #include <linux/notifier.h> |
14 | #include <linux/fb.h> | ||
14 | 15 | ||
15 | /* Notes on locking: | 16 | /* Notes on locking: |
16 | * | 17 | * |
@@ -45,6 +46,8 @@ struct lcd_ops { | |||
45 | int (*get_contrast)(struct lcd_device *); | 46 | int (*get_contrast)(struct lcd_device *); |
46 | /* Set LCD panel contrast */ | 47 | /* Set LCD panel contrast */ |
47 | int (*set_contrast)(struct lcd_device *, int contrast); | 48 | int (*set_contrast)(struct lcd_device *, int contrast); |
49 | /* Set LCD panel mode (resolutions ...) */ | ||
50 | int (*set_mode)(struct lcd_device *, struct fb_videomode *); | ||
48 | /* Check if given framebuffer device is the one LCD is bound to; | 51 | /* Check if given framebuffer device is the one LCD is bound to; |
49 | return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */ | 52 | return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */ |
50 | int (*check_fb)(struct lcd_device *, struct fb_info *); | 53 | int (*check_fb)(struct lcd_device *, struct fb_info *); |