aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-apple.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-apple.c')
-rw-r--r--drivers/hid/hid-apple.c26
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
56static struct apple_key_translation apple_fn_keys[] = { 56static 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
78static struct apple_key_translation powerbook_fn_keys[] = { 78static 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
97static struct apple_key_translation powerbook_numlock_keys[] = { 97static 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
120static struct apple_key_translation apple_iso_keyboard[] = { 120static 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
126static struct apple_key_translation *apple_find_translation( 126static 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
254static void apple_setup_input(struct input_dev *input) 254static 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)
468module_init(apple_init); 474module_init(apple_init);
469module_exit(apple_exit); 475module_exit(apple_exit);
470MODULE_LICENSE("GPL"); 476MODULE_LICENSE("GPL");
471
472HID_COMPAT_LOAD_DRIVER(apple);