diff options
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-input.c | 28 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-quirks.c | 3 |
2 files changed, 31 insertions, 0 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 1b8b33341408..60de16a83c3e 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -60,6 +60,19 @@ static const unsigned char hid_keyboard[256] = { | |||
60 | 150,158,159,128,136,177,178,176,142,152,173,140,unk,unk,unk,unk | 60 | 150,158,159,128,136,177,178,176,142,152,173,140,unk,unk,unk,unk |
61 | }; | 61 | }; |
62 | 62 | ||
63 | /* extended mapping for certain Logitech hardware (Logitech cordless desktop LX500) */ | ||
64 | #define LOGITECH_EXPANDED_KEYMAP_SIZE 80 | ||
65 | static int logitech_expanded_keymap[LOGITECH_EXPANDED_KEYMAP_SIZE] = { | ||
66 | 0,216, 0,213,175,156, 0, 0, 0, 0, | ||
67 | 144, 0, 0, 0, 0, 0, 0, 0, 0,212, | ||
68 | 174,167,152,161,112, 0, 0, 0,154, 0, | ||
69 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
70 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
71 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||
72 | 0, 0, 0, 0, 0,183,184,185,186,187, | ||
73 | 188,189,190,191,192,193,194, 0, 0, 0 | ||
74 | }; | ||
75 | |||
63 | static const struct { | 76 | static const struct { |
64 | __s32 x; | 77 | __s32 x; |
65 | __s32 y; | 78 | __s32 y; |
@@ -378,6 +391,21 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel | |||
378 | } | 391 | } |
379 | } | 392 | } |
380 | 393 | ||
394 | /* Special handling for Logitech Cordless Desktop */ | ||
395 | if (field->application != HID_GD_MOUSE) { | ||
396 | if (device->quirks & HID_QUIRK_LOGITECH_EXPANDED_KEYMAP) { | ||
397 | int hid = usage->hid & HID_USAGE; | ||
398 | if (hid < LOGITECH_EXPANDED_KEYMAP_SIZE && logitech_expanded_keymap[hid] != 0) | ||
399 | code = logitech_expanded_keymap[hid]; | ||
400 | } | ||
401 | } else { | ||
402 | if (device->quirks & HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL) { | ||
403 | int hid = usage->hid & HID_USAGE; | ||
404 | if (hid == 7 || hid == 8) | ||
405 | goto ignore; | ||
406 | } | ||
407 | } | ||
408 | |||
381 | map_key(code); | 409 | map_key(code); |
382 | break; | 410 | break; |
383 | 411 | ||
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index a75c236fcafc..5614a70f564f 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -201,6 +201,7 @@ | |||
201 | #define USB_DEVICE_ID_LOGITECH_WHEEL 0xc294 | 201 | #define USB_DEVICE_ID_LOGITECH_WHEEL 0xc294 |
202 | #define USB_DEVICE_ID_S510_RECEIVER 0xc50c | 202 | #define USB_DEVICE_ID_S510_RECEIVER 0xc50c |
203 | #define USB_DEVICE_ID_S510_RECEIVER_2 0xc517 | 203 | #define USB_DEVICE_ID_S510_RECEIVER_2 0xc517 |
204 | #define USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500 0xc512 | ||
204 | #define USB_DEVICE_ID_MX3000_RECEIVER 0xc513 | 205 | #define USB_DEVICE_ID_MX3000_RECEIVER 0xc513 |
205 | #define USB_DEVICE_ID_DINOVO_EDGE 0xc714 | 206 | #define USB_DEVICE_ID_DINOVO_EDGE 0xc714 |
206 | 207 | ||
@@ -422,6 +423,8 @@ static const struct hid_blacklist { | |||
422 | { USB_VENDOR_ID_ACECAD, USB_DEVICE_ID_ACECAD_FLAIR, HID_QUIRK_IGNORE }, | 423 | { USB_VENDOR_ID_ACECAD, USB_DEVICE_ID_ACECAD_FLAIR, HID_QUIRK_IGNORE }, |
423 | { USB_VENDOR_ID_ACECAD, USB_DEVICE_ID_ACECAD_302, HID_QUIRK_IGNORE }, | 424 | { USB_VENDOR_ID_ACECAD, USB_DEVICE_ID_ACECAD_302, HID_QUIRK_IGNORE }, |
424 | 425 | ||
426 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500, HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL | HID_QUIRK_LOGITECH_EXPANDED_KEYMAP }, | ||
427 | |||
425 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL }, | 428 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL }, |
426 | 429 | ||
427 | { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, | 430 | { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, |