Blame view
drivers/hid/hid-apple.c
21.9 KB
2874c5fd2 treewide: Replace... |
1 |
// SPDX-License-Identifier: GPL-2.0-or-later |
8c19a5159 HID: move apple q... |
2 3 4 5 6 7 8 |
/* * USB HID quirks support for Linux * * Copyright (c) 1999 Andreas Gal * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc * Copyright (c) 2006-2007 Jiri Kosina |
8c19a5159 HID: move apple q... |
9 10 11 12 |
* Copyright (c) 2008 Jiri Slaby <jirislaby@gmail.com> */ /* |
8c19a5159 HID: move apple q... |
13 |
*/ |
4291ee305 HID: Add and use ... |
14 |
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
8c19a5159 HID: move apple q... |
15 16 17 |
#include <linux/device.h> #include <linux/hid.h> #include <linux/module.h> |
5a0e3ad6a include cleanup: ... |
18 |
#include <linux/slab.h> |
8c19a5159 HID: move apple q... |
19 20 21 22 23 24 25 |
#include "hid-ids.h" #define APPLE_RDESC_JIS 0x0001 #define APPLE_IGNORE_MOUSE 0x0002 #define APPLE_HAS_FN 0x0004 #define APPLE_HIDDEV 0x0008 |
bd77a0f08 HID: apple: Use c... |
26 |
/* 0x0010 reserved, was: APPLE_ISO_KEYBOARD */ |
8c19a5159 HID: move apple q... |
27 28 29 30 31 32 |
#define APPLE_MIGHTYMOUSE 0x0020 #define APPLE_INVERT_HWHEEL 0x0040 #define APPLE_IGNORE_HIDINPUT 0x0080 #define APPLE_NUMLOCK_EMULATION 0x0100 #define APPLE_FLAG_FKEY 0x01 |
bd77a0f08 HID: apple: Use c... |
33 |
#define HID_COUNTRY_INTERNATIONAL_ISO 13 |
8c19a5159 HID: move apple q... |
34 35 36 37 |
static unsigned int fnmode = 1; module_param(fnmode, uint, 0644); MODULE_PARM_DESC(fnmode, "Mode of fn key on Apple keyboards (0 = disabled, " "[1] = fkeyslast, 2 = fkeysfirst)"); |
54a6593d6 HID: allow disabl... |
38 39 40 41 |
static unsigned int iso_layout = 1; module_param(iso_layout, uint, 0644); MODULE_PARM_DESC(iso_layout, "Enable/Disable hardcoded ISO-layout of the keyboard. " "(0 = disabled, [1] = enabled)"); |
a94c79bdc HID: apple: swap_... |
42 |
static unsigned int swap_opt_cmd; |
43c831468 HID: apple: optio... |
43 44 45 46 |
module_param(swap_opt_cmd, uint, 0644); MODULE_PARM_DESC(swap_opt_cmd, "Swap the Option (\"Alt\") and Command (\"Flag\") keys. " "(For people who want to keep Windows PC keyboard muscle memory. " "[0] = as-is, Mac layout. 1 = swapped, Windows layout.)"); |
346338ef0 HID: apple: Swap ... |
47 48 49 50 51 |
static unsigned int swap_fn_leftctrl; module_param(swap_fn_leftctrl, uint, 0644); MODULE_PARM_DESC(swap_fn_leftctrl, "Swap the Fn and left Control keys. " "(For people who want to keep PC keyboard muscle memory. " "[0] = as-is, Mac layout, 1 = swapped, PC layout)"); |
8c19a5159 HID: move apple q... |
52 53 54 |
struct apple_sc { unsigned long quirks; unsigned int fn_on; |
a5d81646f HID: apple: Disab... |
55 |
unsigned int fn_found; |
8c19a5159 HID: move apple q... |
56 57 58 59 60 61 62 63 |
DECLARE_BITMAP(pressed_numlock, KEY_CNT); }; struct apple_key_translation { u16 from; u16 to; u8 flags; }; |
99b9f758b HID: add MacBookA... |
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
static const struct apple_key_translation macbookair_fn_keys[] = { { KEY_BACKSPACE, KEY_DELETE }, { KEY_ENTER, KEY_INSERT }, { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY }, { KEY_F2, KEY_BRIGHTNESSUP, APPLE_FLAG_FKEY }, { KEY_F3, KEY_SCALE, APPLE_FLAG_FKEY }, { KEY_F4, KEY_DASHBOARD, APPLE_FLAG_FKEY }, { KEY_F6, KEY_PREVIOUSSONG, APPLE_FLAG_FKEY }, { KEY_F7, KEY_PLAYPAUSE, APPLE_FLAG_FKEY }, { KEY_F8, KEY_NEXTSONG, APPLE_FLAG_FKEY }, { KEY_F9, KEY_MUTE, APPLE_FLAG_FKEY }, { KEY_F10, KEY_VOLUMEDOWN, APPLE_FLAG_FKEY }, { KEY_F11, KEY_VOLUMEUP, APPLE_FLAG_FKEY }, { KEY_F12, KEY_EJECTCD, APPLE_FLAG_FKEY }, { KEY_UP, KEY_PAGEUP }, { KEY_DOWN, KEY_PAGEDOWN }, { KEY_LEFT, KEY_HOME }, { KEY_RIGHT, KEY_END }, { } }; |
b2ddd54e1 HID: constify arr... |
84 |
static const struct apple_key_translation apple_fn_keys[] = { |
8c19a5159 HID: move apple q... |
85 |
{ KEY_BACKSPACE, KEY_DELETE }, |
437184ae8 HID: map macbook ... |
86 |
{ KEY_ENTER, KEY_INSERT }, |
8c19a5159 HID: move apple q... |
87 88 |
{ KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY }, { KEY_F2, KEY_BRIGHTNESSUP, APPLE_FLAG_FKEY }, |
437184ae8 HID: map macbook ... |
89 90 |
{ KEY_F3, KEY_SCALE, APPLE_FLAG_FKEY }, { KEY_F4, KEY_DASHBOARD, APPLE_FLAG_FKEY }, |
8c19a5159 HID: move apple q... |
91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
{ KEY_F5, KEY_KBDILLUMDOWN, APPLE_FLAG_FKEY }, { KEY_F6, KEY_KBDILLUMUP, APPLE_FLAG_FKEY }, { KEY_F7, KEY_PREVIOUSSONG, APPLE_FLAG_FKEY }, { KEY_F8, KEY_PLAYPAUSE, APPLE_FLAG_FKEY }, { KEY_F9, KEY_NEXTSONG, APPLE_FLAG_FKEY }, { KEY_F10, KEY_MUTE, APPLE_FLAG_FKEY }, { KEY_F11, KEY_VOLUMEDOWN, APPLE_FLAG_FKEY }, { KEY_F12, KEY_VOLUMEUP, APPLE_FLAG_FKEY }, { KEY_UP, KEY_PAGEUP }, { KEY_DOWN, KEY_PAGEDOWN }, { KEY_LEFT, KEY_HOME }, { KEY_RIGHT, KEY_END }, { } }; |
b2ddd54e1 HID: constify arr... |
105 |
static const struct apple_key_translation powerbook_fn_keys[] = { |
8c19a5159 HID: move apple q... |
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
{ KEY_BACKSPACE, KEY_DELETE }, { KEY_F1, KEY_BRIGHTNESSDOWN, APPLE_FLAG_FKEY }, { KEY_F2, KEY_BRIGHTNESSUP, APPLE_FLAG_FKEY }, { KEY_F3, KEY_MUTE, APPLE_FLAG_FKEY }, { KEY_F4, KEY_VOLUMEDOWN, APPLE_FLAG_FKEY }, { KEY_F5, KEY_VOLUMEUP, APPLE_FLAG_FKEY }, { KEY_F6, KEY_NUMLOCK, APPLE_FLAG_FKEY }, { KEY_F7, KEY_SWITCHVIDEOMODE, APPLE_FLAG_FKEY }, { KEY_F8, KEY_KBDILLUMTOGGLE, APPLE_FLAG_FKEY }, { KEY_F9, KEY_KBDILLUMDOWN, APPLE_FLAG_FKEY }, { KEY_F10, KEY_KBDILLUMUP, APPLE_FLAG_FKEY }, { KEY_UP, KEY_PAGEUP }, { KEY_DOWN, KEY_PAGEDOWN }, { KEY_LEFT, KEY_HOME }, { KEY_RIGHT, KEY_END }, { } }; |
b2ddd54e1 HID: constify arr... |
123 |
static const struct apple_key_translation powerbook_numlock_keys[] = { |
8c19a5159 HID: move apple q... |
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
{ KEY_J, KEY_KP1 }, { KEY_K, KEY_KP2 }, { KEY_L, KEY_KP3 }, { KEY_U, KEY_KP4 }, { KEY_I, KEY_KP5 }, { KEY_O, KEY_KP6 }, { KEY_7, KEY_KP7 }, { KEY_8, KEY_KP8 }, { KEY_9, KEY_KP9 }, { KEY_M, KEY_KP0 }, { KEY_DOT, KEY_KPDOT }, { KEY_SLASH, KEY_KPPLUS }, { KEY_SEMICOLON, KEY_KPMINUS }, { KEY_P, KEY_KPASTERISK }, { KEY_MINUS, KEY_KPEQUAL }, { KEY_0, KEY_KPSLASH }, { KEY_F6, KEY_NUMLOCK }, { KEY_KPENTER, KEY_KPENTER }, { KEY_BACKSPACE, KEY_BACKSPACE }, { } }; |
b2ddd54e1 HID: constify arr... |
145 |
static const struct apple_key_translation apple_iso_keyboard[] = { |
8c19a5159 HID: move apple q... |
146 147 148 149 |
{ KEY_GRAVE, KEY_102ND }, { KEY_102ND, KEY_GRAVE }, { } }; |
43c831468 HID: apple: optio... |
150 151 152 153 154 155 156 |
static const struct apple_key_translation swapped_option_cmd_keys[] = { { KEY_LEFTALT, KEY_LEFTMETA }, { KEY_LEFTMETA, KEY_LEFTALT }, { KEY_RIGHTALT, KEY_RIGHTMETA }, { KEY_RIGHTMETA,KEY_RIGHTALT }, { } }; |
346338ef0 HID: apple: Swap ... |
157 158 159 160 |
static const struct apple_key_translation swapped_fn_leftctrl_keys[] = { { KEY_FN, KEY_LEFTCTRL }, { } }; |
b2ddd54e1 HID: constify arr... |
161 162 |
static const struct apple_key_translation *apple_find_translation( const struct apple_key_translation *table, u16 from) |
8c19a5159 HID: move apple q... |
163 |
{ |
b2ddd54e1 HID: constify arr... |
164 |
const struct apple_key_translation *trans; |
8c19a5159 HID: move apple q... |
165 166 167 168 169 170 171 172 173 174 175 176 177 |
/* Look for the translation */ for (trans = table; trans->from; trans++) if (trans->from == from) return trans; return NULL; } static int hidinput_apple_event(struct hid_device *hid, struct input_dev *input, struct hid_usage *usage, __s32 value) { struct apple_sc *asc = hid_get_drvdata(hid); |
a4bc6926d HID: make transla... |
178 |
const struct apple_key_translation *trans, *table; |
aec256d0e HID: apple: Fix s... |
179 180 |
bool do_translate; u16 code = 0; |
8c19a5159 HID: move apple q... |
181 |
|
346338ef0 HID: apple: Swap ... |
182 183 184 |
u16 fn_keycode = (swap_fn_leftctrl) ? (KEY_LEFTCTRL) : (KEY_FN); if (usage->code == fn_keycode) { |
8c19a5159 HID: move apple q... |
185 |
asc->fn_on = !!value; |
346338ef0 HID: apple: Swap ... |
186 |
input_event(input, usage->type, KEY_FN, value); |
8c19a5159 HID: move apple q... |
187 188 189 190 |
return 1; } if (fnmode) { |
a4bc6926d HID: make transla... |
191 192 193 194 195 196 197 198 199 |
if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI && hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS) table = macbookair_fn_keys; else if (hid->product < 0x21d || hid->product >= 0x300) table = powerbook_fn_keys; else table = apple_fn_keys; trans = apple_find_translation (table, usage->code); |
99b9f758b HID: add MacBookA... |
200 |
|
8c19a5159 HID: move apple q... |
201 |
if (trans) { |
aec256d0e HID: apple: Fix s... |
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 |
if (test_bit(trans->from, input->key)) code = trans->from; else if (test_bit(trans->to, input->key)) code = trans->to; if (!code) { if (trans->flags & APPLE_FLAG_FKEY) { switch (fnmode) { case 1: do_translate = !asc->fn_on; break; case 2: do_translate = asc->fn_on; break; default: /* should never happen */ do_translate = false; } } else { do_translate = asc->fn_on; } code = do_translate ? trans->to : trans->from; |
8c19a5159 HID: move apple q... |
225 |
} |
aec256d0e HID: apple: Fix s... |
226 227 228 |
input_event(input, usage->type, code, value); return 1; |
8c19a5159 HID: move apple q... |
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
} if (asc->quirks & APPLE_NUMLOCK_EMULATION && (test_bit(usage->code, asc->pressed_numlock) || test_bit(LED_NUML, input->led))) { trans = apple_find_translation(powerbook_numlock_keys, usage->code); if (trans) { if (value) set_bit(usage->code, asc->pressed_numlock); else clear_bit(usage->code, asc->pressed_numlock); input_event(input, usage->type, trans->to, value); } return 1; } } |
9f1f463ae HID: hid-apple: f... |
252 |
if (iso_layout) { |
bd77a0f08 HID: apple: Use c... |
253 |
if (hid->country == HID_COUNTRY_INTERNATIONAL_ISO) { |
54a6593d6 HID: allow disabl... |
254 255 256 257 258 |
trans = apple_find_translation(apple_iso_keyboard, usage->code); if (trans) { input_event(input, usage->type, trans->to, value); return 1; } |
8c19a5159 HID: move apple q... |
259 260 |
} } |
43c831468 HID: apple: optio... |
261 262 263 264 265 266 267 |
if (swap_opt_cmd) { trans = apple_find_translation(swapped_option_cmd_keys, usage->code); if (trans) { input_event(input, usage->type, trans->to, value); return 1; } } |
346338ef0 HID: apple: Swap ... |
268 269 270 271 272 273 274 |
if (swap_fn_leftctrl) { trans = apple_find_translation(swapped_fn_leftctrl_keys, usage->code); if (trans) { input_event(input, usage->type, trans->to, value); return 1; } } |
8c19a5159 HID: move apple q... |
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
return 0; } static int apple_event(struct hid_device *hdev, struct hid_field *field, struct hid_usage *usage, __s32 value) { struct apple_sc *asc = hid_get_drvdata(hdev); if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput || !usage->type) return 0; if ((asc->quirks & APPLE_INVERT_HWHEEL) && usage->code == REL_HWHEEL) { input_event(field->hidinput->input, usage->type, usage->code, -value); return 1; } if ((asc->quirks & APPLE_HAS_FN) && hidinput_apple_event(hdev, field->hidinput->input, usage, value)) return 1; return 0; } /* * MacBook JIS keyboard has wrong logical maximum */ |
73e4008dd HID: allow resizi... |
306 307 |
static __u8 *apple_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) |
8c19a5159 HID: move apple q... |
308 309 |
{ struct apple_sc *asc = hid_get_drvdata(hdev); |
73e4008dd HID: allow resizi... |
310 |
if ((asc->quirks & APPLE_RDESC_JIS) && *rsize >= 60 && |
8c19a5159 HID: move apple q... |
311 |
rdesc[53] == 0x65 && rdesc[59] == 0x65) { |
4291ee305 HID: Add and use ... |
312 313 314 |
hid_info(hdev, "fixing up MacBook JIS keyboard report descriptor "); |
8c19a5159 HID: move apple q... |
315 316 |
rdesc[53] = rdesc[59] = 0xe7; } |
73e4008dd HID: allow resizi... |
317 |
return rdesc; |
8c19a5159 HID: move apple q... |
318 319 320 321 |
} static void apple_setup_input(struct input_dev *input) { |
b2ddd54e1 HID: constify arr... |
322 |
const struct apple_key_translation *trans; |
8c19a5159 HID: move apple q... |
323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
set_bit(KEY_NUMLOCK, input->keybit); /* Enable all needed keys */ for (trans = apple_fn_keys; trans->from; trans++) set_bit(trans->to, input->keybit); for (trans = powerbook_fn_keys; trans->from; trans++) set_bit(trans->to, input->keybit); for (trans = powerbook_numlock_keys; trans->from; trans++) set_bit(trans->to, input->keybit); for (trans = apple_iso_keyboard; trans->from; trans++) set_bit(trans->to, input->keybit); |
346338ef0 HID: apple: Swap ... |
338 339 340 341 342 |
if (swap_fn_leftctrl) { for (trans = swapped_fn_leftctrl_keys; trans->from; trans++) set_bit(trans->to, input->keybit); } |
8c19a5159 HID: move apple q... |
343 344 345 346 347 348 |
} static int apple_input_mapping(struct hid_device *hdev, struct hid_input *hi, struct hid_field *field, struct hid_usage *usage, unsigned long **bit, int *max) { |
a5d81646f HID: apple: Disab... |
349 |
struct apple_sc *asc = hid_get_drvdata(hdev); |
ee3454924 HID: add support ... |
350 |
if (usage->hid == (HID_UP_CUSTOM | 0x0003) || |
e433be929 HID: apple: Add s... |
351 352 |
usage->hid == (HID_UP_MSVENDOR | 0x0003) || usage->hid == (HID_UP_HPVENDOR2 | 0x0003)) { |
8c19a5159 HID: move apple q... |
353 354 355 |
/* The fn key on Apple USB keyboards */ set_bit(EV_REP, hi->input->evbit); hid_map_usage_clear(hi, usage, bit, max, EV_KEY, KEY_FN); |
a5d81646f HID: apple: Disab... |
356 |
asc->fn_found = true; |
8c19a5159 HID: move apple q... |
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
apple_setup_input(hi->input); return 1; } /* we want the hid layer to go through standard path (set and ignore) */ return 0; } static int apple_input_mapped(struct hid_device *hdev, struct hid_input *hi, struct hid_field *field, struct hid_usage *usage, unsigned long **bit, int *max) { struct apple_sc *asc = hid_get_drvdata(hdev); if (asc->quirks & APPLE_MIGHTYMOUSE) { if (usage->hid == HID_GD_Z) hid_map_usage(hi, usage, bit, max, EV_REL, REL_HWHEEL); else if (usage->code == BTN_1) hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_2); else if (usage->code == BTN_2) hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_1); } return 0; } |
a5d81646f HID: apple: Disab... |
382 383 384 385 386 387 388 389 390 391 392 393 394 |
static int apple_input_configured(struct hid_device *hdev, struct hid_input *hidinput) { struct apple_sc *asc = hid_get_drvdata(hdev); if ((asc->quirks & APPLE_HAS_FN) && !asc->fn_found) { hid_info(hdev, "Fn key not found (Apple Wireless Keyboard clone?), disabling Fn key handling "); asc->quirks = 0; } return 0; } |
8c19a5159 HID: move apple q... |
395 396 397 398 399 |
static int apple_probe(struct hid_device *hdev, const struct hid_device_id *id) { unsigned long quirks = id->driver_data; struct apple_sc *asc; |
93c10132a HID: move connect... |
400 |
unsigned int connect_mask = HID_CONNECT_DEFAULT; |
8c19a5159 HID: move apple q... |
401 |
int ret; |
abf832bfc HID: trivial devm... |
402 |
asc = devm_kzalloc(&hdev->dev, sizeof(*asc), GFP_KERNEL); |
8c19a5159 HID: move apple q... |
403 |
if (asc == NULL) { |
4291ee305 HID: Add and use ... |
404 405 |
hid_err(hdev, "can't alloc apple descriptor "); |
8c19a5159 HID: move apple q... |
406 407 408 409 410 411 |
return -ENOMEM; } asc->quirks = quirks; hid_set_drvdata(hdev, asc); |
8c19a5159 HID: move apple q... |
412 413 |
ret = hid_parse(hdev); if (ret) { |
4291ee305 HID: Add and use ... |
414 415 |
hid_err(hdev, "parse failed "); |
abf832bfc HID: trivial devm... |
416 |
return ret; |
8c19a5159 HID: move apple q... |
417 |
} |
93c10132a HID: move connect... |
418 419 420 421 422 423 |
if (quirks & APPLE_HIDDEV) connect_mask |= HID_CONNECT_HIDDEV_FORCE; if (quirks & APPLE_IGNORE_HIDINPUT) connect_mask &= ~HID_CONNECT_HIDINPUT; ret = hid_hw_start(hdev, connect_mask); |
8c19a5159 HID: move apple q... |
424 |
if (ret) { |
4291ee305 HID: Add and use ... |
425 426 |
hid_err(hdev, "hw start failed "); |
abf832bfc HID: trivial devm... |
427 |
return ret; |
8c19a5159 HID: move apple q... |
428 429 430 |
} return 0; |
8c19a5159 HID: move apple q... |
431 432 433 |
} static const struct hid_device_id apple_devices[] = { |
8c19a5159 HID: move apple q... |
434 435 436 437 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE), .driver_data = APPLE_MIGHTYMOUSE | APPLE_INVERT_HWHEEL }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI), |
b4d8e4736 HID: fix hidbus/a... |
438 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
439 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO), |
b4d8e4736 HID: fix hidbus/a... |
440 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
441 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI), |
b4d8e4736 HID: fix hidbus/a... |
442 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
443 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ISO), |
bd77a0f08 HID: apple: Use c... |
444 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
445 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_JIS), |
b4d8e4736 HID: fix hidbus/a... |
446 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
447 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI), |
b4d8e4736 HID: fix hidbus/a... |
448 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
449 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO), |
bd77a0f08 HID: apple: Use c... |
450 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
451 452 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | |
b4d8e4736 HID: fix hidbus/a... |
453 |
APPLE_RDESC_JIS }, |
8c19a5159 HID: move apple q... |
454 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI), |
b4d8e4736 HID: fix hidbus/a... |
455 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
456 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO), |
bd77a0f08 HID: apple: Use c... |
457 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
458 459 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | |
b4d8e4736 HID: fix hidbus/a... |
460 |
APPLE_RDESC_JIS }, |
fef3f571e HID: Support Appl... |
461 462 463 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_MINI_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_MINI_ISO), |
bd77a0f08 HID: apple: Use c... |
464 |
.driver_data = APPLE_HAS_FN }, |
fef3f571e HID: Support Appl... |
465 466 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_MINI_JIS), .driver_data = APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
467 468 469 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ISO), |
bd77a0f08 HID: apple: Use c... |
470 |
.driver_data = APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
471 472 473 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_JIS), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI), |
b4d8e4736 HID: fix hidbus/a... |
474 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
475 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO), |
bd77a0f08 HID: apple: Use c... |
476 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
477 478 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN | |
b4d8e4736 HID: fix hidbus/a... |
479 |
APPLE_RDESC_JIS }, |
4a4c87990 HID: add support ... |
480 481 482 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ISO), |
bd77a0f08 HID: apple: Use c... |
483 |
.driver_data = APPLE_HAS_FN }, |
4c9454267 HID: apple: Add s... |
484 485 |
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ISO), .driver_data = APPLE_HAS_FN }, |
4a4c87990 HID: add support ... |
486 487 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_JIS), .driver_data = APPLE_HAS_FN }, |
ee8a1a0a1 HID: Apple ALU wi... |
488 |
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI), |
8c19a5159 HID: move apple q... |
489 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
ee8a1a0a1 HID: Apple ALU wi... |
490 |
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO), |
bd77a0f08 HID: apple: Use c... |
491 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
ad734bc15 HID: hid-apple: a... |
492 |
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO), |
bd77a0f08 HID: apple: Use c... |
493 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
0a97e1e9f HID: apple: Add A... |
494 495 496 |
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
bd4a7ce1d HID: apple: add A... |
497 498 499 |
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_JIS), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
ee8a1a0a1 HID: Apple ALU wi... |
500 |
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS), |
8c19a5159 HID: move apple q... |
501 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
b5d942754 HID: add usb devi... |
502 503 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI), .driver_data = APPLE_HAS_FN }, |
ee3454924 HID: add support ... |
504 505 506 507 508 509 |
{ HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_ANSI), .driver_data = APPLE_HAS_FN }, { HID_BLUETOOTH_DEVICE(BT_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_ANSI), .driver_data = APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
510 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI), |
b4d8e4736 HID: fix hidbus/a... |
511 |
.driver_data = APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
512 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ISO), |
bd77a0f08 HID: apple: Use c... |
513 |
.driver_data = APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
514 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_JIS), |
b4d8e4736 HID: fix hidbus/a... |
515 |
.driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
8c19a5159 HID: move apple q... |
516 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI), |
b4d8e4736 HID: fix hidbus/a... |
517 |
.driver_data = APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
518 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO), |
bd77a0f08 HID: apple: Use c... |
519 |
.driver_data = APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
520 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS), |
b4d8e4736 HID: fix hidbus/a... |
521 |
.driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
a96d6ef34 HID: support for ... |
522 523 524 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO), |
bd77a0f08 HID: apple: Use c... |
525 |
.driver_data = APPLE_HAS_FN }, |
a96d6ef34 HID: support for ... |
526 527 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
99b9f758b HID: add MacBookA... |
528 529 530 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ISO), |
bd77a0f08 HID: apple: Use c... |
531 |
.driver_data = APPLE_HAS_FN }, |
99b9f758b HID: add MacBookA... |
532 533 534 535 536 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO), |
bd77a0f08 HID: apple: Use c... |
537 |
.driver_data = APPLE_HAS_FN }, |
99b9f758b HID: add MacBookA... |
538 539 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
47340bd9f Input: bcm5974 - ... |
540 541 542 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_ISO), |
bd77a0f08 HID: apple: Use c... |
543 |
.driver_data = APPLE_HAS_FN }, |
47340bd9f Input: bcm5974 - ... |
544 545 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
5d922baa6 HID: add support ... |
546 547 548 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_ISO), |
bd77a0f08 HID: apple: Use c... |
549 |
.driver_data = APPLE_HAS_FN }, |
5d922baa6 HID: add support ... |
550 551 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
d762cc290 HID: Add support ... |
552 553 554 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO), |
bd77a0f08 HID: apple: Use c... |
555 |
.driver_data = APPLE_HAS_FN }, |
d762cc290 HID: Add support ... |
556 557 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
213f9da80 HID: Add device I... |
558 559 560 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_ISO), |
bd77a0f08 HID: apple: Use c... |
561 |
.driver_data = APPLE_HAS_FN }, |
213f9da80 HID: Add device I... |
562 563 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING5A_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
b2e6ad7df HID: add support ... |
564 565 566 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_ISO), |
bd77a0f08 HID: apple: Use c... |
567 |
.driver_data = APPLE_HAS_FN }, |
b2e6ad7df HID: add support ... |
568 569 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
8d80da90f HID: Add support ... |
570 571 572 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO), |
bd77a0f08 HID: apple: Use c... |
573 |
.driver_data = APPLE_HAS_FN }, |
8d80da90f HID: Add support ... |
574 575 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
9d9a04ee7 HID: apple: Add s... |
576 577 578 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_ISO), |
bd77a0f08 HID: apple: Use c... |
579 |
.driver_data = APPLE_HAS_FN }, |
9d9a04ee7 HID: apple: Add s... |
580 581 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING8_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
a4a2c5456 HID: apple: Add s... |
582 583 584 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ANSI), .driver_data = APPLE_HAS_FN }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_ISO), |
bd77a0f08 HID: apple: Use c... |
585 |
.driver_data = APPLE_HAS_FN }, |
a4a2c5456 HID: apple: Add s... |
586 587 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING9_JIS), .driver_data = APPLE_HAS_FN | APPLE_RDESC_JIS }, |
23aeb61e7 HID: add device I... |
588 589 590 |
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO), |
bd77a0f08 HID: apple: Use c... |
591 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
23aeb61e7 HID: add device I... |
592 593 |
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS), .driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
594 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY), |
b4d8e4736 HID: fix hidbus/a... |
595 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
596 |
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY), |
b4d8e4736 HID: fix hidbus/a... |
597 |
.driver_data = APPLE_NUMLOCK_EMULATION | APPLE_HAS_FN }, |
8c19a5159 HID: move apple q... |
598 |
|
8c19a5159 HID: move apple q... |
599 600 601 602 603 604 605 606 607 |
{ } }; MODULE_DEVICE_TABLE(hid, apple_devices); static struct hid_driver apple_driver = { .name = "apple", .id_table = apple_devices, .report_fixup = apple_report_fixup, .probe = apple_probe, |
8c19a5159 HID: move apple q... |
608 609 610 |
.event = apple_event, .input_mapping = apple_input_mapping, .input_mapped = apple_input_mapped, |
a5d81646f HID: apple: Disab... |
611 |
.input_configured = apple_input_configured, |
8c19a5159 HID: move apple q... |
612 |
}; |
f425458ea HID: Use module_h... |
613 |
module_hid_driver(apple_driver); |
8c19a5159 HID: move apple q... |
614 |
|
8c19a5159 HID: move apple q... |
615 |
MODULE_LICENSE("GPL"); |