All of lore.kernel.org
 help / color / mirror / Atom feed
From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
To: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org, ibm-acpi-devel@lists.sourceforge.net,
	Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Subject: [PATCH 6/8] thinkpad-acpi: Fix procfs hotkey reset command
Date: Sat, 12 Sep 2009 15:22:16 -0300	[thread overview]
Message-ID: <1252779738-7459-7-git-send-email-hmh@hmh.eng.br> (raw)
In-Reply-To: <1252779738-7459-1-git-send-email-hmh@hmh.eng.br>

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 <hmh@hmh.eng.br>
---
 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) {
-- 
1.6.3.3


  parent reply	other threads:[~2009-09-12 18:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-12 18:22 [GIT PATCH] thinkpad-acpi patches for the merge window Henrique de Moraes Holschuh
2009-09-12 18:22 ` [PATCH 1/8] thinkpad-acpi: don't ask about brightness_mode for fw. 1V and 1R Henrique de Moraes Holschuh
2009-09-12 18:22 ` [PATCH 2/8] thinkpad-acpi: firmware version checks Henrique de Moraes Holschuh
2009-09-12 18:22 ` [PATCH 3/8] thinkpad-acpi: be more strict when detecting a ThinkPad Henrique de Moraes Holschuh
2009-09-12 18:22 ` [PATCH 4/8] thinkpad-acpi: hotkey poll fixes Henrique de Moraes Holschuh
2009-09-12 18:22 ` [PATCH 5/8] thinkpad-acpi: deprecate hotkey_bios_mask Henrique de Moraes Holschuh
2009-09-12 18:22 ` Henrique de Moraes Holschuh [this message]
2009-09-12 18:22 ` [PATCH 7/8] thinkpad-acpi: don't poll by default any of the reserved hotkeys Henrique de Moraes Holschuh
2009-09-12 18:22 ` [PATCH 8/8] thinkpad-acpi: report brightness events when required Henrique de Moraes Holschuh
2009-09-19  5:06 ` [GIT PATCH] thinkpad-acpi patches for the merge window Len Brown
2009-09-19 14:44   ` Henrique de Moraes Holschuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1252779738-7459-7-git-send-email-hmh@hmh.eng.br \
    --to=hmh@hmh.eng.br \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.