Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 112394
b: refs/heads/master
c: faa312d
h: refs/heads/master
v: v3
  • Loading branch information
Eric Miao authored and Russell King committed Sep 23, 2008
1 parent 0b22040 commit 4215c7d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6ae19b04ab41a4db0f0c48ec0b78950f6b028823
refs/heads/master: faa312da9cd0b044bdc84483162c6ee10b9c83c0
18 changes: 15 additions & 3 deletions trunk/drivers/video/backlight/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,26 @@ static int fb_notifier_callback(struct notifier_block *self,
struct fb_event *evdata = data;

/* If we aren't interested in this event, skip it immediately ... */
if (event != FB_EVENT_BLANK)
switch (event) {
case FB_EVENT_BLANK:
case FB_EVENT_MODE_CHANGE:
case FB_EVENT_MODE_CHANGE_ALL:
break;
default:
return 0;
}

ld = container_of(self, struct lcd_device, fb_notif);
if (!ld->ops)
return 0;

mutex_lock(&ld->ops_lock);
if (ld->ops)
if (!ld->ops->check_fb || ld->ops->check_fb(ld, evdata->info))
if (!ld->ops->check_fb || ld->ops->check_fb(ld, evdata->info)) {
if (event == FB_EVENT_BLANK)
ld->ops->set_power(ld, *(int *)evdata->data);
else
ld->ops->set_mode(ld, evdata->data);
}
mutex_unlock(&ld->ops_lock);
return 0;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/video/fbmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,7 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)

info->flags &= ~FBINFO_MISC_USEREVENT;
event.info = info;
event.data = &mode;
fb_notifier_call_chain(evnt, &event);
}
}
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/lcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/device.h>
#include <linux/mutex.h>
#include <linux/notifier.h>
#include <linux/fb.h>

/* Notes on locking:
*
Expand Down Expand Up @@ -45,6 +46,8 @@ struct lcd_ops {
int (*get_contrast)(struct lcd_device *);
/* Set LCD panel contrast */
int (*set_contrast)(struct lcd_device *, int contrast);
/* Set LCD panel mode (resolutions ...) */
int (*set_mode)(struct lcd_device *, struct fb_videomode *);
/* Check if given framebuffer device is the one LCD is bound to;
return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */
int (*check_fb)(struct lcd_device *, struct fb_info *);
Expand Down

0 comments on commit 4215c7d

Please sign in to comment.