diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/misc/Kconfig | 13 | ||||
-rw-r--r-- | drivers/misc/thinkpad_acpi.c | 19 |
2 files changed, 29 insertions, 3 deletions
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig index 1d516f24ba53..5197f9b9b65d 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig | |||
@@ -196,4 +196,17 @@ config THINKPAD_ACPI_BAY | |||
196 | 196 | ||
197 | If you are not sure, say Y here. | 197 | If you are not sure, say Y here. |
198 | 198 | ||
199 | config THINKPAD_ACPI_INPUT_ENABLED | ||
200 | bool "Enable input layer support by default" | ||
201 | depends on THINKPAD_ACPI | ||
202 | default y | ||
203 | ---help--- | ||
204 | Enables hot key handling over the input layer by default. If unset, | ||
205 | the driver does not enable any hot key handling by default, and also | ||
206 | starts up with a mostly empty keymap. | ||
207 | |||
208 | If you are not sure, say Y here. Say N to retain the deprecated | ||
209 | behavior of ibm-acpi, and thinkpad-acpi for kernels up to 2.6.21. | ||
210 | |||
211 | |||
199 | endif # MISC_DEVICES | 212 | endif # MISC_DEVICES |
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 5c1bea1a6c37..c86b228375cc 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c | |||
@@ -734,9 +734,9 @@ static u32 hotkey_reserved_mask; | |||
734 | 734 | ||
735 | static u16 hotkey_keycode_map[] = { | 735 | static u16 hotkey_keycode_map[] = { |
736 | /* Scan Codes 0x00 to 0x0B: ACPI HKEY FN+F1..F12 */ | 736 | /* Scan Codes 0x00 to 0x0B: ACPI HKEY FN+F1..F12 */ |
737 | KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, | 737 | KEY_FN_F1, KEY_FN_F2, KEY_FN_F3, KEY_SLEEP, |
738 | KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, | 738 | KEY_FN_F5, KEY_FN_F6, KEY_FN_F7, KEY_FN_F8, |
739 | KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, KEY_UNKNOWN, | 739 | KEY_FN_F9, KEY_FN_F10, KEY_FN_F11, KEY_SUSPEND, |
740 | /* Scan codes 0x0C to 0x0F: Other ACPI HKEY hot keys */ | 740 | /* Scan codes 0x0C to 0x0F: Other ACPI HKEY hot keys */ |
741 | KEY_UNKNOWN, /* 0x0C: FN+BACKSPACE */ | 741 | KEY_UNKNOWN, /* 0x0C: FN+BACKSPACE */ |
742 | KEY_UNKNOWN, /* 0x0D: FN+INSERT */ | 742 | KEY_UNKNOWN, /* 0x0D: FN+INSERT */ |
@@ -977,6 +977,11 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) | |||
977 | if (res) | 977 | if (res) |
978 | return res; | 978 | return res; |
979 | 979 | ||
980 | #ifndef CONFIG_THINKPAD_ACPI_INPUT_ENABLED | ||
981 | for (i = 0; i < 12; i++) | ||
982 | hotkey_keycode_map[i] = KEY_UNKNOWN; | ||
983 | #endif /* ! CONFIG_THINKPAD_ACPI_INPUT_ENABLED */ | ||
984 | |||
980 | set_bit(EV_KEY, tpacpi_inputdev->evbit); | 985 | set_bit(EV_KEY, tpacpi_inputdev->evbit); |
981 | set_bit(EV_MSC, tpacpi_inputdev->evbit); | 986 | set_bit(EV_MSC, tpacpi_inputdev->evbit); |
982 | set_bit(MSC_SCAN, tpacpi_inputdev->mscbit); | 987 | set_bit(MSC_SCAN, tpacpi_inputdev->mscbit); |
@@ -993,6 +998,14 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) | |||
993 | } | 998 | } |
994 | } | 999 | } |
995 | 1000 | ||
1001 | #ifdef CONFIG_THINKPAD_ACPI_INPUT_ENABLED | ||
1002 | dbg_printk(TPACPI_DBG_INIT, | ||
1003 | "enabling hot key handling\n"); | ||
1004 | res = hotkey_set(1, (hotkey_all_mask & ~hotkey_reserved_mask) | ||
1005 | | hotkey_orig_mask); | ||
1006 | if (res) | ||
1007 | return res; | ||
1008 | #endif /* CONFIG_THINKPAD_ACPI_INPUT_ENABLED */ | ||
996 | } | 1009 | } |
997 | 1010 | ||
998 | return (tp_features.hotkey)? 0 : 1; | 1011 | return (tp_features.hotkey)? 0 : 1; |