diff options
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-core.c | 1 | ||||
-rw-r--r-- | drivers/hid/hid-debug.c | 6 | ||||
-rw-r--r-- | drivers/hid/hid-ids.h | 1 | ||||
-rw-r--r-- | drivers/hid/hid-input.c | 24 | ||||
-rw-r--r-- | drivers/hid/hid-magicmouse.c | 7 | ||||
-rw-r--r-- | drivers/hid/hid-ntrig.c | 11 | ||||
-rw-r--r-- | drivers/hid/hid-tmff.c | 2 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-quirks.c | 1 |
8 files changed, 36 insertions, 17 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 368fbb0c4ca6..2e2aa759d230 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1357,6 +1357,7 @@ static const struct hid_device_id hid_blacklist[] = { | |||
1357 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb323) }, | 1357 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb323) }, |
1358 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb324) }, | 1358 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb324) }, |
1359 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb651) }, | 1359 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb651) }, |
1360 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb653) }, | ||
1360 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) }, | 1361 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) }, |
1361 | { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) }, | 1362 | { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) }, |
1362 | { HID_USB_DEVICE(USB_VENDOR_ID_TWINHAN, USB_DEVICE_ID_TWINHAN_IR_REMOTE) }, | 1363 | { HID_USB_DEVICE(USB_VENDOR_ID_TWINHAN, USB_DEVICE_ID_TWINHAN_IR_REMOTE) }, |
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index cd4ece6fdfb9..0c4e75573186 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c | |||
@@ -564,10 +564,10 @@ void hid_debug_event(struct hid_device *hdev, char *buf) | |||
564 | struct hid_debug_list *list; | 564 | struct hid_debug_list *list; |
565 | 565 | ||
566 | list_for_each_entry(list, &hdev->debug_list, node) { | 566 | list_for_each_entry(list, &hdev->debug_list, node) { |
567 | for (i = 0; i <= strlen(buf); i++) | 567 | for (i = 0; i < strlen(buf); i++) |
568 | list->hid_debug_buf[(list->tail + i) % (HID_DEBUG_BUFSIZE - 1)] = | 568 | list->hid_debug_buf[(list->tail + i) % HID_DEBUG_BUFSIZE] = |
569 | buf[i]; | 569 | buf[i]; |
570 | list->tail = (list->tail + i) % (HID_DEBUG_BUFSIZE - 1); | 570 | list->tail = (list->tail + i) % HID_DEBUG_BUFSIZE; |
571 | } | 571 | } |
572 | } | 572 | } |
573 | EXPORT_SYMBOL_GPL(hid_debug_event); | 573 | EXPORT_SYMBOL_GPL(hid_debug_event); |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 72c05f90553c..797e06470356 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -445,6 +445,7 @@ | |||
445 | 445 | ||
446 | #define USB_VENDOR_ID_UCLOGIC 0x5543 | 446 | #define USB_VENDOR_ID_UCLOGIC 0x5543 |
447 | #define USB_DEVICE_ID_UCLOGIC_TABLET_PF1209 0x0042 | 447 | #define USB_DEVICE_ID_UCLOGIC_TABLET_PF1209 0x0042 |
448 | #define USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U 0x0003 | ||
448 | 449 | ||
449 | #define USB_VENDOR_ID_VERNIER 0x08f7 | 450 | #define USB_VENDOR_ID_VERNIER 0x08f7 |
450 | #define USB_DEVICE_ID_VERNIER_LABPRO 0x0001 | 451 | #define USB_DEVICE_ID_VERNIER_LABPRO 0x0001 |
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 79d9edd0bdfa..7a0d2e4661a1 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -68,22 +68,25 @@ static const struct { | |||
68 | #define map_key_clear(c) hid_map_usage_clear(hidinput, usage, &bit, \ | 68 | #define map_key_clear(c) hid_map_usage_clear(hidinput, usage, &bit, \ |
69 | &max, EV_KEY, (c)) | 69 | &max, EV_KEY, (c)) |
70 | 70 | ||
71 | static inline int match_scancode(int code, int scancode) | 71 | static inline int match_scancode(unsigned int code, unsigned int scancode) |
72 | { | 72 | { |
73 | if (scancode == 0) | 73 | if (scancode == 0) |
74 | return 1; | 74 | return 1; |
75 | return ((code & (HID_USAGE_PAGE | HID_USAGE)) == scancode); | 75 | |
76 | return (code & (HID_USAGE_PAGE | HID_USAGE)) == scancode; | ||
76 | } | 77 | } |
77 | 78 | ||
78 | static inline int match_keycode(int code, int keycode) | 79 | static inline int match_keycode(unsigned int code, unsigned int keycode) |
79 | { | 80 | { |
80 | if (keycode == 0) | 81 | if (keycode == 0) |
81 | return 1; | 82 | return 1; |
82 | return (code == keycode); | 83 | |
84 | return code == keycode; | ||
83 | } | 85 | } |
84 | 86 | ||
85 | static struct hid_usage *hidinput_find_key(struct hid_device *hid, | 87 | static struct hid_usage *hidinput_find_key(struct hid_device *hid, |
86 | int scancode, int keycode) | 88 | unsigned int scancode, |
89 | unsigned int keycode) | ||
87 | { | 90 | { |
88 | int i, j, k; | 91 | int i, j, k; |
89 | struct hid_report *report; | 92 | struct hid_report *report; |
@@ -105,8 +108,8 @@ static struct hid_usage *hidinput_find_key(struct hid_device *hid, | |||
105 | return NULL; | 108 | return NULL; |
106 | } | 109 | } |
107 | 110 | ||
108 | static int hidinput_getkeycode(struct input_dev *dev, int scancode, | 111 | static int hidinput_getkeycode(struct input_dev *dev, |
109 | int *keycode) | 112 | unsigned int scancode, unsigned int *keycode) |
110 | { | 113 | { |
111 | struct hid_device *hid = input_get_drvdata(dev); | 114 | struct hid_device *hid = input_get_drvdata(dev); |
112 | struct hid_usage *usage; | 115 | struct hid_usage *usage; |
@@ -119,16 +122,13 @@ static int hidinput_getkeycode(struct input_dev *dev, int scancode, | |||
119 | return -EINVAL; | 122 | return -EINVAL; |
120 | } | 123 | } |
121 | 124 | ||
122 | static int hidinput_setkeycode(struct input_dev *dev, int scancode, | 125 | static int hidinput_setkeycode(struct input_dev *dev, |
123 | int keycode) | 126 | unsigned int scancode, unsigned int keycode) |
124 | { | 127 | { |
125 | struct hid_device *hid = input_get_drvdata(dev); | 128 | struct hid_device *hid = input_get_drvdata(dev); |
126 | struct hid_usage *usage; | 129 | struct hid_usage *usage; |
127 | int old_keycode; | 130 | int old_keycode; |
128 | 131 | ||
129 | if (keycode < 0 || keycode > KEY_MAX) | ||
130 | return -EINVAL; | ||
131 | |||
132 | usage = hidinput_find_key(hid, scancode, 0); | 132 | usage = hidinput_find_key(hid, scancode, 0); |
133 | if (usage) { | 133 | if (usage) { |
134 | old_keycode = usage->code; | 134 | old_keycode = usage->code; |
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index 4a3a94f2b10c..c174b64c3810 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c | |||
@@ -353,7 +353,7 @@ static int magicmouse_probe(struct hid_device *hdev, | |||
353 | goto err_free; | 353 | goto err_free; |
354 | } | 354 | } |
355 | 355 | ||
356 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); | 356 | ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_HIDINPUT); |
357 | if (ret) { | 357 | if (ret) { |
358 | dev_err(&hdev->dev, "magicmouse hw start failed\n"); | 358 | dev_err(&hdev->dev, "magicmouse hw start failed\n"); |
359 | goto err_free; | 359 | goto err_free; |
@@ -409,8 +409,11 @@ err_free: | |||
409 | 409 | ||
410 | static void magicmouse_remove(struct hid_device *hdev) | 410 | static void magicmouse_remove(struct hid_device *hdev) |
411 | { | 411 | { |
412 | struct magicmouse_sc *msc = hid_get_drvdata(hdev); | ||
413 | |||
412 | hid_hw_stop(hdev); | 414 | hid_hw_stop(hdev); |
413 | kfree(hid_get_drvdata(hdev)); | 415 | input_unregister_device(msc->input); |
416 | kfree(msc); | ||
414 | } | 417 | } |
415 | 418 | ||
416 | static const struct hid_device_id magic_mice[] = { | 419 | static const struct hid_device_id magic_mice[] = { |
diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c index 3234c729a895..edcc0c4247bb 100644 --- a/drivers/hid/hid-ntrig.c +++ b/drivers/hid/hid-ntrig.c | |||
@@ -140,6 +140,9 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, | |||
140 | nd->reading_mt = 1; | 140 | nd->reading_mt = 1; |
141 | nd->first_contact_confidence = 0; | 141 | nd->first_contact_confidence = 0; |
142 | break; | 142 | break; |
143 | case HID_DG_TIPSWITCH: | ||
144 | /* Prevent emission of touch until validated */ | ||
145 | return 1; | ||
143 | case HID_DG_CONFIDENCE: | 146 | case HID_DG_CONFIDENCE: |
144 | nd->confidence = value; | 147 | nd->confidence = value; |
145 | break; | 148 | break; |
@@ -259,6 +262,7 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, | |||
259 | BTN_TOOL_TRIPLETAP, 0); | 262 | BTN_TOOL_TRIPLETAP, 0); |
260 | input_report_key(input, | 263 | input_report_key(input, |
261 | BTN_TOOL_QUADTAP, 0); | 264 | BTN_TOOL_QUADTAP, 0); |
265 | input_report_key(input, BTN_TOUCH, 0); | ||
262 | } | 266 | } |
263 | break; | 267 | break; |
264 | 268 | ||
@@ -308,13 +312,20 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
308 | 312 | ||
309 | 313 | ||
310 | list_for_each_entry(hidinput, &hdev->inputs, list) { | 314 | list_for_each_entry(hidinput, &hdev->inputs, list) { |
315 | if (hidinput->report->maxfield < 1) | ||
316 | continue; | ||
317 | |||
311 | input = hidinput->input; | 318 | input = hidinput->input; |
312 | switch (hidinput->report->field[0]->application) { | 319 | switch (hidinput->report->field[0]->application) { |
313 | case HID_DG_PEN: | 320 | case HID_DG_PEN: |
314 | input->name = "N-Trig Pen"; | 321 | input->name = "N-Trig Pen"; |
315 | break; | 322 | break; |
316 | case HID_DG_TOUCHSCREEN: | 323 | case HID_DG_TOUCHSCREEN: |
324 | /* These keys are redundant for fingers, clear them | ||
325 | * to prevent incorrect identification */ | ||
317 | __clear_bit(BTN_TOOL_PEN, input->keybit); | 326 | __clear_bit(BTN_TOOL_PEN, input->keybit); |
327 | __clear_bit(BTN_TOOL_FINGER, input->keybit); | ||
328 | __clear_bit(BTN_0, input->keybit); | ||
318 | /* | 329 | /* |
319 | * A little something special to enable | 330 | * A little something special to enable |
320 | * two and three finger taps. | 331 | * two and three finger taps. |
diff --git a/drivers/hid/hid-tmff.c b/drivers/hid/hid-tmff.c index 167ea746fb9c..c32f32c84ac8 100644 --- a/drivers/hid/hid-tmff.c +++ b/drivers/hid/hid-tmff.c | |||
@@ -251,6 +251,8 @@ static const struct hid_device_id tm_devices[] = { | |||
251 | .driver_data = (unsigned long)ff_rumble }, | 251 | .driver_data = (unsigned long)ff_rumble }, |
252 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb651), /* FGT Rumble Force Wheel */ | 252 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb651), /* FGT Rumble Force Wheel */ |
253 | .driver_data = (unsigned long)ff_rumble }, | 253 | .driver_data = (unsigned long)ff_rumble }, |
254 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb653), /* RGT Force Feedback CLUTCH Raging Wheel */ | ||
255 | .driver_data = (unsigned long)ff_joystick }, | ||
254 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654), /* FGT Force Feedback Wheel */ | 256 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654), /* FGT Force Feedback Wheel */ |
255 | .driver_data = (unsigned long)ff_joystick }, | 257 | .driver_data = (unsigned long)ff_joystick }, |
256 | { } | 258 | { } |
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 7844280897d1..928943c7ce9a 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -63,6 +63,7 @@ static const struct hid_blacklist { | |||
63 | { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, | 63 | { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, |
64 | { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET }, | 64 | { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET }, |
65 | { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209, HID_QUIRK_MULTI_INPUT }, | 65 | { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209, HID_QUIRK_MULTI_INPUT }, |
66 | { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U, HID_QUIRK_MULTI_INPUT }, | ||
66 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, | 67 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, |
67 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, | 68 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, |
68 | 69 | ||