thinkpad-acpi: Fix procfs hotkey reset command
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sat, 12 Sep 2009 18:22:16 +0000 (15:22 -0300)
committerLen Brown <len.brown@intel.com>
Sat, 19 Sep 2009 04:53:50 +0000 (00:53 -0400)
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>
Signed-off-by: Len Brown <len.brown@intel.com>
Documentation/laptops/thinkpad-acpi.txt
drivers/platform/x86/thinkpad_acpi.c

index ab4b58eaa7f4a5561502d092631bc6430a293469..6d03487ef1c71ea3a3ea6cc30240e2a0c9f9d5d4 100644 (file)
@@ -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:
index 6b667891fc3b09161950d6d723fe71ace56ddacb..dd779e54894f48881b26bab2919a3217ae956263 100644 (file)
@@ -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) {