Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177505
b: refs/heads/master
c: a2a1d36
h: refs/heads/master
i:
  177503: 9c6f71c
v: v3
  • Loading branch information
Alan Jenkins authored and Len Brown committed Dec 9, 2009
1 parent c2e0e1b commit fcf50f6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 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: 13f70029daa3cd7f9983e4aec82f32939b1a6e6a
refs/heads/master: a2a1d36c78e90977e4ded9a20a7d8d27d84b13e4
42 changes: 19 additions & 23 deletions trunk/drivers/platform/x86/eeepc-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,12 +662,11 @@ static int notify_brn(void)
{
/* returns the *previous* brightness, or -1 */
struct backlight_device *bd = eeepc_backlight_device;
if (bd) {
int old = bd->props.brightness;
backlight_force_update(bd, BACKLIGHT_UPDATE_HOTKEY);
return old;
}
return -1;
int old = bd->props.brightness;

backlight_force_update(bd, BACKLIGHT_UPDATE_HOTKEY);

return old;
}

static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
Expand Down Expand Up @@ -741,8 +740,6 @@ static void eeepc_hotk_notify(struct acpi_device *device, u32 event)
u16 count;
int brn = -ENODEV;

if (!ehotk)
return;
if (event > ACPI_MAX_SYS_NOTIFY)
return;
if (event >= NOTIFY_BRN_MIN && event <= NOTIFY_BRN_MAX)
Expand All @@ -753,21 +750,20 @@ static void eeepc_hotk_notify(struct acpi_device *device, u32 event)
dev_name(&ehotk->device->dev), event,
count);
if (ehotk->inputdev) {
if (brn != -ENODEV) {
/* brightness-change events need special
* handling for conversion to key events
*/
if (brn < 0)
brn = event;
else
brn += NOTIFY_BRN_MIN;
if (event < brn)
event = NOTIFY_BRN_MIN; /* brightness down */
else if (event > brn)
event = NOTIFY_BRN_MIN + 2; /* ... up */
else
event = NOTIFY_BRN_MIN + 1; /* ... unchanged */
}
/* brightness-change events need special
* handling for conversion to key events
*/
if (brn < 0)
brn = event;
else
brn += NOTIFY_BRN_MIN;
if (event < brn)
event = NOTIFY_BRN_MIN; /* brightness down */
else if (event > brn)
event = NOTIFY_BRN_MIN + 2; /* ... up */
else
event = NOTIFY_BRN_MIN + 1; /* ... unchanged */

key = eepc_get_entry_by_scancode(event);
if (key) {
switch (key->type) {
Expand Down

0 comments on commit fcf50f6

Please sign in to comment.