diff options
Diffstat (limited to 'drivers/hid/hid-apple.c')
-rw-r--r-- | drivers/hid/hid-apple.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index 4b96e7a898cf..bba05d0a8980 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/device.h> | 19 | #include <linux/device.h> |
20 | #include <linux/hid.h> | 20 | #include <linux/hid.h> |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | #include <linux/slab.h> | ||
22 | #include <linux/usb.h> | 23 | #include <linux/usb.h> |
23 | 24 | ||
24 | #include "hid-ids.h" | 25 | #include "hid-ids.h" |
@@ -40,6 +41,11 @@ module_param(fnmode, uint, 0644); | |||
40 | MODULE_PARM_DESC(fnmode, "Mode of fn key on Apple keyboards (0 = disabled, " | 41 | MODULE_PARM_DESC(fnmode, "Mode of fn key on Apple keyboards (0 = disabled, " |
41 | "[1] = fkeyslast, 2 = fkeysfirst)"); | 42 | "[1] = fkeyslast, 2 = fkeysfirst)"); |
42 | 43 | ||
44 | static unsigned int iso_layout = 1; | ||
45 | module_param(iso_layout, uint, 0644); | ||
46 | MODULE_PARM_DESC(iso_layout, "Enable/Disable hardcoded ISO-layout of the keyboard. " | ||
47 | "(0 = disabled, [1] = enabled)"); | ||
48 | |||
43 | struct apple_sc { | 49 | struct apple_sc { |
44 | unsigned long quirks; | 50 | unsigned long quirks; |
45 | unsigned int fn_on; | 51 | unsigned int fn_on; |
@@ -199,11 +205,13 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input, | |||
199 | } | 205 | } |
200 | } | 206 | } |
201 | 207 | ||
202 | if (asc->quirks & APPLE_ISO_KEYBOARD) { | 208 | if (iso_layout) { |
203 | trans = apple_find_translation(apple_iso_keyboard, usage->code); | 209 | if (asc->quirks & APPLE_ISO_KEYBOARD) { |
204 | if (trans) { | 210 | trans = apple_find_translation(apple_iso_keyboard, usage->code); |
205 | input_event(input, usage->type, trans->to, value); | 211 | if (trans) { |
206 | return 1; | 212 | input_event(input, usage->type, trans->to, value); |
213 | return 1; | ||
214 | } | ||
207 | } | 215 | } |
208 | } | 216 | } |
209 | 217 | ||
@@ -431,6 +439,13 @@ static const struct hid_device_id apple_devices[] = { | |||
431 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, | 439 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, |
432 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS), | 440 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS), |
433 | .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, | 441 | .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
442 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), | ||
443 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, | ||
444 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO), | ||
445 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | ||
446 | APPLE_ISO_KEYBOARD }, | ||
447 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS), | ||
448 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, | ||
434 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY), | 449 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY), |
435 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, | 450 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
436 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY), | 451 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY), |