aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2007-09-23 10:39:05 -0400
committerLen Brown <len.brown@intel.com>2007-09-23 22:38:15 -0400
commit3e5ce914bd17335ca74a7c7b06a776c6be6ca434 (patch)
tree27e8bb857b1c4da34fa131816e08c6a398852adc
parent3eea123df1637a88d0899626a67b83dca959efff (diff)
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: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/misc/thinkpad_acpi.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 3efe81b1b73c..0a33c6ee4508 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -1197,6 +1197,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
1197 u32 hkey; 1197 u32 hkey;
1198 unsigned int keycode, scancode; 1198 unsigned int keycode, scancode;
1199 int send_acpi_ev; 1199 int send_acpi_ev;
1200 int ignore_acpi_ev;
1200 1201
1201 if (event != 0x80) { 1202 if (event != 0x80) {
1202 printk(IBM_ERR "unknown HKEY notification event %d\n", event); 1203 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 } 1220 }
1220 1221
1221 send_acpi_ev = 0; 1222 send_acpi_ev = 0;
1223 ignore_acpi_ev = 0;
1222 1224
1223 switch (hkey >> 12) { 1225 switch (hkey >> 12) {
1224 case 1: 1226 case 1:
@@ -1244,6 +1246,8 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
1244 "unknown LID-related HKEY event: 0x%04x\n", 1246 "unknown LID-related HKEY event: 0x%04x\n",
1245 hkey); 1247 hkey);
1246 send_acpi_ev = 1; 1248 send_acpi_ev = 1;
1249 } else {
1250 ignore_acpi_ev = 1;
1247 } 1251 }
1248 break; 1252 break;
1249 case 7: 1253 case 7:
@@ -1263,11 +1267,12 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event)
1263 } 1267 }
1264 1268
1265 /* Legacy events */ 1269 /* Legacy events */
1266 if (send_acpi_ev || hotkey_report_mode < 2) 1270 if (!ignore_acpi_ev && (send_acpi_ev || hotkey_report_mode < 2)) {
1267 acpi_bus_generate_proc_event(ibm->acpi->device, event, hkey); 1271 acpi_bus_generate_proc_event(ibm->acpi->device, event, hkey);
1272 }
1268 1273
1269 /* netlink events */ 1274 /* netlink events */
1270 if (send_acpi_ev) { 1275 if (!ignore_acpi_ev && send_acpi_ev) {
1271 acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class, 1276 acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class,
1272 ibm->acpi->device->dev.bus_id, 1277 ibm->acpi->device->dev.bus_id,
1273 event, hkey); 1278 event, hkey);