Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71615
b: refs/heads/master
c: 3eea123
h: refs/heads/master
i:
  71613: a14bc8a
  71611: e786689
  71607: 5e3b117
  71599: ea2ba09
  71583: 498bd25
  71551: 115b91a
v: v3
  • Loading branch information
Henrique de Moraes Holschuh authored and Len Brown committed Sep 24, 2007
1 parent 0a9520d commit d27b491
Show file tree
Hide file tree
Showing 2 changed files with 35 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: 1b6521dc84f372dd92a96381fbeeebb01173d050
refs/heads/master: 3eea123df1637a88d0899626a67b83dca959efff
51 changes: 34 additions & 17 deletions trunk/drivers/misc/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1196,9 +1196,30 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
{
u32 hkey;
unsigned int keycode, scancode;
int send_acpi_ev = 0;
int send_acpi_ev;

if (event != 0x80) {
printk(IBM_ERR "unknown HKEY notification event %d\n", event);
/* forward it to userspace, maybe it knows how to handle it */
acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
ibm->acpi->device->dev.bus_id,
event, 0);
return;
}

while (1) {
if (!acpi_evalf(hkey_handle, &hkey, "MHKP", "d")) {
printk(IBM_ERR "failed to retrieve HKEY event\n");
return;
}

if (hkey == 0) {
/* queue empty */
return;
}

send_acpi_ev = 0;

if (event == 0x80 && acpi_evalf(hkey_handle, &hkey, "MHKP", "d")) {
switch (hkey >> 12) {
case 1:
/* 0x1000-0x1FFF: key presses */
Expand All @@ -1220,8 +1241,8 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
* eat up known LID events */
if (hkey != 0x5001 && hkey != 0x5002) {
printk(IBM_ERR
"unknown LID-related hotkey event: 0x%04x\n",
hkey);
"unknown LID-related HKEY event: 0x%04x\n",
hkey);
send_acpi_ev = 1;
}
break;
Expand All @@ -1240,21 +1261,17 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
printk(IBM_NOTICE "unhandled HKEY event 0x%04x\n", hkey);
send_acpi_ev = 1;
}
} else {
printk(IBM_ERR "unknown hotkey notification event %d\n", event);
hkey = 0;
send_acpi_ev = 1;
}

/* Legacy events */
if (send_acpi_ev || hotkey_report_mode < 2)
acpi_bus_generate_proc_event(ibm->acpi->device, event, hkey);
/* Legacy events */
if (send_acpi_ev || hotkey_report_mode < 2)
acpi_bus_generate_proc_event(ibm->acpi->device, event, hkey);

/* netlink events */
if (send_acpi_ev) {
acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
ibm->acpi->device->dev.bus_id,
event, hkey);
/* netlink events */
if (send_acpi_ev) {
acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
ibm->acpi->device->dev.bus_id,
event, hkey);
}
}
}

Expand Down

0 comments on commit d27b491

Please sign in to comment.