Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145063
b: refs/heads/master
c: 64b86b6
h: refs/heads/master
i:
  145061: 2550997
  145059: e08a24f
  145055: 53cbba8
v: v3
  • Loading branch information
Darren Salt authored and Len Brown committed May 14, 2009
1 parent 1edaf57 commit b41501b
Show file tree
Hide file tree
Showing 2 changed files with 27 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: fbc97e4c5c31ea198f912196b1379d7493362800
refs/heads/master: 64b86b6583db832b28bb54575e32b9e2a1a7d84f
29 changes: 26 additions & 3 deletions trunk/drivers/platform/x86/eeepc-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ static struct key_entry eeepc_keymap[] = {
{KE_KEY, 0x1b, KEY_ZOOM },
{KE_KEY, 0x1c, KEY_PROG2 },
{KE_KEY, 0x1d, KEY_PROG3 },
{KE_KEY, NOTIFY_BRN_MIN, KEY_BRIGHTNESSDOWN },
{KE_KEY, NOTIFY_BRN_MIN + 2, KEY_BRIGHTNESSUP },
{KE_KEY, 0x30, KEY_SWITCHVIDEOMODE },
{KE_KEY, 0x31, KEY_SWITCHVIDEOMODE },
{KE_KEY, 0x32, KEY_SWITCHVIDEOMODE },
Expand Down Expand Up @@ -512,11 +514,16 @@ static int eeepc_hotk_check(void)
return 0;
}

static void notify_brn(void)
static int notify_brn(void)
{
/* returns the *previous* brightness, or -1 */
struct backlight_device *bd = eeepc_backlight_device;
if (bd)
if (bd) {
int old = bd->props.brightness;
bd->props.brightness = read_brightness(bd);
return old;
}
return -1;
}

static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
Expand Down Expand Up @@ -558,17 +565,33 @@ static void eeepc_hotk_notify(acpi_handle handle, u32 event, void *data)
{
static struct key_entry *key;
u16 count;
int brn = -ENODEV;

if (!ehotk)
return;
if (event >= NOTIFY_BRN_MIN && event <= NOTIFY_BRN_MAX)
notify_brn();
brn = notify_brn();
count = ehotk->event_count[event % 128]++;
acpi_bus_generate_proc_event(ehotk->device, event, count);
acpi_bus_generate_netlink_event(ehotk->device->pnp.device_class,
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 */
}
key = eepc_get_entry_by_scancode(event);
if (key) {
switch (key->type) {
Expand Down

0 comments on commit b41501b

Please sign in to comment.