Commit 3e5ce914 authored by Henrique de Moraes Holschuh's avatar Henrique de Moraes Holschuh Committed by Len Brown

ACPI: thinkpad-acpi: fix regression on HKEY LID event handling

We were letting ThinkPad-specific LID events through to userspace again,
instead of dropping them.  Fix it.  We don't want to give userspace the
option of not using generic LID handling.
Signed-off-by: default avatarHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 3eea123d
...@@ -1197,6 +1197,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) ...@@ -1197,6 +1197,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
u32 hkey; u32 hkey;
unsigned int keycode, scancode; unsigned int keycode, scancode;
int send_acpi_ev; int send_acpi_ev;
int ignore_acpi_ev;
if (event != 0x80) { if (event != 0x80) {
printk(IBM_ERR "unknown HKEY notification event %d\n", event); printk(IBM_ERR "unknown HKEY notification event %d\n", event);
...@@ -1219,6 +1220,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) ...@@ -1219,6 +1220,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
} }
send_acpi_ev = 0; send_acpi_ev = 0;
ignore_acpi_ev = 0;
switch (hkey >> 12) { switch (hkey >> 12) {
case 1: case 1:
...@@ -1244,6 +1246,8 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) ...@@ -1244,6 +1246,8 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
"unknown LID-related HKEY event: 0x%04x\n", "unknown LID-related HKEY event: 0x%04x\n",
hkey); hkey);
send_acpi_ev = 1; send_acpi_ev = 1;
} else {
ignore_acpi_ev = 1;
} }
break; break;
case 7: case 7:
...@@ -1263,11 +1267,12 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) ...@@ -1263,11 +1267,12 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
} }
/* Legacy events */ /* Legacy events */
if (send_acpi_ev || hotkey_report_mode < 2) if (!ignore_acpi_ev && (send_acpi_ev || hotkey_report_mode < 2)) {
acpi_bus_generate_proc_event(ibm->acpi->device, event, hkey); acpi_bus_generate_proc_event(ibm->acpi->device, event, hkey);
}
/* netlink events */ /* netlink events */
if (send_acpi_ev) { if (!ignore_acpi_ev && send_acpi_ev) {
acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class, acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
ibm->acpi->device->dev.bus_id, ibm->acpi->device->dev.bus_id,
event, hkey); event, hkey);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment