Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177520
b: refs/heads/master
c: 325fb8e
h: refs/heads/master
v: v3
  • Loading branch information
Alan Jenkins authored and Len Brown committed Dec 9, 2009
1 parent 6f6a4a7 commit e690542
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 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: f90be874303eddc53c199083a37bc44d65ab8351
refs/heads/master: 325fb8e9aeddf7bf8a7a892869dca00e7305c41e
42 changes: 25 additions & 17 deletions trunk/drivers/platform/x86/eeepc-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1230,27 +1230,35 @@ static void eeepc_acpi_notify(struct acpi_device *device, u32 event)
dev_name(&device->dev), event,
count);

/* Brightness events are special */
if (event >= NOTIFY_BRN_MIN && event <= NOTIFY_BRN_MAX) {
int old_brightness, new_brightness;

/* Update backlight device. */
old_brightness = eeepc_backlight_notify(eeepc);

/* Convert brightness event to keypress (obsolescent hack). */
new_brightness = event - NOTIFY_BRN_MIN;

if (new_brightness < old_brightness) {
event = NOTIFY_BRN_MIN; /* brightness down */
} else if (new_brightness > old_brightness) {
event = NOTIFY_BRN_MAX; /* brightness up */
} else {
/*
* no change in brightness - already at min/max,
* event will be desired value (or else ignored).
*/
/* Ignore them completely if the acpi video driver is used */
if (eeepc->backlight_device != NULL) {
int old_brightness, new_brightness;

/* Update the backlight device. */
old_brightness = eeepc_backlight_notify(eeepc);

/* Convert event to keypress (obsolescent hack) */
new_brightness = event - NOTIFY_BRN_MIN;

if (new_brightness < old_brightness) {
event = NOTIFY_BRN_MIN; /* brightness down */
} else if (new_brightness > old_brightness) {
event = NOTIFY_BRN_MAX; /* brightness up */
} else {
/*
* no change in brightness - already at min/max,
* event will be desired value (or else ignored)
*/
}
eeepc_input_notify(eeepc, event);
}
} else {
/* Everything else is a bona-fide keypress event */
eeepc_input_notify(eeepc, event);
}
eeepc_input_notify(eeepc, event);
}

static void cmsg_quirk(struct eeepc_laptop *eeepc, int cm, const char *name)
Expand Down

0 comments on commit e690542

Please sign in to comment.