diff options
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 9c3bb0c498e1..955adf67e8f0 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -2854,6 +2854,15 @@ static void hotkey_exit(void) | |||
2854 | } | 2854 | } |
2855 | } | 2855 | } |
2856 | 2856 | ||
2857 | static void __init hotkey_unmap(const unsigned int scancode) | ||
2858 | { | ||
2859 | if (hotkey_keycode_map[scancode] != KEY_RESERVED) { | ||
2860 | clear_bit(hotkey_keycode_map[scancode], | ||
2861 | tpacpi_inputdev->keybit); | ||
2862 | hotkey_keycode_map[scancode] = KEY_RESERVED; | ||
2863 | } | ||
2864 | } | ||
2865 | |||
2857 | static int __init hotkey_init(struct ibm_init_struct *iibm) | 2866 | static int __init hotkey_init(struct ibm_init_struct *iibm) |
2858 | { | 2867 | { |
2859 | /* Requirements for changing the default keymaps: | 2868 | /* Requirements for changing the default keymaps: |
@@ -2932,11 +2941,11 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) | |||
2932 | KEY_UNKNOWN, /* 0x0D: FN+INSERT */ | 2941 | KEY_UNKNOWN, /* 0x0D: FN+INSERT */ |
2933 | KEY_UNKNOWN, /* 0x0E: FN+DELETE */ | 2942 | KEY_UNKNOWN, /* 0x0E: FN+DELETE */ |
2934 | 2943 | ||
2935 | /* These either have to go through ACPI video, or | 2944 | /* These should be enabled --only-- when ACPI video |
2936 | * act like in the IBM ThinkPads, so don't ever | 2945 | * is disabled (i.e. in "vendor" mode), and are handled |
2937 | * enable them by default */ | 2946 | * in a special way by the init code */ |
2938 | KEY_RESERVED, /* 0x0F: FN+HOME (brightness up) */ | 2947 | KEY_BRIGHTNESSUP, /* 0x0F: FN+HOME (brightness up) */ |
2939 | KEY_RESERVED, /* 0x10: FN+END (brightness down) */ | 2948 | KEY_BRIGHTNESSDOWN, /* 0x10: FN+END (brightness down) */ |
2940 | 2949 | ||
2941 | KEY_RESERVED, /* 0x11: FN+PGUP (thinklight toggle) */ | 2950 | KEY_RESERVED, /* 0x11: FN+PGUP (thinklight toggle) */ |
2942 | 2951 | ||
@@ -3162,15 +3171,14 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) | |||
3162 | "Disabling thinkpad-acpi brightness events " | 3171 | "Disabling thinkpad-acpi brightness events " |
3163 | "by default...\n"); | 3172 | "by default...\n"); |
3164 | 3173 | ||
3165 | /* The hotkey_reserved_mask change below is not | 3174 | /* Disable brightness up/down on Lenovo thinkpads when |
3166 | * necessary while the keys are at KEY_RESERVED in the | 3175 | * ACPI is handling them, otherwise it is plain impossible |
3167 | * default map, but better safe than sorry, leave it | 3176 | * for userspace to do something even remotely sane */ |
3168 | * here as a marker of what we have to do, especially | ||
3169 | * when we finally become able to set this at runtime | ||
3170 | * on response to X.org requests */ | ||
3171 | hotkey_reserved_mask |= | 3177 | hotkey_reserved_mask |= |
3172 | (1 << TP_ACPI_HOTKEYSCAN_FNHOME) | 3178 | (1 << TP_ACPI_HOTKEYSCAN_FNHOME) |
3173 | | (1 << TP_ACPI_HOTKEYSCAN_FNEND); | 3179 | | (1 << TP_ACPI_HOTKEYSCAN_FNEND); |
3180 | hotkey_unmap(TP_ACPI_HOTKEYSCAN_FNHOME); | ||
3181 | hotkey_unmap(TP_ACPI_HOTKEYSCAN_FNEND); | ||
3174 | } | 3182 | } |
3175 | 3183 | ||
3176 | #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL | 3184 | #ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL |