From patchwork Sat Sep 12 18:22:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrique de Moraes Holschuh X-Patchwork-Id: 47101 X-Patchwork-Delegate: lenb@kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8CIMRJU018286 for ; Sat, 12 Sep 2009 18:22:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754645AbZILSW1 (ORCPT ); Sat, 12 Sep 2009 14:22:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754695AbZILSW1 (ORCPT ); Sat, 12 Sep 2009 14:22:27 -0400 Received: from out1.smtp.messagingengine.com ([66.111.4.25]:47739 "EHLO out1.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754645AbZILSWX (ORCPT ); Sat, 12 Sep 2009 14:22:23 -0400 Received: from compute1.internal (compute1.internal [10.202.2.41]) by gateway1.messagingengine.com (Postfix) with ESMTP id 8EE2A6BB0F; Sat, 12 Sep 2009 14:22:26 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Sat, 12 Sep 2009 14:22:26 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=from:to:cc:subject:date:message-id:in-reply-to:references; s=smtpout; bh=CuimzpuDOyKzs0QykcWh3uif/u8=; b=eNvA9Yu8bHBwJoFeP88NdZdVjS9Di4UQwbwfYQaEi8s992aQJBAN/pZ69Tlc2wDwZbmUxnjqbBUhSL0J9Oa6yuh7LIKcCZxbjyDZh/nk5wIjxFvnZGIjanWcLCM171szWgP+3x9cjRXYUfRJFuBg1THwiOam0tLhXnohowm3sMM= X-Sasl-enc: xuyFB5JcY0SMKyJ52vTd8XKF1sEckxCLPUFXDABOYmN3 1252779746 Received: from thorin.khazad-dum.debian.net (unknown [201.82.170.176]) by mail.messagingengine.com (Postfix) with ESMTPSA id 38D5327BDB; Sat, 12 Sep 2009 14:22:26 -0400 (EDT) Received: by thorin.khazad-dum.debian.net (Postfix, from userid 1000) id E8CDD1E9796; Sat, 12 Sep 2009 15:22:22 -0300 (BRT) From: Henrique de Moraes Holschuh To: Len Brown Cc: linux-acpi@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net, Henrique de Moraes Holschuh Subject: [PATCH 6/8] thinkpad-acpi: Fix procfs hotkey reset command Date: Sat, 12 Sep 2009 15:22:16 -0300 Message-Id: <1252779738-7459-7-git-send-email-hmh@hmh.eng.br> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1252779738-7459-1-git-send-email-hmh@hmh.eng.br> References: <1252779738-7459-1-git-send-email-hmh@hmh.eng.br> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org echo "reset" > /proc/acpi/ibm/hotkey should do something non-useless, so instead of setting it to Fn+F2, Fn+F3, Fn+F5, set it to hotkey_recommended_mask. It is not like it will survive for much longer, anyway. Signed-off-by: Henrique de Moraes Holschuh --- Documentation/laptops/thinkpad-acpi.txt | 2 +- drivers/platform/x86/thinkpad_acpi.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/laptops/thinkpad-acpi.txt b/Documentation/laptops/thinkpad-acpi.txt index ab4b58e..6d03487 100644 --- a/Documentation/laptops/thinkpad-acpi.txt +++ b/Documentation/laptops/thinkpad-acpi.txt @@ -219,7 +219,7 @@ The following commands can be written to the /proc/acpi/ibm/hotkey file: echo 0xffffffff > /proc/acpi/ibm/hotkey -- enable all hot keys echo 0 > /proc/acpi/ibm/hotkey -- disable all possible hot keys ... any other 8-hex-digit mask ... - echo reset > /proc/acpi/ibm/hotkey -- restore the original mask + echo reset > /proc/acpi/ibm/hotkey -- restore the recommended mask The following commands have been deprecated and will cause the kernel to log a warning: diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 6b66789..dd779e5 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -3569,7 +3569,8 @@ static int hotkey_write(char *buf) hotkey_enabledisable_warn(0); res = -EPERM; } else if (strlencmp(cmd, "reset") == 0) { - mask = hotkey_orig_mask; + mask = (hotkey_all_mask | hotkey_source_mask) + & ~hotkey_reserved_mask; } else if (sscanf(cmd, "0x%x", &mask) == 1) { /* mask set */ } else if (sscanf(cmd, "%x", &mask) == 1) {