diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-03 18:25:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-03 18:25:44 -0400 |
commit | 5fba0925fd6b67d94181055b7222e3d934b4efee (patch) | |
tree | 167c0e259ec94f426674d3f79563c3e556cda845 /drivers/hid/hid-apple.c | |
parent | 811158b147a503fbdf9773224004ffd32002d1fe (diff) | |
parent | 621de593081524da2f0f7b060f5951b4155eb4a2 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
HID: remove compat stuff
HID: constify arrays of struct apple_key_translation
HID: add support for Kye/Genius Ergo 525V
HID: Support Apple mini aluminum keyboard
HID: support for Kensington slimblade device
HID: DragonRise game controller force feedback driver
HID: add support for another version of 0e8f:0003 device in hid-pl
HID: fix race between usb_register_dev() and hiddev_open()
HID: bring back possibility to specify vid/pid ignore on module load
HID: make HID_DEBUG defaults consistent
HID: autosuspend -- fix lockup of hid on reset
HID: hid_reset_resume() needs to be defined only when CONFIG_PM is set
HID: fix USB HID devices after STD with autosuspend
HID: do not try to compile PM code with CONFIG_PM unset
HID: autosuspend support for USB HID
Diffstat (limited to 'drivers/hid/hid-apple.c')
-rw-r--r-- | drivers/hid/hid-apple.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c index aa28aed0e46c..7359d9d88e46 100644 --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c | |||
@@ -53,7 +53,7 @@ struct apple_key_translation { | |||
53 | u8 flags; | 53 | u8 flags; |
54 | }; | 54 | }; |
55 | 55 | ||
56 | static struct apple_key_translation apple_fn_keys[] = { | 56 | static const struct apple_key_translation apple_fn_keys[] = { |
57 | { KEY_BACKSPACE, KEY_DELETE }, | 57 | { KEY_BACKSPACE, KEY_DELETE }, |
58 | { KEY_ENTER, KEY_INSERT }, | 58 | { KEY_ENTER, KEY_INSERT }, |
59 | { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY }, | 59 | { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY }, |
@@ -75,7 +75,7 @@ static struct apple_key_translation apple_fn_keys[] = { | |||
75 | { } | 75 | { } |
76 | }; | 76 | }; |
77 | 77 | ||
78 | static struct apple_key_translation powerbook_fn_keys[] = { | 78 | static const struct apple_key_translation powerbook_fn_keys[] = { |
79 | { KEY_BACKSPACE, KEY_DELETE }, | 79 | { KEY_BACKSPACE, KEY_DELETE }, |
80 | { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY }, | 80 | { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY }, |
81 | { KEY_F2, KEY_BRIGHTNESSUP, APPLE_FLAG_FKEY }, | 81 | { KEY_F2, KEY_BRIGHTNESSUP, APPLE_FLAG_FKEY }, |
@@ -94,7 +94,7 @@ static struct apple_key_translation powerbook_fn_keys[] = { | |||
94 | { } | 94 | { } |
95 | }; | 95 | }; |
96 | 96 | ||
97 | static struct apple_key_translation powerbook_numlock_keys[] = { | 97 | static const struct apple_key_translation powerbook_numlock_keys[] = { |
98 | { KEY_J, KEY_KP1 }, | 98 | { KEY_J, KEY_KP1 }, |
99 | { KEY_K, KEY_KP2 }, | 99 | { KEY_K, KEY_KP2 }, |
100 | { KEY_L, KEY_KP3 }, | 100 | { KEY_L, KEY_KP3 }, |
@@ -117,16 +117,16 @@ static struct apple_key_translation powerbook_numlock_keys[] = { | |||
117 | { } | 117 | { } |
118 | }; | 118 | }; |
119 | 119 | ||
120 | static struct apple_key_translation apple_iso_keyboard[] = { | 120 | static const struct apple_key_translation apple_iso_keyboard[] = { |
121 | { KEY_GRAVE, KEY_102ND }, | 121 | { KEY_GRAVE, KEY_102ND }, |
122 | { KEY_102ND, KEY_GRAVE }, | 122 | { KEY_102ND, KEY_GRAVE }, |
123 | { } | 123 | { } |
124 | }; | 124 | }; |
125 | 125 | ||
126 | static struct apple_key_translation *apple_find_translation( | 126 | static const struct apple_key_translation *apple_find_translation( |
127 | struct apple_key_translation *table, u16 from) | 127 | const struct apple_key_translation *table, u16 from) |
128 | { | 128 | { |
129 | struct apple_key_translation *trans; | 129 | const struct apple_key_translation *trans; |
130 | 130 | ||
131 | /* Look for the translation */ | 131 | /* Look for the translation */ |
132 | for (trans = table; trans->from; trans++) | 132 | for (trans = table; trans->from; trans++) |
@@ -140,7 +140,7 @@ static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input, | |||
140 | struct hid_usage *usage, __s32 value) | 140 | struct hid_usage *usage, __s32 value) |
141 | { | 141 | { |
142 | struct apple_sc *asc = hid_get_drvdata(hid); | 142 | struct apple_sc *asc = hid_get_drvdata(hid); |
143 | struct apple_key_translation *trans; | 143 | const struct apple_key_translation *trans; |
144 | 144 | ||
145 | if (usage->code == KEY_FN) { | 145 | if (usage->code == KEY_FN) { |
146 | asc->fn_on = !!value; | 146 | asc->fn_on = !!value; |
@@ -253,7 +253,7 @@ static void apple_report_fixup(struct hid_device *hdev, __u8 *rdesc, | |||
253 | 253 | ||
254 | static void apple_setup_input(struct input_dev *input) | 254 | static void apple_setup_input(struct input_dev *input) |
255 | { | 255 | { |
256 | struct apple_key_translation *trans; | 256 | const struct apple_key_translation *trans; |
257 | 257 | ||
258 | set_bit(KEY_NUMLOCK, input->keybit); | 258 | set_bit(KEY_NUMLOCK, input->keybit); |
259 | 259 | ||
@@ -387,6 +387,12 @@ static const struct hid_device_id apple_devices[] = { | |||
387 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS), | 387 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS), |
388 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | | 388 | .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | |
389 | APPLE_RDESC_JIS }, | 389 | APPLE_RDESC_JIS }, |
390 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_MINI_ANSI), | ||
391 | .driver_data = APPLE_HAS_FN }, | ||
392 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_MINI_ISO), | ||
393 | .driver_data = APPLE_HAS_FN | APPLE_ISO_KEYBOARD }, | ||
394 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_MINI_JIS), | ||
395 | .driver_data = APPLE_HAS_FN }, | ||
390 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ANSI), | 396 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ANSI), |
391 | .driver_data = APPLE_HAS_FN }, | 397 | .driver_data = APPLE_HAS_FN }, |
392 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ISO), | 398 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ISO), |
@@ -468,5 +474,3 @@ static void apple_exit(void) | |||
468 | module_init(apple_init); | 474 | module_init(apple_init); |
469 | module_exit(apple_exit); | 475 | module_exit(apple_exit); |
470 | MODULE_LICENSE("GPL"); | 476 | MODULE_LICENSE("GPL"); |
471 | |||
472 | HID_COMPAT_LOAD_DRIVER(apple); | ||