diff options
-rw-r--r-- | drivers/hid/hid-input-quirks.c | 34 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-quirks.c | 5 | ||||
-rw-r--r-- | include/linux/hid.h | 1 |
3 files changed, 40 insertions, 0 deletions
diff --git a/drivers/hid/hid-input-quirks.c b/drivers/hid/hid-input-quirks.c index 7f2f80b00d74..e378b4a5eeac 100644 --- a/drivers/hid/hid-input-quirks.c +++ b/drivers/hid/hid-input-quirks.c | |||
@@ -253,6 +253,27 @@ static int quirk_cherry_genius_29e(struct hid_usage *usage, struct input_dev *in | |||
253 | return 1; | 253 | return 1; |
254 | } | 254 | } |
255 | 255 | ||
256 | static int quirk_btc_8193(struct hid_usage *usage, struct input_dev *input, | ||
257 | unsigned long *bit, int *max) | ||
258 | { | ||
259 | if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) | ||
260 | return 0; | ||
261 | |||
262 | switch (usage->hid & HID_USAGE) { | ||
263 | case 0x230: map_key(BTN_MOUSE); break; | ||
264 | case 0x231: map_rel(REL_WHEEL); break; | ||
265 | /* | ||
266 | * this keyboard has a scrollwheel implemented in | ||
267 | * totally broken way. We map this usage temporarily | ||
268 | * to HWHEEL and handle it in the event quirk handler | ||
269 | */ | ||
270 | case 0x232: map_rel(REL_HWHEEL); break; | ||
271 | |||
272 | default: | ||
273 | return 0; | ||
274 | } | ||
275 | return 1; | ||
276 | } | ||
256 | 277 | ||
257 | #define VENDOR_ID_BELKIN 0x1020 | 278 | #define VENDOR_ID_BELKIN 0x1020 |
258 | #define DEVICE_ID_BELKIN_WIRELESS_KEYBOARD 0x0006 | 279 | #define DEVICE_ID_BELKIN_WIRELESS_KEYBOARD 0x0006 |
@@ -263,6 +284,9 @@ static int quirk_cherry_genius_29e(struct hid_usage *usage, struct input_dev *in | |||
263 | #define VENDOR_ID_CHICONY 0x04f2 | 284 | #define VENDOR_ID_CHICONY 0x04f2 |
264 | #define DEVICE_ID_CHICONY_TACTICAL_PAD 0x0418 | 285 | #define DEVICE_ID_CHICONY_TACTICAL_PAD 0x0418 |
265 | 286 | ||
287 | #define VENDOR_ID_EZKEY 0x0518 | ||
288 | #define DEVICE_ID_BTC_8193 0x0002 | ||
289 | |||
266 | #define VENDOR_ID_LOGITECH 0x046d | 290 | #define VENDOR_ID_LOGITECH 0x046d |
267 | #define DEVICE_ID_LOGITECH_RECEIVER 0xc101 | 291 | #define DEVICE_ID_LOGITECH_RECEIVER 0xc101 |
268 | #define DEVICE_ID_S510_RECEIVER 0xc50c | 292 | #define DEVICE_ID_S510_RECEIVER 0xc50c |
@@ -291,6 +315,8 @@ static const struct hid_input_blacklist { | |||
291 | 315 | ||
292 | { VENDOR_ID_CHICONY, DEVICE_ID_CHICONY_TACTICAL_PAD, quirk_chicony_tactical_pad }, | 316 | { VENDOR_ID_CHICONY, DEVICE_ID_CHICONY_TACTICAL_PAD, quirk_chicony_tactical_pad }, |
293 | 317 | ||
318 | { VENDOR_ID_EZKEY, DEVICE_ID_BTC_8193, quirk_btc_8193 }, | ||
319 | |||
294 | { VENDOR_ID_LOGITECH, DEVICE_ID_LOGITECH_RECEIVER, quirk_logitech_ultrax_remote }, | 320 | { VENDOR_ID_LOGITECH, DEVICE_ID_LOGITECH_RECEIVER, quirk_logitech_ultrax_remote }, |
295 | { VENDOR_ID_LOGITECH, DEVICE_ID_S510_RECEIVER, quirk_logitech_wireless }, | 321 | { VENDOR_ID_LOGITECH, DEVICE_ID_S510_RECEIVER, quirk_logitech_wireless }, |
296 | { VENDOR_ID_LOGITECH, DEVICE_ID_S510_RECEIVER_2, quirk_logitech_wireless }, | 322 | { VENDOR_ID_LOGITECH, DEVICE_ID_S510_RECEIVER_2, quirk_logitech_wireless }, |
@@ -323,6 +349,7 @@ int hidinput_mapping_quirks(struct hid_usage *usage, | |||
323 | return 0; | 349 | return 0; |
324 | } | 350 | } |
325 | 351 | ||
352 | #define IS_BTC8193(x) (x->vendor == 0x0518 && x->product == 0x0002) | ||
326 | #define IS_MS_KB(x) (x->vendor == 0x045e && (x->product == 0x00db || x->product == 0x00f9)) | 353 | #define IS_MS_KB(x) (x->vendor == 0x045e && (x->product == 0x00db || x->product == 0x00f9)) |
327 | 354 | ||
328 | void hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value) | 355 | void hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value) |
@@ -384,6 +411,13 @@ void hidinput_event_quirks(struct hid_device *hid, struct hid_field *field, stru | |||
384 | input_event(input, usage->type, last_key, 0); | 411 | input_event(input, usage->type, last_key, 0); |
385 | } | 412 | } |
386 | } | 413 | } |
414 | |||
415 | /* handle the temporary quirky mapping to HWHEEL */ | ||
416 | if (hid->quirks & HID_QUIRK_HWHEEL_WHEEL_INVERT && | ||
417 | usage->type == EV_REL && usage->code == REL_HWHEEL) { | ||
418 | input_event(input, usage->type, REL_WHEEL, -value); | ||
419 | return; | ||
420 | } | ||
387 | } | 421 | } |
388 | 422 | ||
389 | 423 | ||
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index d844757ed8de..aa470f8c0103 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -118,6 +118,9 @@ | |||
118 | #define USB_VENDOR_ID_ESSENTIAL_REALITY 0x0d7f | 118 | #define USB_VENDOR_ID_ESSENTIAL_REALITY 0x0d7f |
119 | #define USB_DEVICE_ID_ESSENTIAL_REALITY_P5 0x0100 | 119 | #define USB_DEVICE_ID_ESSENTIAL_REALITY_P5 0x0100 |
120 | 120 | ||
121 | #define USB_VENDOR_ID_EZKEY 0x0518 | ||
122 | #define USB_DEVICE_ID_BTC_8193 0x0002 | ||
123 | |||
121 | #define USB_VENDOR_ID_GAMERON 0x0810 | 124 | #define USB_VENDOR_ID_GAMERON 0x0810 |
122 | #define USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR 0x0001 | 125 | #define USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR 0x0001 |
123 | 126 | ||
@@ -400,6 +403,8 @@ static const struct hid_blacklist { | |||
400 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4, HID_QUIRK_HIDDEV | HID_QUIRK_IGNORE_HIDINPUT }, | 403 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4, HID_QUIRK_HIDDEV | HID_QUIRK_IGNORE_HIDINPUT }, |
401 | { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV, HID_QUIRK_HIDINPUT }, | 404 | { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV, HID_QUIRK_HIDINPUT }, |
402 | 405 | ||
406 | { USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193, HID_QUIRK_HWHEEL_WHEEL_INVERT }, | ||
407 | |||
403 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_01, HID_QUIRK_IGNORE }, | 408 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_01, HID_QUIRK_IGNORE }, |
404 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_10, HID_QUIRK_IGNORE }, | 409 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_10, HID_QUIRK_IGNORE }, |
405 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_20, HID_QUIRK_IGNORE }, | 410 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_20, HID_QUIRK_IGNORE }, |
diff --git a/include/linux/hid.h b/include/linux/hid.h index dca5804836f3..33ec33389b37 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -282,6 +282,7 @@ struct hid_item { | |||
282 | #define HID_QUIRK_LOGITECH_EXPANDED_KEYMAP 0x00800000 | 282 | #define HID_QUIRK_LOGITECH_EXPANDED_KEYMAP 0x00800000 |
283 | #define HID_QUIRK_IGNORE_HIDINPUT 0x01000000 | 283 | #define HID_QUIRK_IGNORE_HIDINPUT 0x01000000 |
284 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_B8 0x02000000 | 284 | #define HID_QUIRK_2WHEEL_MOUSE_HACK_B8 0x02000000 |
285 | #define HID_QUIRK_HWHEEL_WHEEL_INVERT 0x04000000 | ||
285 | 286 | ||
286 | /* | 287 | /* |
287 | * Separate quirks for runtime report descriptor fixup | 288 | * Separate quirks for runtime report descriptor fixup |