From: Henrique de Moraes Holschuh Subject: [PATCH 7/7] ACPI: thinkpad-acpi: fix regression on HKEY LID event handling Date: Thu, 20 Sep 2007 10:51:00 -0300 Message-ID: <11902962612213-git-send-email-hmh@hmh.eng.br> References: <11902962603691-git-send-email-hmh@hmh.eng.br> Return-path: Received: from out2.smtp.messagingengine.com ([66.111.4.26]:43858 "EHLO out2.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751953AbXITNvH (ORCPT ); Thu, 20 Sep 2007 09:51:07 -0400 In-Reply-To: <11902962603691-git-send-email-hmh@hmh.eng.br> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Len Brown Cc: ibm-acpi-devel@lists.sourceforge.net, linux-acpi@vger.kernel.org, Henrique de Moraes Holschuh 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 --- drivers/misc/thinkpad_acpi.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index de415fe..24503cc 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) u32 hkey; unsigned int keycode, scancode; int send_acpi_ev; + int ignore_acpi_ev; if (event != 0x80) { printk(IBM_ERR "unknown hotkey notification event %d\n", event); @@ -1220,6 +1221,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) } send_acpi_ev = 0; + ignore_acpi_ev = 0; switch (hkey >> 12) { case 1: @@ -1245,6 +1247,8 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) "unknown LID-related hotkey event: 0x%04x\n", hkey); send_acpi_ev = 1; + } else { + ignore_acpi_ev = 1; } break; case 7: @@ -1264,11 +1268,12 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) } /* 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); + } /* netlink events */ - if (send_acpi_ev) { + if (!ignore_acpi_ev && send_acpi_ev) { acpi_bus_generate_netlink_event(ibm->acpi->device->pnp.device_class, ibm->acpi->device->dev.bus_id, event, hkey); -- 1.5.3.1