diff options
Diffstat (limited to 'drivers/hid/usbhid')
-rw-r--r-- | drivers/hid/usbhid/Kconfig | 75 | ||||
-rw-r--r-- | drivers/hid/usbhid/Makefile | 18 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-core.c | 463 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-ff.c | 95 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-lg2ff.c | 114 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-lgff.c | 151 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-pidff.c | 5 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-plff.c | 139 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-quirks.c | 934 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-tmff.c | 225 | ||||
-rw-r--r-- | drivers/hid/usbhid/hid-zpff.c | 107 | ||||
-rw-r--r-- | drivers/hid/usbhid/hiddev.c | 20 | ||||
-rw-r--r-- | drivers/hid/usbhid/usbhid.h | 4 | ||||
-rw-r--r-- | drivers/hid/usbhid/usbkbd.c | 12 | ||||
-rw-r--r-- | drivers/hid/usbhid/usbmouse.c | 8 |
15 files changed, 263 insertions, 2107 deletions
diff --git a/drivers/hid/usbhid/Kconfig b/drivers/hid/usbhid/Kconfig index 18f09104765c..5d9aa95fc3ef 100644 --- a/drivers/hid/usbhid/Kconfig +++ b/drivers/hid/usbhid/Kconfig | |||
@@ -24,88 +24,13 @@ config USB_HID | |||
24 | comment "Input core support is needed for USB HID input layer or HIDBP support" | 24 | comment "Input core support is needed for USB HID input layer or HIDBP support" |
25 | depends on USB_HID && INPUT=n | 25 | depends on USB_HID && INPUT=n |
26 | 26 | ||
27 | config USB_HIDINPUT_POWERBOOK | ||
28 | bool "Enable support for Apple laptop/aluminum USB special keys" | ||
29 | default n | ||
30 | depends on USB_HID | ||
31 | help | ||
32 | Say Y here if you want support for the special keys (Fn, Numlock) on | ||
33 | Apple iBooks, PowerBooks, MacBooks, MacBook Pros and aluminum USB | ||
34 | keyboards. | ||
35 | |||
36 | If unsure, say N. | ||
37 | |||
38 | config HID_FF | ||
39 | bool "Force feedback support (EXPERIMENTAL)" | ||
40 | depends on USB_HID && EXPERIMENTAL | ||
41 | help | ||
42 | Say Y here is you want force feedback support for a few HID devices. | ||
43 | See below for a list of supported devices. | ||
44 | |||
45 | See <file:Documentation/input/ff.txt> for a description of the force | ||
46 | feedback API. | ||
47 | |||
48 | If unsure, say N. | ||
49 | |||
50 | config HID_PID | 27 | config HID_PID |
51 | bool "PID device support" | 28 | bool "PID device support" |
52 | depends on HID_FF | ||
53 | help | 29 | help |
54 | Say Y here if you have a PID-compliant device and wish to enable force | 30 | Say Y here if you have a PID-compliant device and wish to enable force |
55 | feedback for it. Microsoft Sidewinder Force Feedback 2 is one of such | 31 | feedback for it. Microsoft Sidewinder Force Feedback 2 is one of such |
56 | devices. | 32 | devices. |
57 | 33 | ||
58 | config LOGITECH_FF | ||
59 | bool "Logitech devices support" | ||
60 | depends on HID_FF | ||
61 | select INPUT_FF_MEMLESS if USB_HID | ||
62 | help | ||
63 | Say Y here if you have one of these devices: | ||
64 | - Logitech WingMan Cordless RumblePad | ||
65 | - Logitech WingMan Cordless RumblePad 2 | ||
66 | - Logitech WingMan Force 3D | ||
67 | - Logitech Formula Force EX | ||
68 | - Logitech MOMO Force wheel | ||
69 | |||
70 | and if you want to enable force feedback for them. | ||
71 | Note: if you say N here, this device will still be supported, but without | ||
72 | force feedback. | ||
73 | |||
74 | config LOGIRUMBLEPAD2_FF | ||
75 | bool "Logitech Rumblepad 2 support" | ||
76 | depends on HID_FF | ||
77 | select INPUT_FF_MEMLESS if USB_HID | ||
78 | help | ||
79 | Say Y here if you want to enable force feedback support for Logitech | ||
80 | Rumblepad 2 devices. | ||
81 | |||
82 | config PANTHERLORD_FF | ||
83 | bool "PantherLord/GreenAsia based device support" | ||
84 | depends on HID_FF | ||
85 | select INPUT_FF_MEMLESS if USB_HID | ||
86 | help | ||
87 | Say Y here if you have a PantherLord/GreenAsia based game controller | ||
88 | or adapter and want to enable force feedback support for it. | ||
89 | |||
90 | config THRUSTMASTER_FF | ||
91 | bool "ThrustMaster devices support" | ||
92 | depends on HID_FF | ||
93 | select INPUT_FF_MEMLESS if USB_HID | ||
94 | help | ||
95 | Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or | ||
96 | a THRUSTMASTER Ferrari GT Rumble Force or Force Feedback Wheel, | ||
97 | and want to enable force feedback support for it. | ||
98 | Note: if you say N here, this device will still be supported, but without | ||
99 | force feedback. | ||
100 | |||
101 | config ZEROPLUS_FF | ||
102 | bool "Zeroplus based game controller support" | ||
103 | depends on HID_FF | ||
104 | select INPUT_FF_MEMLESS if USB_HID | ||
105 | help | ||
106 | Say Y here if you have a Zeroplus based game controller and want to | ||
107 | enable force feedback for it. | ||
108 | |||
109 | config USB_HIDDEV | 34 | config USB_HIDDEV |
110 | bool "/dev/hiddev raw HID device support" | 35 | bool "/dev/hiddev raw HID device support" |
111 | depends on USB_HID | 36 | depends on USB_HID |
diff --git a/drivers/hid/usbhid/Makefile b/drivers/hid/usbhid/Makefile index 00a7b7090192..1329ecb37a1c 100644 --- a/drivers/hid/usbhid/Makefile +++ b/drivers/hid/usbhid/Makefile | |||
@@ -13,24 +13,6 @@ endif | |||
13 | ifeq ($(CONFIG_HID_PID),y) | 13 | ifeq ($(CONFIG_HID_PID),y) |
14 | usbhid-objs += hid-pidff.o | 14 | usbhid-objs += hid-pidff.o |
15 | endif | 15 | endif |
16 | ifeq ($(CONFIG_LOGITECH_FF),y) | ||
17 | usbhid-objs += hid-lgff.o | ||
18 | endif | ||
19 | ifeq ($(CONFIG_LOGIRUMBLEPAD2_FF),y) | ||
20 | usbhid-objs += hid-lg2ff.o | ||
21 | endif | ||
22 | ifeq ($(CONFIG_PANTHERLORD_FF),y) | ||
23 | usbhid-objs += hid-plff.o | ||
24 | endif | ||
25 | ifeq ($(CONFIG_THRUSTMASTER_FF),y) | ||
26 | usbhid-objs += hid-tmff.o | ||
27 | endif | ||
28 | ifeq ($(CONFIG_ZEROPLUS_FF),y) | ||
29 | usbhid-objs += hid-zpff.o | ||
30 | endif | ||
31 | ifeq ($(CONFIG_HID_FF),y) | ||
32 | usbhid-objs += hid-ff.o | ||
33 | endif | ||
34 | 16 | ||
35 | obj-$(CONFIG_USB_HID) += usbhid.o | 17 | obj-$(CONFIG_USB_HID) += usbhid.o |
36 | obj-$(CONFIG_USB_KBD) += usbkbd.o | 18 | obj-$(CONFIG_USB_KBD) += usbkbd.o |
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 27fe4d8912cb..1d3b8a394d46 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c | |||
@@ -44,8 +44,6 @@ | |||
44 | #define DRIVER_DESC "USB HID core driver" | 44 | #define DRIVER_DESC "USB HID core driver" |
45 | #define DRIVER_LICENSE "GPL" | 45 | #define DRIVER_LICENSE "GPL" |
46 | 46 | ||
47 | static char *hid_types[] = {"Device", "Pointer", "Mouse", "Device", "Joystick", | ||
48 | "Gamepad", "Keyboard", "Keypad", "Multi-Axis Controller"}; | ||
49 | /* | 47 | /* |
50 | * Module parameters. | 48 | * Module parameters. |
51 | */ | 49 | */ |
@@ -61,12 +59,6 @@ MODULE_PARM_DESC(quirks, "Add/modify USB HID quirks by specifying " | |||
61 | " quirks=vendorID:productID:quirks" | 59 | " quirks=vendorID:productID:quirks" |
62 | " where vendorID, productID, and quirks are all in" | 60 | " where vendorID, productID, and quirks are all in" |
63 | " 0x-prefixed hex"); | 61 | " 0x-prefixed hex"); |
64 | static char *rdesc_quirks_param[MAX_USBHID_BOOT_QUIRKS] = { [ 0 ... (MAX_USBHID_BOOT_QUIRKS - 1) ] = NULL }; | ||
65 | module_param_array_named(rdesc_quirks, rdesc_quirks_param, charp, NULL, 0444); | ||
66 | MODULE_PARM_DESC(rdesc_quirks, "Add/modify report descriptor quirks by specifying " | ||
67 | " rdesc_quirks=vendorID:productID:rdesc_quirks" | ||
68 | " where vendorID, productID, and rdesc_quirks are all in" | ||
69 | " 0x-prefixed hex"); | ||
70 | /* | 62 | /* |
71 | * Input submission and I/O error handler. | 63 | * Input submission and I/O error handler. |
72 | */ | 64 | */ |
@@ -197,31 +189,32 @@ static void hid_irq_in(struct urb *urb) | |||
197 | int status; | 189 | int status; |
198 | 190 | ||
199 | switch (urb->status) { | 191 | switch (urb->status) { |
200 | case 0: /* success */ | 192 | case 0: /* success */ |
201 | usbhid->retry_delay = 0; | 193 | usbhid->retry_delay = 0; |
202 | hid_input_report(urb->context, HID_INPUT_REPORT, | 194 | hid_input_report(urb->context, HID_INPUT_REPORT, |
203 | urb->transfer_buffer, | 195 | urb->transfer_buffer, |
204 | urb->actual_length, 1); | 196 | urb->actual_length, 1); |
205 | break; | 197 | break; |
206 | case -EPIPE: /* stall */ | 198 | case -EPIPE: /* stall */ |
207 | clear_bit(HID_IN_RUNNING, &usbhid->iofl); | 199 | clear_bit(HID_IN_RUNNING, &usbhid->iofl); |
208 | set_bit(HID_CLEAR_HALT, &usbhid->iofl); | 200 | set_bit(HID_CLEAR_HALT, &usbhid->iofl); |
209 | schedule_work(&usbhid->reset_work); | 201 | schedule_work(&usbhid->reset_work); |
210 | return; | 202 | return; |
211 | case -ECONNRESET: /* unlink */ | 203 | case -ECONNRESET: /* unlink */ |
212 | case -ENOENT: | 204 | case -ENOENT: |
213 | case -ESHUTDOWN: /* unplug */ | 205 | case -ESHUTDOWN: /* unplug */ |
214 | clear_bit(HID_IN_RUNNING, &usbhid->iofl); | 206 | clear_bit(HID_IN_RUNNING, &usbhid->iofl); |
215 | return; | 207 | return; |
216 | case -EILSEQ: /* protocol error or unplug */ | 208 | case -EILSEQ: /* protocol error or unplug */ |
217 | case -EPROTO: /* protocol error or unplug */ | 209 | case -EPROTO: /* protocol error or unplug */ |
218 | case -ETIME: /* protocol error or unplug */ | 210 | case -ETIME: /* protocol error or unplug */ |
219 | case -ETIMEDOUT: /* Should never happen, but... */ | 211 | case -ETIMEDOUT: /* Should never happen, but... */ |
220 | clear_bit(HID_IN_RUNNING, &usbhid->iofl); | 212 | clear_bit(HID_IN_RUNNING, &usbhid->iofl); |
221 | hid_io_error(hid); | 213 | hid_io_error(hid); |
222 | return; | 214 | return; |
223 | default: /* error */ | 215 | default: /* error */ |
224 | warn("input irq status %d received", urb->status); | 216 | dev_warn(&urb->dev->dev, "input irq status %d " |
217 | "received\n", urb->status); | ||
225 | } | 218 | } |
226 | 219 | ||
227 | status = usb_submit_urb(urb, GFP_ATOMIC); | 220 | status = usb_submit_urb(urb, GFP_ATOMIC); |
@@ -240,13 +233,16 @@ static void hid_irq_in(struct urb *urb) | |||
240 | static int hid_submit_out(struct hid_device *hid) | 233 | static int hid_submit_out(struct hid_device *hid) |
241 | { | 234 | { |
242 | struct hid_report *report; | 235 | struct hid_report *report; |
236 | char *raw_report; | ||
243 | struct usbhid_device *usbhid = hid->driver_data; | 237 | struct usbhid_device *usbhid = hid->driver_data; |
244 | 238 | ||
245 | report = usbhid->out[usbhid->outtail]; | 239 | report = usbhid->out[usbhid->outtail].report; |
240 | raw_report = usbhid->out[usbhid->outtail].raw_report; | ||
246 | 241 | ||
247 | hid_output_report(report, usbhid->outbuf); | ||
248 | usbhid->urbout->transfer_buffer_length = ((report->size - 1) >> 3) + 1 + (report->id > 0); | 242 | usbhid->urbout->transfer_buffer_length = ((report->size - 1) >> 3) + 1 + (report->id > 0); |
249 | usbhid->urbout->dev = hid_to_usb_dev(hid); | 243 | usbhid->urbout->dev = hid_to_usb_dev(hid); |
244 | memcpy(usbhid->outbuf, raw_report, usbhid->urbout->transfer_buffer_length); | ||
245 | kfree(raw_report); | ||
250 | 246 | ||
251 | dbg_hid("submitting out urb\n"); | 247 | dbg_hid("submitting out urb\n"); |
252 | 248 | ||
@@ -262,17 +258,20 @@ static int hid_submit_ctrl(struct hid_device *hid) | |||
262 | { | 258 | { |
263 | struct hid_report *report; | 259 | struct hid_report *report; |
264 | unsigned char dir; | 260 | unsigned char dir; |
261 | char *raw_report; | ||
265 | int len; | 262 | int len; |
266 | struct usbhid_device *usbhid = hid->driver_data; | 263 | struct usbhid_device *usbhid = hid->driver_data; |
267 | 264 | ||
268 | report = usbhid->ctrl[usbhid->ctrltail].report; | 265 | report = usbhid->ctrl[usbhid->ctrltail].report; |
266 | raw_report = usbhid->ctrl[usbhid->ctrltail].raw_report; | ||
269 | dir = usbhid->ctrl[usbhid->ctrltail].dir; | 267 | dir = usbhid->ctrl[usbhid->ctrltail].dir; |
270 | 268 | ||
271 | len = ((report->size - 1) >> 3) + 1 + (report->id > 0); | 269 | len = ((report->size - 1) >> 3) + 1 + (report->id > 0); |
272 | if (dir == USB_DIR_OUT) { | 270 | if (dir == USB_DIR_OUT) { |
273 | hid_output_report(report, usbhid->ctrlbuf); | ||
274 | usbhid->urbctrl->pipe = usb_sndctrlpipe(hid_to_usb_dev(hid), 0); | 271 | usbhid->urbctrl->pipe = usb_sndctrlpipe(hid_to_usb_dev(hid), 0); |
275 | usbhid->urbctrl->transfer_buffer_length = len; | 272 | usbhid->urbctrl->transfer_buffer_length = len; |
273 | memcpy(usbhid->ctrlbuf, raw_report, len); | ||
274 | kfree(raw_report); | ||
276 | } else { | 275 | } else { |
277 | int maxpacket, padlen; | 276 | int maxpacket, padlen; |
278 | 277 | ||
@@ -319,17 +318,18 @@ static void hid_irq_out(struct urb *urb) | |||
319 | int unplug = 0; | 318 | int unplug = 0; |
320 | 319 | ||
321 | switch (urb->status) { | 320 | switch (urb->status) { |
322 | case 0: /* success */ | 321 | case 0: /* success */ |
323 | break; | 322 | break; |
324 | case -ESHUTDOWN: /* unplug */ | 323 | case -ESHUTDOWN: /* unplug */ |
325 | unplug = 1; | 324 | unplug = 1; |
326 | case -EILSEQ: /* protocol error or unplug */ | 325 | case -EILSEQ: /* protocol error or unplug */ |
327 | case -EPROTO: /* protocol error or unplug */ | 326 | case -EPROTO: /* protocol error or unplug */ |
328 | case -ECONNRESET: /* unlink */ | 327 | case -ECONNRESET: /* unlink */ |
329 | case -ENOENT: | 328 | case -ENOENT: |
330 | break; | 329 | break; |
331 | default: /* error */ | 330 | default: /* error */ |
332 | warn("output irq status %d received", urb->status); | 331 | dev_warn(&urb->dev->dev, "output irq status %d " |
332 | "received\n", urb->status); | ||
333 | } | 333 | } |
334 | 334 | ||
335 | spin_lock_irqsave(&usbhid->outlock, flags); | 335 | spin_lock_irqsave(&usbhid->outlock, flags); |
@@ -367,21 +367,23 @@ static void hid_ctrl(struct urb *urb) | |||
367 | spin_lock_irqsave(&usbhid->ctrllock, flags); | 367 | spin_lock_irqsave(&usbhid->ctrllock, flags); |
368 | 368 | ||
369 | switch (urb->status) { | 369 | switch (urb->status) { |
370 | case 0: /* success */ | 370 | case 0: /* success */ |
371 | if (usbhid->ctrl[usbhid->ctrltail].dir == USB_DIR_IN) | 371 | if (usbhid->ctrl[usbhid->ctrltail].dir == USB_DIR_IN) |
372 | hid_input_report(urb->context, usbhid->ctrl[usbhid->ctrltail].report->type, | 372 | hid_input_report(urb->context, |
373 | urb->transfer_buffer, urb->actual_length, 0); | 373 | usbhid->ctrl[usbhid->ctrltail].report->type, |
374 | break; | 374 | urb->transfer_buffer, urb->actual_length, 0); |
375 | case -ESHUTDOWN: /* unplug */ | 375 | break; |
376 | unplug = 1; | 376 | case -ESHUTDOWN: /* unplug */ |
377 | case -EILSEQ: /* protocol error or unplug */ | 377 | unplug = 1; |
378 | case -EPROTO: /* protocol error or unplug */ | 378 | case -EILSEQ: /* protocol error or unplug */ |
379 | case -ECONNRESET: /* unlink */ | 379 | case -EPROTO: /* protocol error or unplug */ |
380 | case -ENOENT: | 380 | case -ECONNRESET: /* unlink */ |
381 | case -EPIPE: /* report not available */ | 381 | case -ENOENT: |
382 | break; | 382 | case -EPIPE: /* report not available */ |
383 | default: /* error */ | 383 | break; |
384 | warn("ctrl urb status %d received", urb->status); | 384 | default: /* error */ |
385 | dev_warn(&urb->dev->dev, "ctrl urb status %d " | ||
386 | "received\n", urb->status); | ||
385 | } | 387 | } |
386 | 388 | ||
387 | if (unplug) | 389 | if (unplug) |
@@ -408,6 +410,7 @@ void usbhid_submit_report(struct hid_device *hid, struct hid_report *report, uns | |||
408 | int head; | 410 | int head; |
409 | unsigned long flags; | 411 | unsigned long flags; |
410 | struct usbhid_device *usbhid = hid->driver_data; | 412 | struct usbhid_device *usbhid = hid->driver_data; |
413 | int len = ((report->size - 1) >> 3) + 1 + (report->id > 0); | ||
411 | 414 | ||
412 | if ((hid->quirks & HID_QUIRK_NOGET) && dir == USB_DIR_IN) | 415 | if ((hid->quirks & HID_QUIRK_NOGET) && dir == USB_DIR_IN) |
413 | return; | 416 | return; |
@@ -418,11 +421,18 @@ void usbhid_submit_report(struct hid_device *hid, struct hid_report *report, uns | |||
418 | 421 | ||
419 | if ((head = (usbhid->outhead + 1) & (HID_OUTPUT_FIFO_SIZE - 1)) == usbhid->outtail) { | 422 | if ((head = (usbhid->outhead + 1) & (HID_OUTPUT_FIFO_SIZE - 1)) == usbhid->outtail) { |
420 | spin_unlock_irqrestore(&usbhid->outlock, flags); | 423 | spin_unlock_irqrestore(&usbhid->outlock, flags); |
421 | warn("output queue full"); | 424 | dev_warn(&hid->dev, "output queue full\n"); |
422 | return; | 425 | return; |
423 | } | 426 | } |
424 | 427 | ||
425 | usbhid->out[usbhid->outhead] = report; | 428 | usbhid->out[usbhid->outhead].raw_report = kmalloc(len, GFP_ATOMIC); |
429 | if (!usbhid->out[usbhid->outhead].raw_report) { | ||
430 | spin_unlock_irqrestore(&usbhid->outlock, flags); | ||
431 | warn("output queueing failed"); | ||
432 | return; | ||
433 | } | ||
434 | hid_output_report(report, usbhid->out[usbhid->outhead].raw_report); | ||
435 | usbhid->out[usbhid->outhead].report = report; | ||
426 | usbhid->outhead = head; | 436 | usbhid->outhead = head; |
427 | 437 | ||
428 | if (!test_and_set_bit(HID_OUT_RUNNING, &usbhid->iofl)) | 438 | if (!test_and_set_bit(HID_OUT_RUNNING, &usbhid->iofl)) |
@@ -437,10 +447,19 @@ void usbhid_submit_report(struct hid_device *hid, struct hid_report *report, uns | |||
437 | 447 | ||
438 | if ((head = (usbhid->ctrlhead + 1) & (HID_CONTROL_FIFO_SIZE - 1)) == usbhid->ctrltail) { | 448 | if ((head = (usbhid->ctrlhead + 1) & (HID_CONTROL_FIFO_SIZE - 1)) == usbhid->ctrltail) { |
439 | spin_unlock_irqrestore(&usbhid->ctrllock, flags); | 449 | spin_unlock_irqrestore(&usbhid->ctrllock, flags); |
440 | warn("control queue full"); | 450 | dev_warn(&hid->dev, "control queue full\n"); |
441 | return; | 451 | return; |
442 | } | 452 | } |
443 | 453 | ||
454 | if (dir == USB_DIR_OUT) { | ||
455 | usbhid->ctrl[usbhid->ctrlhead].raw_report = kmalloc(len, GFP_ATOMIC); | ||
456 | if (!usbhid->ctrl[usbhid->ctrlhead].raw_report) { | ||
457 | spin_unlock_irqrestore(&usbhid->ctrllock, flags); | ||
458 | warn("control queueing failed"); | ||
459 | return; | ||
460 | } | ||
461 | hid_output_report(report, usbhid->ctrl[usbhid->ctrlhead].raw_report); | ||
462 | } | ||
444 | usbhid->ctrl[usbhid->ctrlhead].report = report; | 463 | usbhid->ctrl[usbhid->ctrlhead].report = report; |
445 | usbhid->ctrl[usbhid->ctrlhead].dir = dir; | 464 | usbhid->ctrl[usbhid->ctrlhead].dir = dir; |
446 | usbhid->ctrlhead = head; | 465 | usbhid->ctrlhead = head; |
@@ -451,6 +470,7 @@ void usbhid_submit_report(struct hid_device *hid, struct hid_report *report, uns | |||
451 | 470 | ||
452 | spin_unlock_irqrestore(&usbhid->ctrllock, flags); | 471 | spin_unlock_irqrestore(&usbhid->ctrllock, flags); |
453 | } | 472 | } |
473 | EXPORT_SYMBOL_GPL(usbhid_submit_report); | ||
454 | 474 | ||
455 | static int usb_hidinput_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) | 475 | static int usb_hidinput_input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) |
456 | { | 476 | { |
@@ -465,7 +485,7 @@ static int usb_hidinput_input_event(struct input_dev *dev, unsigned int type, un | |||
465 | return -1; | 485 | return -1; |
466 | 486 | ||
467 | if ((offset = hidinput_find_field(hid, type, code, &field)) == -1) { | 487 | if ((offset = hidinput_find_field(hid, type, code, &field)) == -1) { |
468 | warn("event field not found"); | 488 | dev_warn(&dev->dev, "event field not found\n"); |
469 | return -1; | 489 | return -1; |
470 | } | 490 | } |
471 | 491 | ||
@@ -568,7 +588,7 @@ void usbhid_init_reports(struct hid_device *hid) | |||
568 | } | 588 | } |
569 | 589 | ||
570 | if (err) | 590 | if (err) |
571 | warn("timeout initializing reports"); | 591 | dev_warn(&hid->dev, "timeout initializing reports\n"); |
572 | } | 592 | } |
573 | 593 | ||
574 | /* | 594 | /* |
@@ -598,7 +618,7 @@ static int hid_find_field_early(struct hid_device *hid, unsigned int page, | |||
598 | return -1; | 618 | return -1; |
599 | } | 619 | } |
600 | 620 | ||
601 | static void usbhid_set_leds(struct hid_device *hid) | 621 | void usbhid_set_leds(struct hid_device *hid) |
602 | { | 622 | { |
603 | struct hid_field *field; | 623 | struct hid_field *field; |
604 | int offset; | 624 | int offset; |
@@ -608,6 +628,7 @@ static void usbhid_set_leds(struct hid_device *hid) | |||
608 | usbhid_submit_report(hid, field->report, USB_DIR_OUT); | 628 | usbhid_submit_report(hid, field->report, USB_DIR_OUT); |
609 | } | 629 | } |
610 | } | 630 | } |
631 | EXPORT_SYMBOL_GPL(usbhid_set_leds); | ||
611 | 632 | ||
612 | /* | 633 | /* |
613 | * Traverse the supplied list of reports and find the longest | 634 | * Traverse the supplied list of reports and find the longest |
@@ -675,43 +696,16 @@ static void hid_free_buffers(struct usb_device *dev, struct hid_device *hid) | |||
675 | usb_buffer_free(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma); | 696 | usb_buffer_free(dev, usbhid->bufsize, usbhid->ctrlbuf, usbhid->ctrlbuf_dma); |
676 | } | 697 | } |
677 | 698 | ||
678 | /* | 699 | static int usbhid_parse(struct hid_device *hid) |
679 | * Sending HID_REQ_GET_REPORT changes the operation mode of the ps3 controller | ||
680 | * to "operational". Without this, the ps3 controller will not report any | ||
681 | * events. | ||
682 | */ | ||
683 | static void hid_fixup_sony_ps3_controller(struct usb_device *dev, int ifnum) | ||
684 | { | ||
685 | int result; | ||
686 | char *buf = kmalloc(18, GFP_KERNEL); | ||
687 | |||
688 | if (!buf) | ||
689 | return; | ||
690 | |||
691 | result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), | ||
692 | HID_REQ_GET_REPORT, | ||
693 | USB_DIR_IN | USB_TYPE_CLASS | | ||
694 | USB_RECIP_INTERFACE, | ||
695 | (3 << 8) | 0xf2, ifnum, buf, 17, | ||
696 | USB_CTRL_GET_TIMEOUT); | ||
697 | |||
698 | if (result < 0) | ||
699 | err_hid("%s failed: %d\n", __func__, result); | ||
700 | |||
701 | kfree(buf); | ||
702 | } | ||
703 | |||
704 | static struct hid_device *usb_hid_configure(struct usb_interface *intf) | ||
705 | { | 700 | { |
701 | struct usb_interface *intf = to_usb_interface(hid->dev.parent); | ||
706 | struct usb_host_interface *interface = intf->cur_altsetting; | 702 | struct usb_host_interface *interface = intf->cur_altsetting; |
707 | struct usb_device *dev = interface_to_usbdev (intf); | 703 | struct usb_device *dev = interface_to_usbdev (intf); |
708 | struct hid_descriptor *hdesc; | 704 | struct hid_descriptor *hdesc; |
709 | struct hid_device *hid; | ||
710 | u32 quirks = 0; | 705 | u32 quirks = 0; |
711 | unsigned int insize = 0, rsize = 0; | 706 | unsigned int rsize = 0; |
712 | char *rdesc; | 707 | char *rdesc; |
713 | int n, len; | 708 | int ret, n; |
714 | struct usbhid_device *usbhid; | ||
715 | 709 | ||
716 | quirks = usbhid_lookup_quirk(le16_to_cpu(dev->descriptor.idVendor), | 710 | quirks = usbhid_lookup_quirk(le16_to_cpu(dev->descriptor.idVendor), |
717 | le16_to_cpu(dev->descriptor.idProduct)); | 711 | le16_to_cpu(dev->descriptor.idProduct)); |
@@ -724,63 +718,75 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
724 | quirks |= HID_QUIRK_NOGET; | 718 | quirks |= HID_QUIRK_NOGET; |
725 | } | 719 | } |
726 | 720 | ||
727 | if (quirks & HID_QUIRK_IGNORE) | ||
728 | return NULL; | ||
729 | |||
730 | if ((quirks & HID_QUIRK_IGNORE_MOUSE) && | ||
731 | (interface->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE)) | ||
732 | return NULL; | ||
733 | |||
734 | |||
735 | if (usb_get_extra_descriptor(interface, HID_DT_HID, &hdesc) && | 721 | if (usb_get_extra_descriptor(interface, HID_DT_HID, &hdesc) && |
736 | (!interface->desc.bNumEndpoints || | 722 | (!interface->desc.bNumEndpoints || |
737 | usb_get_extra_descriptor(&interface->endpoint[0], HID_DT_HID, &hdesc))) { | 723 | usb_get_extra_descriptor(&interface->endpoint[0], HID_DT_HID, &hdesc))) { |
738 | dbg_hid("class descriptor not present\n"); | 724 | dbg_hid("class descriptor not present\n"); |
739 | return NULL; | 725 | return -ENODEV; |
740 | } | 726 | } |
741 | 727 | ||
728 | hid->version = le16_to_cpu(hdesc->bcdHID); | ||
729 | hid->country = hdesc->bCountryCode; | ||
730 | |||
742 | for (n = 0; n < hdesc->bNumDescriptors; n++) | 731 | for (n = 0; n < hdesc->bNumDescriptors; n++) |
743 | if (hdesc->desc[n].bDescriptorType == HID_DT_REPORT) | 732 | if (hdesc->desc[n].bDescriptorType == HID_DT_REPORT) |
744 | rsize = le16_to_cpu(hdesc->desc[n].wDescriptorLength); | 733 | rsize = le16_to_cpu(hdesc->desc[n].wDescriptorLength); |
745 | 734 | ||
746 | if (!rsize || rsize > HID_MAX_DESCRIPTOR_SIZE) { | 735 | if (!rsize || rsize > HID_MAX_DESCRIPTOR_SIZE) { |
747 | dbg_hid("weird size of report descriptor (%u)\n", rsize); | 736 | dbg_hid("weird size of report descriptor (%u)\n", rsize); |
748 | return NULL; | 737 | return -EINVAL; |
749 | } | 738 | } |
750 | 739 | ||
751 | if (!(rdesc = kmalloc(rsize, GFP_KERNEL))) { | 740 | if (!(rdesc = kmalloc(rsize, GFP_KERNEL))) { |
752 | dbg_hid("couldn't allocate rdesc memory\n"); | 741 | dbg_hid("couldn't allocate rdesc memory\n"); |
753 | return NULL; | 742 | return -ENOMEM; |
754 | } | 743 | } |
755 | 744 | ||
756 | hid_set_idle(dev, interface->desc.bInterfaceNumber, 0, 0); | 745 | hid_set_idle(dev, interface->desc.bInterfaceNumber, 0, 0); |
757 | 746 | ||
758 | if ((n = hid_get_class_descriptor(dev, interface->desc.bInterfaceNumber, HID_DT_REPORT, rdesc, rsize)) < 0) { | 747 | ret = hid_get_class_descriptor(dev, interface->desc.bInterfaceNumber, |
748 | HID_DT_REPORT, rdesc, rsize); | ||
749 | if (ret < 0) { | ||
759 | dbg_hid("reading report descriptor failed\n"); | 750 | dbg_hid("reading report descriptor failed\n"); |
760 | kfree(rdesc); | 751 | kfree(rdesc); |
761 | return NULL; | 752 | goto err; |
762 | } | 753 | } |
763 | 754 | ||
764 | usbhid_fixup_report_descriptor(le16_to_cpu(dev->descriptor.idVendor), | ||
765 | le16_to_cpu(dev->descriptor.idProduct), rdesc, | ||
766 | rsize, rdesc_quirks_param); | ||
767 | |||
768 | dbg_hid("report descriptor (size %u, read %d) = ", rsize, n); | 755 | dbg_hid("report descriptor (size %u, read %d) = ", rsize, n); |
769 | for (n = 0; n < rsize; n++) | 756 | for (n = 0; n < rsize; n++) |
770 | dbg_hid_line(" %02x", (unsigned char) rdesc[n]); | 757 | dbg_hid_line(" %02x", (unsigned char) rdesc[n]); |
771 | dbg_hid_line("\n"); | 758 | dbg_hid_line("\n"); |
772 | 759 | ||
773 | if (!(hid = hid_parse_report(rdesc, n))) { | 760 | ret = hid_parse_report(hid, rdesc, rsize); |
761 | kfree(rdesc); | ||
762 | if (ret) { | ||
774 | dbg_hid("parsing report descriptor failed\n"); | 763 | dbg_hid("parsing report descriptor failed\n"); |
775 | kfree(rdesc); | 764 | goto err; |
776 | return NULL; | ||
777 | } | 765 | } |
778 | 766 | ||
779 | kfree(rdesc); | ||
780 | hid->quirks = quirks; | 767 | hid->quirks = quirks; |
781 | 768 | ||
782 | if (!(usbhid = kzalloc(sizeof(struct usbhid_device), GFP_KERNEL))) | 769 | return 0; |
783 | goto fail_no_usbhid; | 770 | err: |
771 | return ret; | ||
772 | } | ||
773 | |||
774 | static int usbhid_start(struct hid_device *hid) | ||
775 | { | ||
776 | struct usb_interface *intf = to_usb_interface(hid->dev.parent); | ||
777 | struct usb_host_interface *interface = intf->cur_altsetting; | ||
778 | struct usb_device *dev = interface_to_usbdev(intf); | ||
779 | struct usbhid_device *usbhid; | ||
780 | unsigned int n, insize = 0; | ||
781 | int ret; | ||
782 | |||
783 | WARN_ON(hid->driver_data); | ||
784 | |||
785 | usbhid = kzalloc(sizeof(struct usbhid_device), GFP_KERNEL); | ||
786 | if (usbhid == NULL) { | ||
787 | ret = -ENOMEM; | ||
788 | goto err; | ||
789 | } | ||
784 | 790 | ||
785 | hid->driver_data = usbhid; | 791 | hid->driver_data = usbhid; |
786 | usbhid->hid = hid; | 792 | usbhid->hid = hid; |
@@ -799,28 +805,11 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
799 | insize = HID_MAX_BUFFER_SIZE; | 805 | insize = HID_MAX_BUFFER_SIZE; |
800 | 806 | ||
801 | if (hid_alloc_buffers(dev, hid)) { | 807 | if (hid_alloc_buffers(dev, hid)) { |
802 | hid_free_buffers(dev, hid); | 808 | ret = -ENOMEM; |
803 | goto fail; | 809 | goto fail; |
804 | } | 810 | } |
805 | 811 | ||
806 | hid->name[0] = 0; | ||
807 | |||
808 | if (dev->manufacturer) | ||
809 | strlcpy(hid->name, dev->manufacturer, sizeof(hid->name)); | ||
810 | |||
811 | if (dev->product) { | ||
812 | if (dev->manufacturer) | ||
813 | strlcat(hid->name, " ", sizeof(hid->name)); | ||
814 | strlcat(hid->name, dev->product, sizeof(hid->name)); | ||
815 | } | ||
816 | |||
817 | if (!strlen(hid->name)) | ||
818 | snprintf(hid->name, sizeof(hid->name), "HID %04x:%04x", | ||
819 | le16_to_cpu(dev->descriptor.idVendor), | ||
820 | le16_to_cpu(dev->descriptor.idProduct)); | ||
821 | |||
822 | for (n = 0; n < interface->desc.bNumEndpoints; n++) { | 812 | for (n = 0; n < interface->desc.bNumEndpoints; n++) { |
823 | |||
824 | struct usb_endpoint_descriptor *endpoint; | 813 | struct usb_endpoint_descriptor *endpoint; |
825 | int pipe; | 814 | int pipe; |
826 | int interval; | 815 | int interval; |
@@ -832,7 +821,7 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
832 | interval = endpoint->bInterval; | 821 | interval = endpoint->bInterval; |
833 | 822 | ||
834 | /* Some vendors give fullspeed interval on highspeed devides */ | 823 | /* Some vendors give fullspeed interval on highspeed devides */ |
835 | if (quirks & HID_QUIRK_FULLSPEED_INTERVAL && | 824 | if (hid->quirks & HID_QUIRK_FULLSPEED_INTERVAL && |
836 | dev->speed == USB_SPEED_HIGH) { | 825 | dev->speed == USB_SPEED_HIGH) { |
837 | interval = fls(endpoint->bInterval*8); | 826 | interval = fls(endpoint->bInterval*8); |
838 | printk(KERN_INFO "%s: Fixing fullspeed to highspeed interval: %d -> %d\n", | 827 | printk(KERN_INFO "%s: Fixing fullspeed to highspeed interval: %d -> %d\n", |
@@ -843,6 +832,7 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
843 | if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0) | 832 | if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0) |
844 | interval = hid_mousepoll_interval; | 833 | interval = hid_mousepoll_interval; |
845 | 834 | ||
835 | ret = -ENOMEM; | ||
846 | if (usb_endpoint_dir_in(endpoint)) { | 836 | if (usb_endpoint_dir_in(endpoint)) { |
847 | if (usbhid->urbin) | 837 | if (usbhid->urbin) |
848 | continue; | 838 | continue; |
@@ -868,6 +858,7 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
868 | 858 | ||
869 | if (!usbhid->urbin) { | 859 | if (!usbhid->urbin) { |
870 | err_hid("couldn't find an input interrupt endpoint"); | 860 | err_hid("couldn't find an input interrupt endpoint"); |
861 | ret = -ENODEV; | ||
871 | goto fail; | 862 | goto fail; |
872 | } | 863 | } |
873 | 864 | ||
@@ -879,44 +870,25 @@ static struct hid_device *usb_hid_configure(struct usb_interface *intf) | |||
879 | spin_lock_init(&usbhid->outlock); | 870 | spin_lock_init(&usbhid->outlock); |
880 | spin_lock_init(&usbhid->ctrllock); | 871 | spin_lock_init(&usbhid->ctrllock); |
881 | 872 | ||
882 | hid->version = le16_to_cpu(hdesc->bcdHID); | ||
883 | hid->country = hdesc->bCountryCode; | ||
884 | hid->dev = &intf->dev; | ||
885 | usbhid->intf = intf; | 873 | usbhid->intf = intf; |
886 | usbhid->ifnum = interface->desc.bInterfaceNumber; | 874 | usbhid->ifnum = interface->desc.bInterfaceNumber; |
887 | 875 | ||
888 | hid->bus = BUS_USB; | ||
889 | hid->vendor = le16_to_cpu(dev->descriptor.idVendor); | ||
890 | hid->product = le16_to_cpu(dev->descriptor.idProduct); | ||
891 | |||
892 | usb_make_path(dev, hid->phys, sizeof(hid->phys)); | ||
893 | strlcat(hid->phys, "/input", sizeof(hid->phys)); | ||
894 | len = strlen(hid->phys); | ||
895 | if (len < sizeof(hid->phys) - 1) | ||
896 | snprintf(hid->phys + len, sizeof(hid->phys) - len, | ||
897 | "%d", intf->altsetting[0].desc.bInterfaceNumber); | ||
898 | |||
899 | if (usb_string(dev, dev->descriptor.iSerialNumber, hid->uniq, 64) <= 0) | ||
900 | hid->uniq[0] = 0; | ||
901 | |||
902 | usbhid->urbctrl = usb_alloc_urb(0, GFP_KERNEL); | 876 | usbhid->urbctrl = usb_alloc_urb(0, GFP_KERNEL); |
903 | if (!usbhid->urbctrl) | 877 | if (!usbhid->urbctrl) { |
878 | ret = -ENOMEM; | ||
904 | goto fail; | 879 | goto fail; |
880 | } | ||
905 | 881 | ||
906 | usb_fill_control_urb(usbhid->urbctrl, dev, 0, (void *) usbhid->cr, | 882 | usb_fill_control_urb(usbhid->urbctrl, dev, 0, (void *) usbhid->cr, |
907 | usbhid->ctrlbuf, 1, hid_ctrl, hid); | 883 | usbhid->ctrlbuf, 1, hid_ctrl, hid); |
908 | usbhid->urbctrl->setup_dma = usbhid->cr_dma; | 884 | usbhid->urbctrl->setup_dma = usbhid->cr_dma; |
909 | usbhid->urbctrl->transfer_dma = usbhid->ctrlbuf_dma; | 885 | usbhid->urbctrl->transfer_dma = usbhid->ctrlbuf_dma; |
910 | usbhid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP); | 886 | usbhid->urbctrl->transfer_flags |= (URB_NO_TRANSFER_DMA_MAP | URB_NO_SETUP_DMA_MAP); |
911 | hid->hidinput_input_event = usb_hidinput_input_event; | 887 | |
912 | hid->hid_open = usbhid_open; | 888 | usbhid_init_reports(hid); |
913 | hid->hid_close = usbhid_close; | 889 | hid_dump_device(hid); |
914 | #ifdef CONFIG_USB_HIDDEV | 890 | |
915 | hid->hiddev_hid_event = hiddev_hid_event; | 891 | return 0; |
916 | hid->hiddev_report_event = hiddev_report_event; | ||
917 | #endif | ||
918 | hid->hid_output_raw_report = usbhid_output_raw_report; | ||
919 | return hid; | ||
920 | 892 | ||
921 | fail: | 893 | fail: |
922 | usb_free_urb(usbhid->urbin); | 894 | usb_free_urb(usbhid->urbin); |
@@ -924,24 +896,18 @@ fail: | |||
924 | usb_free_urb(usbhid->urbctrl); | 896 | usb_free_urb(usbhid->urbctrl); |
925 | hid_free_buffers(dev, hid); | 897 | hid_free_buffers(dev, hid); |
926 | kfree(usbhid); | 898 | kfree(usbhid); |
927 | fail_no_usbhid: | 899 | err: |
928 | hid_free_device(hid); | 900 | return ret; |
929 | |||
930 | return NULL; | ||
931 | } | 901 | } |
932 | 902 | ||
933 | static void hid_disconnect(struct usb_interface *intf) | 903 | static void usbhid_stop(struct hid_device *hid) |
934 | { | 904 | { |
935 | struct hid_device *hid = usb_get_intfdata (intf); | 905 | struct usbhid_device *usbhid = hid->driver_data; |
936 | struct usbhid_device *usbhid; | ||
937 | 906 | ||
938 | if (!hid) | 907 | if (WARN_ON(!usbhid)) |
939 | return; | 908 | return; |
940 | 909 | ||
941 | usbhid = hid->driver_data; | ||
942 | |||
943 | spin_lock_irq(&usbhid->inlock); /* Sync with error handler */ | 910 | spin_lock_irq(&usbhid->inlock); /* Sync with error handler */ |
944 | usb_set_intfdata(intf, NULL); | ||
945 | set_bit(HID_DISCONNECTED, &usbhid->iofl); | 911 | set_bit(HID_DISCONNECTED, &usbhid->iofl); |
946 | spin_unlock_irq(&usbhid->inlock); | 912 | spin_unlock_irq(&usbhid->inlock); |
947 | usb_kill_urb(usbhid->urbin); | 913 | usb_kill_urb(usbhid->urbin); |
@@ -958,86 +924,100 @@ static void hid_disconnect(struct usb_interface *intf) | |||
958 | if (hid->claimed & HID_CLAIMED_HIDRAW) | 924 | if (hid->claimed & HID_CLAIMED_HIDRAW) |
959 | hidraw_disconnect(hid); | 925 | hidraw_disconnect(hid); |
960 | 926 | ||
927 | hid->claimed = 0; | ||
928 | |||
961 | usb_free_urb(usbhid->urbin); | 929 | usb_free_urb(usbhid->urbin); |
962 | usb_free_urb(usbhid->urbctrl); | 930 | usb_free_urb(usbhid->urbctrl); |
963 | usb_free_urb(usbhid->urbout); | 931 | usb_free_urb(usbhid->urbout); |
964 | 932 | ||
965 | hid_free_buffers(hid_to_usb_dev(hid), hid); | 933 | hid_free_buffers(hid_to_usb_dev(hid), hid); |
966 | kfree(usbhid); | 934 | kfree(usbhid); |
967 | hid_free_device(hid); | 935 | hid->driver_data = NULL; |
968 | } | 936 | } |
969 | 937 | ||
938 | static struct hid_ll_driver usb_hid_driver = { | ||
939 | .parse = usbhid_parse, | ||
940 | .start = usbhid_start, | ||
941 | .stop = usbhid_stop, | ||
942 | .open = usbhid_open, | ||
943 | .close = usbhid_close, | ||
944 | .hidinput_input_event = usb_hidinput_input_event, | ||
945 | }; | ||
946 | |||
970 | static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id) | 947 | static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id) |
971 | { | 948 | { |
949 | struct usb_device *dev = interface_to_usbdev(intf); | ||
972 | struct hid_device *hid; | 950 | struct hid_device *hid; |
973 | char path[64]; | 951 | size_t len; |
974 | int i; | 952 | int ret; |
975 | char *c; | ||
976 | 953 | ||
977 | dbg_hid("HID probe called for ifnum %d\n", | 954 | dbg_hid("HID probe called for ifnum %d\n", |
978 | intf->altsetting->desc.bInterfaceNumber); | 955 | intf->altsetting->desc.bInterfaceNumber); |
979 | 956 | ||
980 | if (!(hid = usb_hid_configure(intf))) | 957 | hid = hid_allocate_device(); |
981 | return -ENODEV; | 958 | if (IS_ERR(hid)) |
982 | 959 | return PTR_ERR(hid); | |
983 | usbhid_init_reports(hid); | ||
984 | hid_dump_device(hid); | ||
985 | if (hid->quirks & HID_QUIRK_RESET_LEDS) | ||
986 | usbhid_set_leds(hid); | ||
987 | |||
988 | if (!hidinput_connect(hid)) | ||
989 | hid->claimed |= HID_CLAIMED_INPUT; | ||
990 | if (!hiddev_connect(hid)) | ||
991 | hid->claimed |= HID_CLAIMED_HIDDEV; | ||
992 | if (!hidraw_connect(hid)) | ||
993 | hid->claimed |= HID_CLAIMED_HIDRAW; | ||
994 | 960 | ||
995 | usb_set_intfdata(intf, hid); | 961 | usb_set_intfdata(intf, hid); |
962 | hid->ll_driver = &usb_hid_driver; | ||
963 | hid->hid_output_raw_report = usbhid_output_raw_report; | ||
964 | hid->ff_init = hid_pidff_init; | ||
965 | #ifdef CONFIG_USB_HIDDEV | ||
966 | hid->hiddev_connect = hiddev_connect; | ||
967 | hid->hiddev_hid_event = hiddev_hid_event; | ||
968 | hid->hiddev_report_event = hiddev_report_event; | ||
969 | #endif | ||
970 | hid->dev.parent = &intf->dev; | ||
971 | hid->bus = BUS_USB; | ||
972 | hid->vendor = le16_to_cpu(dev->descriptor.idVendor); | ||
973 | hid->product = le16_to_cpu(dev->descriptor.idProduct); | ||
974 | hid->name[0] = 0; | ||
996 | 975 | ||
997 | if (!hid->claimed) { | 976 | if (dev->manufacturer) |
998 | printk ("HID device claimed by neither input, hiddev nor hidraw\n"); | 977 | strlcpy(hid->name, dev->manufacturer, sizeof(hid->name)); |
999 | hid_disconnect(intf); | 978 | |
1000 | return -ENODEV; | 979 | if (dev->product) { |
980 | if (dev->manufacturer) | ||
981 | strlcat(hid->name, " ", sizeof(hid->name)); | ||
982 | strlcat(hid->name, dev->product, sizeof(hid->name)); | ||
1001 | } | 983 | } |
1002 | 984 | ||
1003 | if ((hid->claimed & HID_CLAIMED_INPUT)) | 985 | if (!strlen(hid->name)) |
1004 | hid_ff_init(hid); | 986 | snprintf(hid->name, sizeof(hid->name), "HID %04x:%04x", |
987 | le16_to_cpu(dev->descriptor.idVendor), | ||
988 | le16_to_cpu(dev->descriptor.idProduct)); | ||
1005 | 989 | ||
1006 | if (hid->quirks & HID_QUIRK_SONY_PS3_CONTROLLER) | 990 | usb_make_path(dev, hid->phys, sizeof(hid->phys)); |
1007 | hid_fixup_sony_ps3_controller(interface_to_usbdev(intf), | 991 | strlcat(hid->phys, "/input", sizeof(hid->phys)); |
1008 | intf->cur_altsetting->desc.bInterfaceNumber); | 992 | len = strlen(hid->phys); |
993 | if (len < sizeof(hid->phys) - 1) | ||
994 | snprintf(hid->phys + len, sizeof(hid->phys) - len, | ||
995 | "%d", intf->altsetting[0].desc.bInterfaceNumber); | ||
1009 | 996 | ||
1010 | printk(KERN_INFO); | 997 | if (usb_string(dev, dev->descriptor.iSerialNumber, hid->uniq, 64) <= 0) |
998 | hid->uniq[0] = 0; | ||
1011 | 999 | ||
1012 | if (hid->claimed & HID_CLAIMED_INPUT) | 1000 | ret = hid_add_device(hid); |
1013 | printk("input"); | 1001 | if (ret) { |
1014 | if ((hid->claimed & HID_CLAIMED_INPUT) && ((hid->claimed & HID_CLAIMED_HIDDEV) || | 1002 | if (ret != -ENODEV) |
1015 | hid->claimed & HID_CLAIMED_HIDRAW)) | 1003 | dev_err(&intf->dev, "can't add hid device: %d\n", ret); |
1016 | printk(","); | 1004 | goto err; |
1017 | if (hid->claimed & HID_CLAIMED_HIDDEV) | ||
1018 | printk("hiddev%d", hid->minor); | ||
1019 | if ((hid->claimed & HID_CLAIMED_INPUT) && (hid->claimed & HID_CLAIMED_HIDDEV) && | ||
1020 | (hid->claimed & HID_CLAIMED_HIDRAW)) | ||
1021 | printk(","); | ||
1022 | if (hid->claimed & HID_CLAIMED_HIDRAW) | ||
1023 | printk("hidraw%d", ((struct hidraw*)hid->hidraw)->minor); | ||
1024 | |||
1025 | c = "Device"; | ||
1026 | for (i = 0; i < hid->maxcollection; i++) { | ||
1027 | if (hid->collection[i].type == HID_COLLECTION_APPLICATION && | ||
1028 | (hid->collection[i].usage & HID_USAGE_PAGE) == HID_UP_GENDESK && | ||
1029 | (hid->collection[i].usage & 0xffff) < ARRAY_SIZE(hid_types)) { | ||
1030 | c = hid_types[hid->collection[i].usage & 0xffff]; | ||
1031 | break; | ||
1032 | } | ||
1033 | } | 1005 | } |
1034 | 1006 | ||
1035 | usb_make_path(interface_to_usbdev(intf), path, 63); | 1007 | return 0; |
1008 | err: | ||
1009 | hid_destroy_device(hid); | ||
1010 | return ret; | ||
1011 | } | ||
1036 | 1012 | ||
1037 | printk(": USB HID v%x.%02x %s [%s] on %s\n", | 1013 | static void hid_disconnect(struct usb_interface *intf) |
1038 | hid->version >> 8, hid->version & 0xff, c, hid->name, path); | 1014 | { |
1015 | struct hid_device *hid = usb_get_intfdata(intf); | ||
1039 | 1016 | ||
1040 | return 0; | 1017 | if (WARN_ON(!hid)) |
1018 | return; | ||
1019 | |||
1020 | hid_destroy_device(hid); | ||
1041 | } | 1021 | } |
1042 | 1022 | ||
1043 | static int hid_suspend(struct usb_interface *intf, pm_message_t message) | 1023 | static int hid_suspend(struct usb_interface *intf, pm_message_t message) |
@@ -1107,9 +1087,22 @@ static struct usb_driver hid_driver = { | |||
1107 | .supports_autosuspend = 1, | 1087 | .supports_autosuspend = 1, |
1108 | }; | 1088 | }; |
1109 | 1089 | ||
1090 | static const struct hid_device_id hid_usb_table[] = { | ||
1091 | { HID_USB_DEVICE(HID_ANY_ID, HID_ANY_ID) }, | ||
1092 | { } | ||
1093 | }; | ||
1094 | |||
1095 | static struct hid_driver hid_usb_driver = { | ||
1096 | .name = "generic-usb", | ||
1097 | .id_table = hid_usb_table, | ||
1098 | }; | ||
1099 | |||
1110 | static int __init hid_init(void) | 1100 | static int __init hid_init(void) |
1111 | { | 1101 | { |
1112 | int retval; | 1102 | int retval; |
1103 | retval = hid_register_driver(&hid_usb_driver); | ||
1104 | if (retval) | ||
1105 | goto hid_register_fail; | ||
1113 | retval = usbhid_quirks_init(quirks_param); | 1106 | retval = usbhid_quirks_init(quirks_param); |
1114 | if (retval) | 1107 | if (retval) |
1115 | goto usbhid_quirks_init_fail; | 1108 | goto usbhid_quirks_init_fail; |
@@ -1119,7 +1112,8 @@ static int __init hid_init(void) | |||
1119 | retval = usb_register(&hid_driver); | 1112 | retval = usb_register(&hid_driver); |
1120 | if (retval) | 1113 | if (retval) |
1121 | goto usb_register_fail; | 1114 | goto usb_register_fail; |
1122 | info(DRIVER_VERSION ":" DRIVER_DESC); | 1115 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" |
1116 | DRIVER_DESC "\n"); | ||
1123 | 1117 | ||
1124 | return 0; | 1118 | return 0; |
1125 | usb_register_fail: | 1119 | usb_register_fail: |
@@ -1127,6 +1121,8 @@ usb_register_fail: | |||
1127 | hiddev_init_fail: | 1121 | hiddev_init_fail: |
1128 | usbhid_quirks_exit(); | 1122 | usbhid_quirks_exit(); |
1129 | usbhid_quirks_init_fail: | 1123 | usbhid_quirks_init_fail: |
1124 | hid_unregister_driver(&hid_usb_driver); | ||
1125 | hid_register_fail: | ||
1130 | return retval; | 1126 | return retval; |
1131 | } | 1127 | } |
1132 | 1128 | ||
@@ -1135,6 +1131,7 @@ static void __exit hid_exit(void) | |||
1135 | usb_deregister(&hid_driver); | 1131 | usb_deregister(&hid_driver); |
1136 | hiddev_exit(); | 1132 | hiddev_exit(); |
1137 | usbhid_quirks_exit(); | 1133 | usbhid_quirks_exit(); |
1134 | hid_unregister_driver(&hid_usb_driver); | ||
1138 | } | 1135 | } |
1139 | 1136 | ||
1140 | module_init(hid_init); | 1137 | module_init(hid_init); |
diff --git a/drivers/hid/usbhid/hid-ff.c b/drivers/hid/usbhid/hid-ff.c deleted file mode 100644 index 1d0dac52f166..000000000000 --- a/drivers/hid/usbhid/hid-ff.c +++ /dev/null | |||
@@ -1,95 +0,0 @@ | |||
1 | /* | ||
2 | * Force feedback support for hid devices. | ||
3 | * Not all hid devices use the same protocol. For example, some use PID, | ||
4 | * other use their own proprietary procotol. | ||
5 | * | ||
6 | * Copyright (c) 2002-2004 Johann Deneux | ||
7 | */ | ||
8 | |||
9 | /* | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | * | ||
24 | * Should you need to contact me, the author, you can do so by | ||
25 | * e-mail - mail your message to <johann.deneux@it.uu.se> | ||
26 | */ | ||
27 | |||
28 | #include <linux/input.h> | ||
29 | |||
30 | #undef DEBUG | ||
31 | #include <linux/usb.h> | ||
32 | |||
33 | #include <linux/hid.h> | ||
34 | #include "usbhid.h" | ||
35 | |||
36 | /* | ||
37 | * This table contains pointers to initializers. To add support for new | ||
38 | * devices, you need to add the USB vendor and product ids here. | ||
39 | */ | ||
40 | struct hid_ff_initializer { | ||
41 | u16 idVendor; | ||
42 | u16 idProduct; | ||
43 | int (*init)(struct hid_device*); | ||
44 | }; | ||
45 | |||
46 | /* | ||
47 | * We try pidff when no other driver is found because PID is the | ||
48 | * standards compliant way of implementing force feedback in HID. | ||
49 | * pidff_init() will quickly abort if the device doesn't appear to | ||
50 | * be a PID device | ||
51 | */ | ||
52 | static struct hid_ff_initializer inits[] = { | ||
53 | #ifdef CONFIG_LOGITECH_FF | ||
54 | { 0x46d, 0xc211, hid_lgff_init }, /* Logitech Cordless rumble pad */ | ||
55 | { 0x46d, 0xc219, hid_lgff_init }, /* Logitech Cordless rumble pad 2 */ | ||
56 | { 0x46d, 0xc283, hid_lgff_init }, /* Logitech Wingman Force 3d */ | ||
57 | { 0x46d, 0xc286, hid_lgff_init }, /* Logitech Force 3D Pro Joystick */ | ||
58 | { 0x46d, 0xc294, hid_lgff_init }, /* Logitech Formula Force EX */ | ||
59 | { 0x46d, 0xc295, hid_lgff_init }, /* Logitech MOMO force wheel */ | ||
60 | { 0x46d, 0xca03, hid_lgff_init }, /* Logitech MOMO force wheel */ | ||
61 | #endif | ||
62 | #ifdef CONFIG_LOGIRUMBLEPAD2_FF | ||
63 | { 0x46d, 0xc218, hid_lg2ff_init }, /* Logitech Rumblepad 2 */ | ||
64 | #endif | ||
65 | #ifdef CONFIG_PANTHERLORD_FF | ||
66 | { 0x810, 0x0001, hid_plff_init }, /* "Twin USB Joystick" */ | ||
67 | { 0xe8f, 0x0003, hid_plff_init }, /* "GreenAsia Inc. USB Joystick " */ | ||
68 | #endif | ||
69 | #ifdef CONFIG_THRUSTMASTER_FF | ||
70 | { 0x44f, 0xb300, hid_tmff_init }, | ||
71 | { 0x44f, 0xb304, hid_tmff_init }, | ||
72 | { 0x44f, 0xb651, hid_tmff_init }, /* FGT Rumble Force Wheel */ | ||
73 | { 0x44f, 0xb654, hid_tmff_init }, /* FGT Force Feedback Wheel */ | ||
74 | #endif | ||
75 | #ifdef CONFIG_ZEROPLUS_FF | ||
76 | { 0xc12, 0x0005, hid_zpff_init }, | ||
77 | { 0xc12, 0x0030, hid_zpff_init }, | ||
78 | #endif | ||
79 | { 0, 0, hid_pidff_init} /* Matches anything */ | ||
80 | }; | ||
81 | |||
82 | int hid_ff_init(struct hid_device* hid) | ||
83 | { | ||
84 | struct hid_ff_initializer *init; | ||
85 | int vendor = le16_to_cpu(hid_to_usb_dev(hid)->descriptor.idVendor); | ||
86 | int product = le16_to_cpu(hid_to_usb_dev(hid)->descriptor.idProduct); | ||
87 | |||
88 | for (init = inits; init->idVendor; init++) | ||
89 | if (init->idVendor == vendor && init->idProduct == product) | ||
90 | break; | ||
91 | |||
92 | return init->init(hid); | ||
93 | } | ||
94 | EXPORT_SYMBOL_GPL(hid_ff_init); | ||
95 | |||
diff --git a/drivers/hid/usbhid/hid-lg2ff.c b/drivers/hid/usbhid/hid-lg2ff.c deleted file mode 100644 index d469bd0061c9..000000000000 --- a/drivers/hid/usbhid/hid-lg2ff.c +++ /dev/null | |||
@@ -1,114 +0,0 @@ | |||
1 | /* | ||
2 | * Force feedback support for Logitech Rumblepad 2 | ||
3 | * | ||
4 | * Copyright (c) 2008 Anssi Hannula <anssi.hannula@gmail.com> | ||
5 | */ | ||
6 | |||
7 | /* | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | |||
24 | #include <linux/input.h> | ||
25 | #include <linux/usb.h> | ||
26 | #include <linux/hid.h> | ||
27 | #include "usbhid.h" | ||
28 | |||
29 | struct lg2ff_device { | ||
30 | struct hid_report *report; | ||
31 | }; | ||
32 | |||
33 | static int play_effect(struct input_dev *dev, void *data, | ||
34 | struct ff_effect *effect) | ||
35 | { | ||
36 | struct hid_device *hid = input_get_drvdata(dev); | ||
37 | struct lg2ff_device *lg2ff = data; | ||
38 | int weak, strong; | ||
39 | |||
40 | strong = effect->u.rumble.strong_magnitude; | ||
41 | weak = effect->u.rumble.weak_magnitude; | ||
42 | |||
43 | if (weak || strong) { | ||
44 | weak = weak * 0xff / 0xffff; | ||
45 | strong = strong * 0xff / 0xffff; | ||
46 | |||
47 | lg2ff->report->field[0]->value[0] = 0x51; | ||
48 | lg2ff->report->field[0]->value[2] = weak; | ||
49 | lg2ff->report->field[0]->value[4] = strong; | ||
50 | } else { | ||
51 | lg2ff->report->field[0]->value[0] = 0xf3; | ||
52 | lg2ff->report->field[0]->value[2] = 0x00; | ||
53 | lg2ff->report->field[0]->value[4] = 0x00; | ||
54 | } | ||
55 | |||
56 | usbhid_submit_report(hid, lg2ff->report, USB_DIR_OUT); | ||
57 | return 0; | ||
58 | } | ||
59 | |||
60 | int hid_lg2ff_init(struct hid_device *hid) | ||
61 | { | ||
62 | struct lg2ff_device *lg2ff; | ||
63 | struct hid_report *report; | ||
64 | struct hid_input *hidinput = list_entry(hid->inputs.next, | ||
65 | struct hid_input, list); | ||
66 | struct list_head *report_list = | ||
67 | &hid->report_enum[HID_OUTPUT_REPORT].report_list; | ||
68 | struct input_dev *dev = hidinput->input; | ||
69 | int error; | ||
70 | |||
71 | if (list_empty(report_list)) { | ||
72 | printk(KERN_ERR "hid-lg2ff: no output report found\n"); | ||
73 | return -ENODEV; | ||
74 | } | ||
75 | |||
76 | report = list_entry(report_list->next, struct hid_report, list); | ||
77 | |||
78 | if (report->maxfield < 1) { | ||
79 | printk(KERN_ERR "hid-lg2ff: output report is empty\n"); | ||
80 | return -ENODEV; | ||
81 | } | ||
82 | if (report->field[0]->report_count < 7) { | ||
83 | printk(KERN_ERR "hid-lg2ff: not enough values in the field\n"); | ||
84 | return -ENODEV; | ||
85 | } | ||
86 | |||
87 | lg2ff = kmalloc(sizeof(struct lg2ff_device), GFP_KERNEL); | ||
88 | if (!lg2ff) | ||
89 | return -ENOMEM; | ||
90 | |||
91 | set_bit(FF_RUMBLE, dev->ffbit); | ||
92 | |||
93 | error = input_ff_create_memless(dev, lg2ff, play_effect); | ||
94 | if (error) { | ||
95 | kfree(lg2ff); | ||
96 | return error; | ||
97 | } | ||
98 | |||
99 | lg2ff->report = report; | ||
100 | report->field[0]->value[0] = 0xf3; | ||
101 | report->field[0]->value[1] = 0x00; | ||
102 | report->field[0]->value[2] = 0x00; | ||
103 | report->field[0]->value[3] = 0x00; | ||
104 | report->field[0]->value[4] = 0x00; | ||
105 | report->field[0]->value[5] = 0x00; | ||
106 | report->field[0]->value[6] = 0x00; | ||
107 | |||
108 | usbhid_submit_report(hid, report, USB_DIR_OUT); | ||
109 | |||
110 | printk(KERN_INFO "Force feedback for Logitech Rumblepad 2 by " | ||
111 | "Anssi Hannula <anssi.hannula@gmail.com>\n"); | ||
112 | |||
113 | return 0; | ||
114 | } | ||
diff --git a/drivers/hid/usbhid/hid-lgff.c b/drivers/hid/usbhid/hid-lgff.c deleted file mode 100644 index 4b7ab6a46d93..000000000000 --- a/drivers/hid/usbhid/hid-lgff.c +++ /dev/null | |||
@@ -1,151 +0,0 @@ | |||
1 | /* | ||
2 | * Force feedback support for hid-compliant for some of the devices from | ||
3 | * Logitech, namely: | ||
4 | * - WingMan Cordless RumblePad | ||
5 | * - WingMan Force 3D | ||
6 | * | ||
7 | * Copyright (c) 2002-2004 Johann Deneux | ||
8 | * Copyright (c) 2006 Anssi Hannula <anssi.hannula@gmail.com> | ||
9 | */ | ||
10 | |||
11 | /* | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License as published by | ||
14 | * the Free Software Foundation; either version 2 of the License, or | ||
15 | * (at your option) any later version. | ||
16 | * | ||
17 | * This program is distributed in the hope that it will be useful, | ||
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
20 | * GNU General Public License for more details. | ||
21 | * | ||
22 | * You should have received a copy of the GNU General Public License | ||
23 | * along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
25 | * | ||
26 | * Should you need to contact me, the author, you can do so by | ||
27 | * e-mail - mail your message to <johann.deneux@it.uu.se> | ||
28 | */ | ||
29 | |||
30 | #include <linux/input.h> | ||
31 | #include <linux/usb.h> | ||
32 | #include <linux/hid.h> | ||
33 | #include "usbhid.h" | ||
34 | |||
35 | struct dev_type { | ||
36 | u16 idVendor; | ||
37 | u16 idProduct; | ||
38 | const signed short *ff; | ||
39 | }; | ||
40 | |||
41 | static const signed short ff_rumble[] = { | ||
42 | FF_RUMBLE, | ||
43 | -1 | ||
44 | }; | ||
45 | |||
46 | static const signed short ff_joystick[] = { | ||
47 | FF_CONSTANT, | ||
48 | -1 | ||
49 | }; | ||
50 | |||
51 | static const struct dev_type devices[] = { | ||
52 | { 0x046d, 0xc211, ff_rumble }, | ||
53 | { 0x046d, 0xc219, ff_rumble }, | ||
54 | { 0x046d, 0xc283, ff_joystick }, | ||
55 | { 0x046d, 0xc286, ff_joystick }, | ||
56 | { 0x046d, 0xc294, ff_joystick }, | ||
57 | { 0x046d, 0xc295, ff_joystick }, | ||
58 | { 0x046d, 0xca03, ff_joystick }, | ||
59 | }; | ||
60 | |||
61 | static int hid_lgff_play(struct input_dev *dev, void *data, struct ff_effect *effect) | ||
62 | { | ||
63 | struct hid_device *hid = input_get_drvdata(dev); | ||
64 | struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; | ||
65 | struct hid_report *report = list_entry(report_list->next, struct hid_report, list); | ||
66 | int x, y; | ||
67 | unsigned int left, right; | ||
68 | |||
69 | #define CLAMP(x) if (x < 0) x = 0; if (x > 0xff) x = 0xff | ||
70 | |||
71 | switch (effect->type) { | ||
72 | case FF_CONSTANT: | ||
73 | x = effect->u.ramp.start_level + 0x7f; /* 0x7f is center */ | ||
74 | y = effect->u.ramp.end_level + 0x7f; | ||
75 | CLAMP(x); | ||
76 | CLAMP(y); | ||
77 | report->field[0]->value[0] = 0x51; | ||
78 | report->field[0]->value[1] = 0x08; | ||
79 | report->field[0]->value[2] = x; | ||
80 | report->field[0]->value[3] = y; | ||
81 | dbg_hid("(x, y)=(%04x, %04x)\n", x, y); | ||
82 | usbhid_submit_report(hid, report, USB_DIR_OUT); | ||
83 | break; | ||
84 | |||
85 | case FF_RUMBLE: | ||
86 | right = effect->u.rumble.strong_magnitude; | ||
87 | left = effect->u.rumble.weak_magnitude; | ||
88 | right = right * 0xff / 0xffff; | ||
89 | left = left * 0xff / 0xffff; | ||
90 | CLAMP(left); | ||
91 | CLAMP(right); | ||
92 | report->field[0]->value[0] = 0x42; | ||
93 | report->field[0]->value[1] = 0x00; | ||
94 | report->field[0]->value[2] = left; | ||
95 | report->field[0]->value[3] = right; | ||
96 | dbg_hid("(left, right)=(%04x, %04x)\n", left, right); | ||
97 | usbhid_submit_report(hid, report, USB_DIR_OUT); | ||
98 | break; | ||
99 | } | ||
100 | return 0; | ||
101 | } | ||
102 | |||
103 | int hid_lgff_init(struct hid_device* hid) | ||
104 | { | ||
105 | struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); | ||
106 | struct list_head *report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; | ||
107 | struct input_dev *dev = hidinput->input; | ||
108 | struct hid_report *report; | ||
109 | struct hid_field *field; | ||
110 | const signed short *ff_bits = ff_joystick; | ||
111 | int error; | ||
112 | int i; | ||
113 | |||
114 | /* Find the report to use */ | ||
115 | if (list_empty(report_list)) { | ||
116 | err_hid("No output report found"); | ||
117 | return -1; | ||
118 | } | ||
119 | |||
120 | /* Check that the report looks ok */ | ||
121 | report = list_entry(report_list->next, struct hid_report, list); | ||
122 | if (!report) { | ||
123 | err_hid("NULL output report"); | ||
124 | return -1; | ||
125 | } | ||
126 | |||
127 | field = report->field[0]; | ||
128 | if (!field) { | ||
129 | err_hid("NULL field"); | ||
130 | return -1; | ||
131 | } | ||
132 | |||
133 | for (i = 0; i < ARRAY_SIZE(devices); i++) { | ||
134 | if (dev->id.vendor == devices[i].idVendor && | ||
135 | dev->id.product == devices[i].idProduct) { | ||
136 | ff_bits = devices[i].ff; | ||
137 | break; | ||
138 | } | ||
139 | } | ||
140 | |||
141 | for (i = 0; ff_bits[i] >= 0; i++) | ||
142 | set_bit(ff_bits[i], dev->ffbit); | ||
143 | |||
144 | error = input_ff_create_memless(dev, NULL, hid_lgff_play); | ||
145 | if (error) | ||
146 | return error; | ||
147 | |||
148 | printk(KERN_INFO "Force feedback for Logitech force feedback devices by Johann Deneux <johann.deneux@it.uu.se>\n"); | ||
149 | |||
150 | return 0; | ||
151 | } | ||
diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c index 011326178c06..484e3eec2f88 100644 --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c | |||
@@ -397,7 +397,6 @@ static void pidff_set_condition_report(struct pidff_device *pidff, | |||
397 | effect->u.condition[i].left_saturation); | 397 | effect->u.condition[i].left_saturation); |
398 | pidff_set(&pidff->set_condition[PID_DEAD_BAND], | 398 | pidff_set(&pidff->set_condition[PID_DEAD_BAND], |
399 | effect->u.condition[i].deadband); | 399 | effect->u.condition[i].deadband); |
400 | usbhid_wait_io(pidff->hid); | ||
401 | usbhid_submit_report(pidff->hid, pidff->reports[PID_SET_CONDITION], | 400 | usbhid_submit_report(pidff->hid, pidff->reports[PID_SET_CONDITION], |
402 | USB_DIR_OUT); | 401 | USB_DIR_OUT); |
403 | } | 402 | } |
@@ -512,7 +511,6 @@ static void pidff_playback_pid(struct pidff_device *pidff, int pid_id, int n) | |||
512 | pidff->effect_operation[PID_LOOP_COUNT].value[0] = n; | 511 | pidff->effect_operation[PID_LOOP_COUNT].value[0] = n; |
513 | } | 512 | } |
514 | 513 | ||
515 | usbhid_wait_io(pidff->hid); | ||
516 | usbhid_submit_report(pidff->hid, pidff->reports[PID_EFFECT_OPERATION], | 514 | usbhid_submit_report(pidff->hid, pidff->reports[PID_EFFECT_OPERATION], |
517 | USB_DIR_OUT); | 515 | USB_DIR_OUT); |
518 | } | 516 | } |
@@ -548,6 +546,9 @@ static int pidff_erase_effect(struct input_dev *dev, int effect_id) | |||
548 | int pid_id = pidff->pid_id[effect_id]; | 546 | int pid_id = pidff->pid_id[effect_id]; |
549 | 547 | ||
550 | debug("starting to erase %d/%d", effect_id, pidff->pid_id[effect_id]); | 548 | debug("starting to erase %d/%d", effect_id, pidff->pid_id[effect_id]); |
549 | /* Wait for the queue to clear. We do not want a full fifo to | ||
550 | prevent the effect removal. */ | ||
551 | usbhid_wait_io(pidff->hid); | ||
551 | pidff_playback_pid(pidff, pid_id, 0); | 552 | pidff_playback_pid(pidff, pid_id, 0); |
552 | pidff_erase_pid(pidff, pid_id); | 553 | pidff_erase_pid(pidff, pid_id); |
553 | 554 | ||
diff --git a/drivers/hid/usbhid/hid-plff.c b/drivers/hid/usbhid/hid-plff.c deleted file mode 100644 index 9eb83cf9d22b..000000000000 --- a/drivers/hid/usbhid/hid-plff.c +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | /* | ||
2 | * Force feedback support for PantherLord/GreenAsia based devices | ||
3 | * | ||
4 | * The devices are distributed under various names and the same USB device ID | ||
5 | * can be used in both adapters and actual game controllers. | ||
6 | * | ||
7 | * 0810:0001 "Twin USB Joystick" | ||
8 | * - tested with PantherLord USB/PS2 2in1 Adapter | ||
9 | * - contains two reports, one for each port (HID_QUIRK_MULTI_INPUT) | ||
10 | * | ||
11 | * 0e8f:0003 "GreenAsia Inc. USB Joystick " | ||
12 | * - tested with Köng Gaming gamepad | ||
13 | * | ||
14 | * Copyright (c) 2007 Anssi Hannula <anssi.hannula@gmail.com> | ||
15 | */ | ||
16 | |||
17 | /* | ||
18 | * This program is free software; you can redistribute it and/or modify | ||
19 | * it under the terms of the GNU General Public License as published by | ||
20 | * the Free Software Foundation; either version 2 of the License, or | ||
21 | * (at your option) any later version. | ||
22 | * | ||
23 | * This program is distributed in the hope that it will be useful, | ||
24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
26 | * GNU General Public License for more details. | ||
27 | * | ||
28 | * You should have received a copy of the GNU General Public License | ||
29 | * along with this program; if not, write to the Free Software | ||
30 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
31 | */ | ||
32 | |||
33 | |||
34 | /* #define DEBUG */ | ||
35 | |||
36 | #define debug(format, arg...) pr_debug("hid-plff: " format "\n" , ## arg) | ||
37 | |||
38 | #include <linux/input.h> | ||
39 | #include <linux/usb.h> | ||
40 | #include <linux/hid.h> | ||
41 | #include "usbhid.h" | ||
42 | |||
43 | struct plff_device { | ||
44 | struct hid_report *report; | ||
45 | }; | ||
46 | |||
47 | static int hid_plff_play(struct input_dev *dev, void *data, | ||
48 | struct ff_effect *effect) | ||
49 | { | ||
50 | struct hid_device *hid = input_get_drvdata(dev); | ||
51 | struct plff_device *plff = data; | ||
52 | int left, right; | ||
53 | |||
54 | left = effect->u.rumble.strong_magnitude; | ||
55 | right = effect->u.rumble.weak_magnitude; | ||
56 | debug("called with 0x%04x 0x%04x", left, right); | ||
57 | |||
58 | left = left * 0x7f / 0xffff; | ||
59 | right = right * 0x7f / 0xffff; | ||
60 | |||
61 | plff->report->field[0]->value[2] = left; | ||
62 | plff->report->field[0]->value[3] = right; | ||
63 | debug("running with 0x%02x 0x%02x", left, right); | ||
64 | usbhid_submit_report(hid, plff->report, USB_DIR_OUT); | ||
65 | |||
66 | return 0; | ||
67 | } | ||
68 | |||
69 | int hid_plff_init(struct hid_device *hid) | ||
70 | { | ||
71 | struct plff_device *plff; | ||
72 | struct hid_report *report; | ||
73 | struct hid_input *hidinput; | ||
74 | struct list_head *report_list = | ||
75 | &hid->report_enum[HID_OUTPUT_REPORT].report_list; | ||
76 | struct list_head *report_ptr = report_list; | ||
77 | struct input_dev *dev; | ||
78 | int error; | ||
79 | |||
80 | /* The device contains one output report per physical device, all | ||
81 | containing 1 field, which contains 4 ff00.0002 usages and 4 16bit | ||
82 | absolute values. | ||
83 | |||
84 | The input reports also contain a field which contains | ||
85 | 8 ff00.0001 usages and 8 boolean values. Their meaning is | ||
86 | currently unknown. */ | ||
87 | |||
88 | if (list_empty(report_list)) { | ||
89 | printk(KERN_ERR "hid-plff: no output reports found\n"); | ||
90 | return -ENODEV; | ||
91 | } | ||
92 | |||
93 | list_for_each_entry(hidinput, &hid->inputs, list) { | ||
94 | |||
95 | report_ptr = report_ptr->next; | ||
96 | |||
97 | if (report_ptr == report_list) { | ||
98 | printk(KERN_ERR "hid-plff: required output report is missing\n"); | ||
99 | return -ENODEV; | ||
100 | } | ||
101 | |||
102 | report = list_entry(report_ptr, struct hid_report, list); | ||
103 | if (report->maxfield < 1) { | ||
104 | printk(KERN_ERR "hid-plff: no fields in the report\n"); | ||
105 | return -ENODEV; | ||
106 | } | ||
107 | |||
108 | if (report->field[0]->report_count < 4) { | ||
109 | printk(KERN_ERR "hid-plff: not enough values in the field\n"); | ||
110 | return -ENODEV; | ||
111 | } | ||
112 | |||
113 | plff = kzalloc(sizeof(struct plff_device), GFP_KERNEL); | ||
114 | if (!plff) | ||
115 | return -ENOMEM; | ||
116 | |||
117 | dev = hidinput->input; | ||
118 | |||
119 | set_bit(FF_RUMBLE, dev->ffbit); | ||
120 | |||
121 | error = input_ff_create_memless(dev, plff, hid_plff_play); | ||
122 | if (error) { | ||
123 | kfree(plff); | ||
124 | return error; | ||
125 | } | ||
126 | |||
127 | plff->report = report; | ||
128 | plff->report->field[0]->value[0] = 0x00; | ||
129 | plff->report->field[0]->value[1] = 0x00; | ||
130 | plff->report->field[0]->value[2] = 0x00; | ||
131 | plff->report->field[0]->value[3] = 0x00; | ||
132 | usbhid_submit_report(hid, plff->report, USB_DIR_OUT); | ||
133 | } | ||
134 | |||
135 | printk(KERN_INFO "hid-plff: Force feedback for PantherLord/GreenAsia " | ||
136 | "devices by Anssi Hannula <anssi.hannula@gmail.com>\n"); | ||
137 | |||
138 | return 0; | ||
139 | } | ||
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index b15f88249639..47ebe045f9b5 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -17,412 +17,7 @@ | |||
17 | 17 | ||
18 | #include <linux/hid.h> | 18 | #include <linux/hid.h> |
19 | 19 | ||
20 | #define USB_VENDOR_ID_A4TECH 0x09da | 20 | #include "../hid-ids.h" |
21 | #define USB_DEVICE_ID_A4TECH_WCP32PU 0x0006 | ||
22 | #define USB_DEVICE_ID_A4TECH_X5_005D 0x000a | ||
23 | |||
24 | #define USB_VENDOR_ID_AASHIMA 0x06d6 | ||
25 | #define USB_DEVICE_ID_AASHIMA_GAMEPAD 0x0025 | ||
26 | #define USB_DEVICE_ID_AASHIMA_PREDATOR 0x0026 | ||
27 | |||
28 | #define USB_VENDOR_ID_ACECAD 0x0460 | ||
29 | #define USB_DEVICE_ID_ACECAD_FLAIR 0x0004 | ||
30 | #define USB_DEVICE_ID_ACECAD_302 0x0008 | ||
31 | |||
32 | #define USB_VENDOR_ID_ADS_TECH 0x06e1 | ||
33 | #define USB_DEVICE_ID_ADS_TECH_RADIO_SI470X 0xa155 | ||
34 | |||
35 | #define USB_VENDOR_ID_AFATECH 0x15a4 | ||
36 | #define USB_DEVICE_ID_AFATECH_AF9016 0x9016 | ||
37 | |||
38 | #define USB_VENDOR_ID_AIPTEK 0x08ca | ||
39 | #define USB_DEVICE_ID_AIPTEK_01 0x0001 | ||
40 | #define USB_DEVICE_ID_AIPTEK_10 0x0010 | ||
41 | #define USB_DEVICE_ID_AIPTEK_20 0x0020 | ||
42 | #define USB_DEVICE_ID_AIPTEK_21 0x0021 | ||
43 | #define USB_DEVICE_ID_AIPTEK_22 0x0022 | ||
44 | #define USB_DEVICE_ID_AIPTEK_23 0x0023 | ||
45 | #define USB_DEVICE_ID_AIPTEK_24 0x0024 | ||
46 | |||
47 | #define USB_VENDOR_ID_AIRCABLE 0x16CA | ||
48 | #define USB_DEVICE_ID_AIRCABLE1 0x1502 | ||
49 | |||
50 | #define USB_VENDOR_ID_ALCOR 0x058f | ||
51 | #define USB_DEVICE_ID_ALCOR_USBRS232 0x9720 | ||
52 | |||
53 | #define USB_VENDOR_ID_ALPS 0x0433 | ||
54 | #define USB_DEVICE_ID_IBM_GAMEPAD 0x1101 | ||
55 | |||
56 | #define USB_VENDOR_ID_APPLE 0x05ac | ||
57 | #define USB_DEVICE_ID_APPLE_MIGHTYMOUSE 0x0304 | ||
58 | #define USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI 0x020e | ||
59 | #define USB_DEVICE_ID_APPLE_FOUNTAIN_ISO 0x020f | ||
60 | #define USB_DEVICE_ID_APPLE_GEYSER_ANSI 0x0214 | ||
61 | #define USB_DEVICE_ID_APPLE_GEYSER_ISO 0x0215 | ||
62 | #define USB_DEVICE_ID_APPLE_GEYSER_JIS 0x0216 | ||
63 | #define USB_DEVICE_ID_APPLE_GEYSER3_ANSI 0x0217 | ||
64 | #define USB_DEVICE_ID_APPLE_GEYSER3_ISO 0x0218 | ||
65 | #define USB_DEVICE_ID_APPLE_GEYSER3_JIS 0x0219 | ||
66 | #define USB_DEVICE_ID_APPLE_GEYSER4_ANSI 0x021a | ||
67 | #define USB_DEVICE_ID_APPLE_GEYSER4_ISO 0x021b | ||
68 | #define USB_DEVICE_ID_APPLE_GEYSER4_JIS 0x021c | ||
69 | #define USB_DEVICE_ID_APPLE_ALU_ANSI 0x0220 | ||
70 | #define USB_DEVICE_ID_APPLE_ALU_ISO 0x0221 | ||
71 | #define USB_DEVICE_ID_APPLE_ALU_JIS 0x0222 | ||
72 | #define USB_DEVICE_ID_APPLE_WELLSPRING_ANSI 0x0223 | ||
73 | #define USB_DEVICE_ID_APPLE_WELLSPRING_ISO 0x0224 | ||
74 | #define USB_DEVICE_ID_APPLE_WELLSPRING_JIS 0x0225 | ||
75 | #define USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI 0x0229 | ||
76 | #define USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO 0x022a | ||
77 | #define USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS 0x022b | ||
78 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI 0x022c | ||
79 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO 0x022d | ||
80 | #define USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS 0x022e | ||
81 | #define USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI 0x0230 | ||
82 | #define USB_DEVICE_ID_APPLE_WELLSPRING2_ISO 0x0231 | ||
83 | #define USB_DEVICE_ID_APPLE_WELLSPRING2_JIS 0x0232 | ||
84 | #define USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY 0x030a | ||
85 | #define USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY 0x030b | ||
86 | #define USB_DEVICE_ID_APPLE_IRCONTROL4 0x8242 | ||
87 | |||
88 | #define USB_VENDOR_ID_ASUS 0x0b05 | ||
89 | #define USB_DEVICE_ID_ASUS_LCM 0x1726 | ||
90 | |||
91 | #define USB_VENDOR_ID_ATEN 0x0557 | ||
92 | #define USB_DEVICE_ID_ATEN_UC100KM 0x2004 | ||
93 | #define USB_DEVICE_ID_ATEN_CS124U 0x2202 | ||
94 | #define USB_DEVICE_ID_ATEN_2PORTKVM 0x2204 | ||
95 | #define USB_DEVICE_ID_ATEN_4PORTKVM 0x2205 | ||
96 | #define USB_DEVICE_ID_ATEN_4PORTKVMC 0x2208 | ||
97 | |||
98 | #define USB_VENDOR_ID_BELKIN 0x050d | ||
99 | #define USB_DEVICE_ID_FLIP_KVM 0x3201 | ||
100 | |||
101 | #define USB_VENDOR_ID_BERKSHIRE 0x0c98 | ||
102 | #define USB_DEVICE_ID_BERKSHIRE_PCWD 0x1140 | ||
103 | |||
104 | #define USB_VENDOR_ID_CHERRY 0x046a | ||
105 | #define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023 | ||
106 | |||
107 | #define USB_VENDOR_ID_CHIC 0x05fe | ||
108 | #define USB_DEVICE_ID_CHIC_GAMEPAD 0x0014 | ||
109 | |||
110 | #define USB_VENDOR_ID_CIDC 0x1677 | ||
111 | |||
112 | #define USB_VENDOR_ID_CMEDIA 0x0d8c | ||
113 | #define USB_DEVICE_ID_CM109 0x000e | ||
114 | |||
115 | #define USB_VENDOR_ID_CODEMERCS 0x07c0 | ||
116 | #define USB_DEVICE_ID_CODEMERCS_IOW_FIRST 0x1500 | ||
117 | #define USB_DEVICE_ID_CODEMERCS_IOW_LAST 0x15ff | ||
118 | |||
119 | #define USB_VENDOR_ID_CYGNAL 0x10c4 | ||
120 | #define USB_DEVICE_ID_CYGNAL_RADIO_SI470X 0x818a | ||
121 | |||
122 | #define USB_VENDOR_ID_CYPRESS 0x04b4 | ||
123 | #define USB_DEVICE_ID_CYPRESS_MOUSE 0x0001 | ||
124 | #define USB_DEVICE_ID_CYPRESS_HIDCOM 0x5500 | ||
125 | #define USB_DEVICE_ID_CYPRESS_ULTRAMOUSE 0x7417 | ||
126 | #define USB_DEVICE_ID_CYPRESS_BARCODE_1 0xde61 | ||
127 | #define USB_DEVICE_ID_CYPRESS_BARCODE_2 0xde64 | ||
128 | |||
129 | #define USB_VENDOR_ID_DELL 0x413c | ||
130 | #define USB_DEVICE_ID_DELL_W7658 0x2005 | ||
131 | |||
132 | #define USB_VENDOR_ID_DELORME 0x1163 | ||
133 | #define USB_DEVICE_ID_DELORME_EARTHMATE 0x0100 | ||
134 | #define USB_DEVICE_ID_DELORME_EM_LT20 0x0200 | ||
135 | |||
136 | #define USB_VENDOR_ID_DMI 0x0c0b | ||
137 | #define USB_DEVICE_ID_DMI_ENC 0x5fab | ||
138 | |||
139 | #define USB_VENDOR_ID_ELO 0x04E7 | ||
140 | #define USB_DEVICE_ID_ELO_TS2700 0x0020 | ||
141 | |||
142 | #define USB_VENDOR_ID_ESSENTIAL_REALITY 0x0d7f | ||
143 | #define USB_DEVICE_ID_ESSENTIAL_REALITY_P5 0x0100 | ||
144 | |||
145 | #define USB_VENDOR_ID_EZKEY 0x0518 | ||
146 | #define USB_DEVICE_ID_BTC_8193 0x0002 | ||
147 | |||
148 | #define USB_VENDOR_ID_GAMERON 0x0810 | ||
149 | #define USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR 0x0001 | ||
150 | |||
151 | #define USB_VENDOR_ID_GENERAL_TOUCH 0x0dfc | ||
152 | |||
153 | #define USB_VENDOR_ID_GLAB 0x06c2 | ||
154 | #define USB_DEVICE_ID_4_PHIDGETSERVO_30 0x0038 | ||
155 | #define USB_DEVICE_ID_1_PHIDGETSERVO_30 0x0039 | ||
156 | #define USB_DEVICE_ID_0_0_4_IF_KIT 0x0040 | ||
157 | #define USB_DEVICE_ID_0_16_16_IF_KIT 0x0044 | ||
158 | #define USB_DEVICE_ID_8_8_8_IF_KIT 0x0045 | ||
159 | #define USB_DEVICE_ID_0_8_7_IF_KIT 0x0051 | ||
160 | #define USB_DEVICE_ID_0_8_8_IF_KIT 0x0053 | ||
161 | #define USB_DEVICE_ID_PHIDGET_MOTORCONTROL 0x0058 | ||
162 | |||
163 | #define USB_VENDOR_ID_GOTOP 0x08f2 | ||
164 | #define USB_DEVICE_ID_SUPER_Q2 0x007f | ||
165 | #define USB_DEVICE_ID_GOGOPEN 0x00ce | ||
166 | #define USB_DEVICE_ID_PENPOWER 0x00f4 | ||
167 | |||
168 | #define USB_VENDOR_ID_GRETAGMACBETH 0x0971 | ||
169 | #define USB_DEVICE_ID_GRETAGMACBETH_HUEY 0x2005 | ||
170 | |||
171 | #define USB_VENDOR_ID_GRIFFIN 0x077d | ||
172 | #define USB_DEVICE_ID_POWERMATE 0x0410 | ||
173 | #define USB_DEVICE_ID_SOUNDKNOB 0x04AA | ||
174 | |||
175 | #define USB_VENDOR_ID_GTCO 0x078c | ||
176 | #define USB_DEVICE_ID_GTCO_90 0x0090 | ||
177 | #define USB_DEVICE_ID_GTCO_100 0x0100 | ||
178 | #define USB_DEVICE_ID_GTCO_101 0x0101 | ||
179 | #define USB_DEVICE_ID_GTCO_103 0x0103 | ||
180 | #define USB_DEVICE_ID_GTCO_104 0x0104 | ||
181 | #define USB_DEVICE_ID_GTCO_105 0x0105 | ||
182 | #define USB_DEVICE_ID_GTCO_106 0x0106 | ||
183 | #define USB_DEVICE_ID_GTCO_107 0x0107 | ||
184 | #define USB_DEVICE_ID_GTCO_108 0x0108 | ||
185 | #define USB_DEVICE_ID_GTCO_200 0x0200 | ||
186 | #define USB_DEVICE_ID_GTCO_201 0x0201 | ||
187 | #define USB_DEVICE_ID_GTCO_202 0x0202 | ||
188 | #define USB_DEVICE_ID_GTCO_203 0x0203 | ||
189 | #define USB_DEVICE_ID_GTCO_204 0x0204 | ||
190 | #define USB_DEVICE_ID_GTCO_205 0x0205 | ||
191 | #define USB_DEVICE_ID_GTCO_206 0x0206 | ||
192 | #define USB_DEVICE_ID_GTCO_207 0x0207 | ||
193 | #define USB_DEVICE_ID_GTCO_300 0x0300 | ||
194 | #define USB_DEVICE_ID_GTCO_301 0x0301 | ||
195 | #define USB_DEVICE_ID_GTCO_302 0x0302 | ||
196 | #define USB_DEVICE_ID_GTCO_303 0x0303 | ||
197 | #define USB_DEVICE_ID_GTCO_304 0x0304 | ||
198 | #define USB_DEVICE_ID_GTCO_305 0x0305 | ||
199 | #define USB_DEVICE_ID_GTCO_306 0x0306 | ||
200 | #define USB_DEVICE_ID_GTCO_307 0x0307 | ||
201 | #define USB_DEVICE_ID_GTCO_308 0x0308 | ||
202 | #define USB_DEVICE_ID_GTCO_309 0x0309 | ||
203 | #define USB_DEVICE_ID_GTCO_400 0x0400 | ||
204 | #define USB_DEVICE_ID_GTCO_401 0x0401 | ||
205 | #define USB_DEVICE_ID_GTCO_402 0x0402 | ||
206 | #define USB_DEVICE_ID_GTCO_403 0x0403 | ||
207 | #define USB_DEVICE_ID_GTCO_404 0x0404 | ||
208 | #define USB_DEVICE_ID_GTCO_405 0x0405 | ||
209 | #define USB_DEVICE_ID_GTCO_500 0x0500 | ||
210 | #define USB_DEVICE_ID_GTCO_501 0x0501 | ||
211 | #define USB_DEVICE_ID_GTCO_502 0x0502 | ||
212 | #define USB_DEVICE_ID_GTCO_503 0x0503 | ||
213 | #define USB_DEVICE_ID_GTCO_504 0x0504 | ||
214 | #define USB_DEVICE_ID_GTCO_1000 0x1000 | ||
215 | #define USB_DEVICE_ID_GTCO_1001 0x1001 | ||
216 | #define USB_DEVICE_ID_GTCO_1002 0x1002 | ||
217 | #define USB_DEVICE_ID_GTCO_1003 0x1003 | ||
218 | #define USB_DEVICE_ID_GTCO_1004 0x1004 | ||
219 | #define USB_DEVICE_ID_GTCO_1005 0x1005 | ||
220 | #define USB_DEVICE_ID_GTCO_1006 0x1006 | ||
221 | #define USB_DEVICE_ID_GTCO_1007 0x1007 | ||
222 | #define USB_VENDOR_ID_HAPP 0x078b | ||
223 | #define USB_DEVICE_ID_UGCI_DRIVING 0x0010 | ||
224 | #define USB_DEVICE_ID_UGCI_FLYING 0x0020 | ||
225 | #define USB_DEVICE_ID_UGCI_FIGHTING 0x0030 | ||
226 | |||
227 | #define USB_VENDOR_ID_IMATION 0x0718 | ||
228 | #define USB_DEVICE_ID_DISC_STAKKA 0xd000 | ||
229 | |||
230 | #define USB_VENDOR_ID_KBGEAR 0x084e | ||
231 | #define USB_DEVICE_ID_KBGEAR_JAMSTUDIO 0x1001 | ||
232 | |||
233 | #define USB_VENDOR_ID_LD 0x0f11 | ||
234 | #define USB_DEVICE_ID_LD_CASSY 0x1000 | ||
235 | #define USB_DEVICE_ID_LD_POCKETCASSY 0x1010 | ||
236 | #define USB_DEVICE_ID_LD_MOBILECASSY 0x1020 | ||
237 | #define USB_DEVICE_ID_LD_JWM 0x1080 | ||
238 | #define USB_DEVICE_ID_LD_DMMP 0x1081 | ||
239 | #define USB_DEVICE_ID_LD_UMIP 0x1090 | ||
240 | #define USB_DEVICE_ID_LD_XRAY1 0x1100 | ||
241 | #define USB_DEVICE_ID_LD_XRAY2 0x1101 | ||
242 | #define USB_DEVICE_ID_LD_VIDEOCOM 0x1200 | ||
243 | #define USB_DEVICE_ID_LD_COM3LAB 0x2000 | ||
244 | #define USB_DEVICE_ID_LD_TELEPORT 0x2010 | ||
245 | #define USB_DEVICE_ID_LD_NETWORKANALYSER 0x2020 | ||
246 | #define USB_DEVICE_ID_LD_POWERCONTROL 0x2030 | ||
247 | #define USB_DEVICE_ID_LD_MACHINETEST 0x2040 | ||
248 | |||
249 | #define USB_VENDOR_ID_LOGITECH 0x046d | ||
250 | #define USB_DEVICE_ID_LOGITECH_LX3 0xc044 | ||
251 | #define USB_DEVICE_ID_LOGITECH_V150 0xc047 | ||
252 | #define USB_DEVICE_ID_LOGITECH_RECEIVER 0xc101 | ||
253 | #define USB_DEVICE_ID_LOGITECH_HARMONY 0xc110 | ||
254 | #define USB_DEVICE_ID_LOGITECH_HARMONY_2 0xc111 | ||
255 | #define USB_DEVICE_ID_LOGITECH_HARMONY_3 0xc112 | ||
256 | #define USB_DEVICE_ID_LOGITECH_HARMONY_4 0xc113 | ||
257 | #define USB_DEVICE_ID_LOGITECH_HARMONY_5 0xc114 | ||
258 | #define USB_DEVICE_ID_LOGITECH_HARMONY_6 0xc115 | ||
259 | #define USB_DEVICE_ID_LOGITECH_HARMONY_7 0xc116 | ||
260 | #define USB_DEVICE_ID_LOGITECH_HARMONY_8 0xc117 | ||
261 | #define USB_DEVICE_ID_LOGITECH_HARMONY_9 0xc118 | ||
262 | #define USB_DEVICE_ID_LOGITECH_HARMONY_10 0xc119 | ||
263 | #define USB_DEVICE_ID_LOGITECH_HARMONY_11 0xc11a | ||
264 | #define USB_DEVICE_ID_LOGITECH_HARMONY_12 0xc11b | ||
265 | #define USB_DEVICE_ID_LOGITECH_HARMONY_13 0xc11c | ||
266 | #define USB_DEVICE_ID_LOGITECH_HARMONY_14 0xc11d | ||
267 | #define USB_DEVICE_ID_LOGITECH_HARMONY_15 0xc11e | ||
268 | #define USB_DEVICE_ID_LOGITECH_HARMONY_16 0xc11f | ||
269 | #define USB_DEVICE_ID_LOGITECH_HARMONY_17 0xc120 | ||
270 | #define USB_DEVICE_ID_LOGITECH_HARMONY_18 0xc121 | ||
271 | #define USB_DEVICE_ID_LOGITECH_HARMONY_19 0xc122 | ||
272 | #define USB_DEVICE_ID_LOGITECH_HARMONY_20 0xc123 | ||
273 | #define USB_DEVICE_ID_LOGITECH_HARMONY_21 0xc124 | ||
274 | #define USB_DEVICE_ID_LOGITECH_HARMONY_22 0xc125 | ||
275 | #define USB_DEVICE_ID_LOGITECH_HARMONY_23 0xc126 | ||
276 | #define USB_DEVICE_ID_LOGITECH_HARMONY_24 0xc127 | ||
277 | #define USB_DEVICE_ID_LOGITECH_HARMONY_25 0xc128 | ||
278 | #define USB_DEVICE_ID_LOGITECH_HARMONY_26 0xc129 | ||
279 | #define USB_DEVICE_ID_LOGITECH_HARMONY_27 0xc12a | ||
280 | #define USB_DEVICE_ID_LOGITECH_HARMONY_28 0xc12b | ||
281 | #define USB_DEVICE_ID_LOGITECH_HARMONY_29 0xc12c | ||
282 | #define USB_DEVICE_ID_LOGITECH_HARMONY_30 0xc12d | ||
283 | #define USB_DEVICE_ID_LOGITECH_HARMONY_31 0xc12e | ||
284 | #define USB_DEVICE_ID_LOGITECH_HARMONY_32 0xc12f | ||
285 | #define USB_DEVICE_ID_LOGITECH_HARMONY_33 0xc130 | ||
286 | #define USB_DEVICE_ID_LOGITECH_HARMONY_34 0xc131 | ||
287 | #define USB_DEVICE_ID_LOGITECH_HARMONY_35 0xc132 | ||
288 | #define USB_DEVICE_ID_LOGITECH_HARMONY_36 0xc133 | ||
289 | #define USB_DEVICE_ID_LOGITECH_HARMONY_37 0xc134 | ||
290 | #define USB_DEVICE_ID_LOGITECH_HARMONY_38 0xc135 | ||
291 | #define USB_DEVICE_ID_LOGITECH_HARMONY_39 0xc136 | ||
292 | #define USB_DEVICE_ID_LOGITECH_HARMONY_40 0xc137 | ||
293 | #define USB_DEVICE_ID_LOGITECH_HARMONY_41 0xc138 | ||
294 | #define USB_DEVICE_ID_LOGITECH_HARMONY_42 0xc139 | ||
295 | #define USB_DEVICE_ID_LOGITECH_HARMONY_43 0xc13a | ||
296 | #define USB_DEVICE_ID_LOGITECH_HARMONY_44 0xc13b | ||
297 | #define USB_DEVICE_ID_LOGITECH_HARMONY_45 0xc13c | ||
298 | #define USB_DEVICE_ID_LOGITECH_HARMONY_46 0xc13d | ||
299 | #define USB_DEVICE_ID_LOGITECH_HARMONY_47 0xc13e | ||
300 | #define USB_DEVICE_ID_LOGITECH_HARMONY_48 0xc13f | ||
301 | #define USB_DEVICE_ID_LOGITECH_HARMONY_49 0xc140 | ||
302 | #define USB_DEVICE_ID_LOGITECH_HARMONY_50 0xc141 | ||
303 | #define USB_DEVICE_ID_LOGITECH_HARMONY_51 0xc142 | ||
304 | #define USB_DEVICE_ID_LOGITECH_HARMONY_52 0xc143 | ||
305 | #define USB_DEVICE_ID_LOGITECH_HARMONY_53 0xc144 | ||
306 | #define USB_DEVICE_ID_LOGITECH_HARMONY_54 0xc145 | ||
307 | #define USB_DEVICE_ID_LOGITECH_HARMONY_55 0xc146 | ||
308 | #define USB_DEVICE_ID_LOGITECH_HARMONY_56 0xc147 | ||
309 | #define USB_DEVICE_ID_LOGITECH_HARMONY_57 0xc148 | ||
310 | #define USB_DEVICE_ID_LOGITECH_HARMONY_58 0xc149 | ||
311 | #define USB_DEVICE_ID_LOGITECH_HARMONY_59 0xc14a | ||
312 | #define USB_DEVICE_ID_LOGITECH_HARMONY_60 0xc14b | ||
313 | #define USB_DEVICE_ID_LOGITECH_HARMONY_61 0xc14c | ||
314 | #define USB_DEVICE_ID_LOGITECH_HARMONY_62 0xc14d | ||
315 | #define USB_DEVICE_ID_LOGITECH_HARMONY_63 0xc14e | ||
316 | #define USB_DEVICE_ID_LOGITECH_HARMONY_64 0xc14f | ||
317 | #define USB_DEVICE_ID_LOGITECH_EXTREME_3D 0xc215 | ||
318 | #define USB_DEVICE_ID_LOGITECH_WHEEL 0xc294 | ||
319 | #define USB_DEVICE_ID_LOGITECH_ELITE_KBD 0xc30a | ||
320 | #define USB_DEVICE_ID_LOGITECH_KBD 0xc311 | ||
321 | #define USB_DEVICE_ID_S510_RECEIVER 0xc50c | ||
322 | #define USB_DEVICE_ID_S510_RECEIVER_2 0xc517 | ||
323 | #define USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500 0xc512 | ||
324 | #define USB_DEVICE_ID_MX3000_RECEIVER 0xc513 | ||
325 | #define USB_DEVICE_ID_DINOVO_DESKTOP 0xc704 | ||
326 | #define USB_DEVICE_ID_DINOVO_EDGE 0xc714 | ||
327 | #define USB_DEVICE_ID_DINOVO_MINI 0xc71f | ||
328 | |||
329 | #define USB_VENDOR_ID_MCC 0x09db | ||
330 | #define USB_DEVICE_ID_MCC_PMD1024LS 0x0076 | ||
331 | #define USB_DEVICE_ID_MCC_PMD1208LS 0x007a | ||
332 | |||
333 | #define USB_VENDOR_ID_MGE 0x0463 | ||
334 | #define USB_DEVICE_ID_MGE_UPS 0xffff | ||
335 | #define USB_DEVICE_ID_MGE_UPS1 0x0001 | ||
336 | |||
337 | #define USB_VENDOR_ID_MICROCHIP 0x04d8 | ||
338 | #define USB_DEVICE_ID_PICKIT1 0x0032 | ||
339 | #define USB_DEVICE_ID_PICKIT2 0x0033 | ||
340 | |||
341 | #define USB_VENDOR_ID_MICROSOFT 0x045e | ||
342 | #define USB_DEVICE_ID_SIDEWINDER_GV 0x003b | ||
343 | #define USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0 0x009d | ||
344 | #define USB_DEVICE_ID_DESKTOP_RECV_1028 0x00f9 | ||
345 | #define USB_DEVICE_ID_MS_NE4K 0x00db | ||
346 | #define USB_DEVICE_ID_MS_LK6K 0x00f9 | ||
347 | |||
348 | #define USB_VENDOR_ID_MONTEREY 0x0566 | ||
349 | #define USB_DEVICE_ID_GENIUS_KB29E 0x3004 | ||
350 | |||
351 | #define USB_VENDOR_ID_NCR 0x0404 | ||
352 | #define USB_DEVICE_ID_NCR_FIRST 0x0300 | ||
353 | #define USB_DEVICE_ID_NCR_LAST 0x03ff | ||
354 | |||
355 | #define USB_VENDOR_ID_NATIONAL_SEMICONDUCTOR 0x0400 | ||
356 | #define USB_DEVICE_ID_N_S_HARMONY 0xc359 | ||
357 | |||
358 | #define USB_VENDOR_ID_NATSU 0x08b7 | ||
359 | #define USB_DEVICE_ID_NATSU_GAMEPAD 0x0001 | ||
360 | |||
361 | #define USB_VENDOR_ID_NEC 0x073e | ||
362 | #define USB_DEVICE_ID_NEC_USB_GAME_PAD 0x0301 | ||
363 | |||
364 | #define USB_VENDOR_ID_ONTRAK 0x0a07 | ||
365 | #define USB_DEVICE_ID_ONTRAK_ADU100 0x0064 | ||
366 | |||
367 | #define USB_VENDOR_ID_PANJIT 0x134c | ||
368 | |||
369 | #define USB_VENDOR_ID_PANTHERLORD 0x0810 | ||
370 | #define USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK 0x0001 | ||
371 | |||
372 | #define USB_VENDOR_ID_PETALYNX 0x18b1 | ||
373 | #define USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE 0x0037 | ||
374 | |||
375 | #define USB_VENDOR_ID_PLAYDOTCOM 0x0b43 | ||
376 | #define USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII 0x0003 | ||
377 | |||
378 | #define USB_VENDOR_ID_SAITEK 0x06a3 | ||
379 | #define USB_DEVICE_ID_SAITEK_RUMBLEPAD 0xff17 | ||
380 | |||
381 | #define USB_VENDOR_ID_SAMSUNG 0x0419 | ||
382 | #define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001 | ||
383 | |||
384 | #define USB_VENDOR_ID_SONY 0x054c | ||
385 | #define USB_DEVICE_ID_SONY_PS3_CONTROLLER 0x0268 | ||
386 | |||
387 | #define USB_VENDOR_ID_SOUNDGRAPH 0x15c2 | ||
388 | #define USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD 0x0038 | ||
389 | |||
390 | #define USB_VENDOR_ID_SUN 0x0430 | ||
391 | #define USB_DEVICE_ID_RARITAN_KVM_DONGLE 0xcdab | ||
392 | |||
393 | #define USB_VENDOR_ID_SUNPLUS 0x04fc | ||
394 | #define USB_DEVICE_ID_SUNPLUS_WDESKTOP 0x05d8 | ||
395 | |||
396 | #define USB_VENDOR_ID_TOPMAX 0x0663 | ||
397 | #define USB_DEVICE_ID_TOPMAX_COBRAPAD 0x0103 | ||
398 | |||
399 | #define USB_VENDOR_ID_TURBOX 0x062a | ||
400 | #define USB_DEVICE_ID_TURBOX_KEYBOARD 0x0201 | ||
401 | |||
402 | #define USB_VENDOR_ID_VERNIER 0x08f7 | ||
403 | #define USB_DEVICE_ID_VERNIER_LABPRO 0x0001 | ||
404 | #define USB_DEVICE_ID_VERNIER_GOTEMP 0x0002 | ||
405 | #define USB_DEVICE_ID_VERNIER_SKIP 0x0003 | ||
406 | #define USB_DEVICE_ID_VERNIER_CYCLOPS 0x0004 | ||
407 | #define USB_DEVICE_ID_VERNIER_LCSPEC 0x0006 | ||
408 | |||
409 | #define USB_VENDOR_ID_WACOM 0x056a | ||
410 | |||
411 | #define USB_VENDOR_ID_WISEGROUP 0x0925 | ||
412 | #define USB_DEVICE_ID_1_PHIDGETSERVO_20 0x8101 | ||
413 | #define USB_DEVICE_ID_4_PHIDGETSERVO_20 0x8104 | ||
414 | #define USB_DEVICE_ID_8_8_4_IF_KIT 0x8201 | ||
415 | #define USB_DEVICE_ID_QUAD_USB_JOYPAD 0x8800 | ||
416 | #define USB_DEVICE_ID_DUAL_USB_JOYPAD 0x8866 | ||
417 | |||
418 | #define USB_VENDOR_ID_WISEGROUP_LTD 0x6677 | ||
419 | #define USB_DEVICE_ID_SMARTJOY_DUAL_PLUS 0x8802 | ||
420 | |||
421 | #define USB_VENDOR_ID_YEALINK 0x6993 | ||
422 | #define USB_DEVICE_ID_YEALINK_P1K_P4K_B2K 0xb001 | ||
423 | |||
424 | #define USB_VENDOR_ID_KYE 0x0458 | ||
425 | #define USB_DEVICE_ID_KYE_GPEN_560 0x5003 | ||
426 | 21 | ||
427 | /* | 22 | /* |
428 | * Alphabetically sorted blacklist by quirk type. | 23 | * Alphabetically sorted blacklist by quirk type. |
@@ -433,18 +28,10 @@ static const struct hid_blacklist { | |||
433 | __u16 idProduct; | 28 | __u16 idProduct; |
434 | __u32 quirks; | 29 | __u32 quirks; |
435 | } hid_blacklist[] = { | 30 | } hid_blacklist[] = { |
436 | |||
437 | { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, | ||
438 | { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D, HID_QUIRK_2WHEEL_MOUSE_HACK_B8 }, | ||
439 | { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE, HID_QUIRK_2WHEEL_MOUSE_HACK_5 }, | ||
440 | |||
441 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RECEIVER, HID_QUIRK_BAD_RELATIVE_KEYS }, | ||
442 | |||
443 | { USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_GAMEPAD, HID_QUIRK_BADPAD }, | 31 | { USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_GAMEPAD, HID_QUIRK_BADPAD }, |
444 | { USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_PREDATOR, HID_QUIRK_BADPAD }, | 32 | { USB_VENDOR_ID_AASHIMA, USB_DEVICE_ID_AASHIMA_PREDATOR, HID_QUIRK_BADPAD }, |
445 | { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD }, | 33 | { USB_VENDOR_ID_ALPS, USB_DEVICE_ID_IBM_GAMEPAD, HID_QUIRK_BADPAD }, |
446 | { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD }, | 34 | { USB_VENDOR_ID_CHIC, USB_DEVICE_ID_CHIC_GAMEPAD, HID_QUIRK_BADPAD }, |
447 | { USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR, HID_QUIRK_MULTI_INPUT }, | ||
448 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 35 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |
449 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 36 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |
450 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, | 37 | { USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING, HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT }, |
@@ -453,169 +40,11 @@ static const struct hid_blacklist { | |||
453 | { USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD, HID_QUIRK_BADPAD }, | 40 | { USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD, HID_QUIRK_BADPAD }, |
454 | { USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD, HID_QUIRK_BADPAD }, | 41 | { USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD, HID_QUIRK_BADPAD }, |
455 | 42 | ||
456 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_DESKTOP, HID_QUIRK_DUPLICATE_USAGES }, | ||
457 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_EDGE, HID_QUIRK_DUPLICATE_USAGES }, | ||
458 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_MINI, HID_QUIRK_DUPLICATE_USAGES }, | ||
459 | |||
460 | { USB_VENDOR_ID_AFATECH, USB_DEVICE_ID_AFATECH_AF9016, HID_QUIRK_FULLSPEED_INTERVAL }, | 43 | { USB_VENDOR_ID_AFATECH, USB_DEVICE_ID_AFATECH_AF9016, HID_QUIRK_FULLSPEED_INTERVAL }, |
461 | 44 | ||
462 | { USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM, HID_QUIRK_HIDDEV }, | ||
463 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4, HID_QUIRK_HIDDEV | HID_QUIRK_IGNORE_HIDINPUT }, | ||
464 | { USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE, HID_QUIRK_HIDDEV | HID_QUIRK_IGNORE_HIDINPUT }, | ||
465 | { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV, HID_QUIRK_HIDINPUT }, | ||
466 | |||
467 | { USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193, HID_QUIRK_HWHEEL_WHEEL_INVERT }, | ||
468 | |||
469 | { USB_VENDOR_ID_ADS_TECH, USB_DEVICE_ID_ADS_TECH_RADIO_SI470X, HID_QUIRK_IGNORE }, | ||
470 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_01, HID_QUIRK_IGNORE }, | ||
471 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_10, HID_QUIRK_IGNORE }, | ||
472 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_20, HID_QUIRK_IGNORE }, | ||
473 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_21, HID_QUIRK_IGNORE }, | ||
474 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_22, HID_QUIRK_IGNORE }, | ||
475 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_23, HID_QUIRK_IGNORE }, | ||
476 | { USB_VENDOR_ID_AIPTEK, USB_DEVICE_ID_AIPTEK_24, HID_QUIRK_IGNORE }, | ||
477 | { USB_VENDOR_ID_AIRCABLE, USB_DEVICE_ID_AIRCABLE1, HID_QUIRK_IGNORE }, | ||
478 | { USB_VENDOR_ID_ALCOR, USB_DEVICE_ID_ALCOR_USBRS232, HID_QUIRK_IGNORE }, | ||
479 | { USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_LCM, HID_QUIRK_IGNORE}, | ||
480 | { USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD, HID_QUIRK_IGNORE }, | ||
481 | { USB_VENDOR_ID_CIDC, 0x0103, HID_QUIRK_IGNORE }, | ||
482 | { USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI470X, HID_QUIRK_IGNORE }, | ||
483 | { USB_VENDOR_ID_CMEDIA, USB_DEVICE_ID_CM109, HID_QUIRK_IGNORE }, | ||
484 | { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_HIDCOM, HID_QUIRK_IGNORE }, | ||
485 | { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_ULTRAMOUSE, HID_QUIRK_IGNORE }, | ||
486 | { USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE, HID_QUIRK_IGNORE }, | ||
487 | { USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20, HID_QUIRK_IGNORE }, | ||
488 | { USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5, HID_QUIRK_IGNORE }, | ||
489 | { USB_VENDOR_ID_GENERAL_TOUCH, 0x0001, HID_QUIRK_IGNORE }, | ||
490 | { USB_VENDOR_ID_GENERAL_TOUCH, 0x0002, HID_QUIRK_IGNORE }, | ||
491 | { USB_VENDOR_ID_GENERAL_TOUCH, 0x0003, HID_QUIRK_IGNORE }, | ||
492 | { USB_VENDOR_ID_GENERAL_TOUCH, 0x0004, HID_QUIRK_IGNORE }, | ||
493 | { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_4_PHIDGETSERVO_30, HID_QUIRK_IGNORE }, | ||
494 | { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_1_PHIDGETSERVO_30, HID_QUIRK_IGNORE }, | ||
495 | { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_0_4_IF_KIT, HID_QUIRK_IGNORE }, | ||
496 | { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_16_16_IF_KIT, HID_QUIRK_IGNORE }, | ||
497 | { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_8_8_8_IF_KIT, HID_QUIRK_IGNORE }, | ||
498 | { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_8_7_IF_KIT, HID_QUIRK_IGNORE }, | ||
499 | { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_0_8_8_IF_KIT, HID_QUIRK_IGNORE }, | ||
500 | { USB_VENDOR_ID_GLAB, USB_DEVICE_ID_PHIDGET_MOTORCONTROL, HID_QUIRK_IGNORE }, | ||
501 | { USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_SUPER_Q2, HID_QUIRK_IGNORE }, | ||
502 | { USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_GOGOPEN, HID_QUIRK_IGNORE }, | ||
503 | { USB_VENDOR_ID_GOTOP, USB_DEVICE_ID_PENPOWER, HID_QUIRK_IGNORE }, | ||
504 | { USB_VENDOR_ID_GRETAGMACBETH, USB_DEVICE_ID_GRETAGMACBETH_HUEY, HID_QUIRK_IGNORE }, | ||
505 | { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_POWERMATE, HID_QUIRK_IGNORE }, | ||
506 | { USB_VENDOR_ID_GRIFFIN, USB_DEVICE_ID_SOUNDKNOB, HID_QUIRK_IGNORE }, | ||
507 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_90, HID_QUIRK_IGNORE }, | ||
508 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_100, HID_QUIRK_IGNORE }, | ||
509 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_101, HID_QUIRK_IGNORE }, | ||
510 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_103, HID_QUIRK_IGNORE }, | ||
511 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_104, HID_QUIRK_IGNORE }, | ||
512 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_105, HID_QUIRK_IGNORE }, | ||
513 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_106, HID_QUIRK_IGNORE }, | ||
514 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_107, HID_QUIRK_IGNORE }, | ||
515 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_108, HID_QUIRK_IGNORE }, | ||
516 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_200, HID_QUIRK_IGNORE }, | ||
517 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_201, HID_QUIRK_IGNORE }, | ||
518 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_202, HID_QUIRK_IGNORE }, | ||
519 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_203, HID_QUIRK_IGNORE }, | ||
520 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_204, HID_QUIRK_IGNORE }, | ||
521 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_205, HID_QUIRK_IGNORE }, | ||
522 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_206, HID_QUIRK_IGNORE }, | ||
523 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_207, HID_QUIRK_IGNORE }, | ||
524 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_300, HID_QUIRK_IGNORE }, | ||
525 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_301, HID_QUIRK_IGNORE }, | ||
526 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_302, HID_QUIRK_IGNORE }, | ||
527 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_303, HID_QUIRK_IGNORE }, | ||
528 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_304, HID_QUIRK_IGNORE }, | ||
529 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_305, HID_QUIRK_IGNORE }, | ||
530 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_306, HID_QUIRK_IGNORE }, | ||
531 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_307, HID_QUIRK_IGNORE }, | ||
532 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_308, HID_QUIRK_IGNORE }, | ||
533 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_309, HID_QUIRK_IGNORE }, | ||
534 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_400, HID_QUIRK_IGNORE }, | ||
535 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_401, HID_QUIRK_IGNORE }, | ||
536 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_402, HID_QUIRK_IGNORE }, | ||
537 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_403, HID_QUIRK_IGNORE }, | ||
538 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_404, HID_QUIRK_IGNORE }, | ||
539 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_405, HID_QUIRK_IGNORE }, | ||
540 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_500, HID_QUIRK_IGNORE }, | ||
541 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_501, HID_QUIRK_IGNORE }, | ||
542 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_502, HID_QUIRK_IGNORE }, | ||
543 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_503, HID_QUIRK_IGNORE }, | ||
544 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_504, HID_QUIRK_IGNORE }, | ||
545 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1000, HID_QUIRK_IGNORE }, | ||
546 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1001, HID_QUIRK_IGNORE }, | ||
547 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1002, HID_QUIRK_IGNORE }, | ||
548 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1003, HID_QUIRK_IGNORE }, | ||
549 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1004, HID_QUIRK_IGNORE }, | ||
550 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1005, HID_QUIRK_IGNORE }, | ||
551 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1006, HID_QUIRK_IGNORE }, | ||
552 | { USB_VENDOR_ID_GTCO, USB_DEVICE_ID_GTCO_1007, HID_QUIRK_IGNORE }, | ||
553 | { USB_VENDOR_ID_IMATION, USB_DEVICE_ID_DISC_STAKKA, HID_QUIRK_IGNORE }, | ||
554 | { USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE }, | ||
555 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY, HID_QUIRK_IGNORE }, | ||
556 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY, HID_QUIRK_IGNORE }, | ||
557 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MOBILECASSY, HID_QUIRK_IGNORE }, | ||
558 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_JWM, HID_QUIRK_IGNORE }, | ||
559 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_DMMP, HID_QUIRK_IGNORE }, | ||
560 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_UMIP, HID_QUIRK_IGNORE }, | ||
561 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_XRAY1, HID_QUIRK_IGNORE }, | ||
562 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_XRAY2, HID_QUIRK_IGNORE }, | ||
563 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_VIDEOCOM, HID_QUIRK_IGNORE }, | ||
564 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_COM3LAB, HID_QUIRK_IGNORE }, | ||
565 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_TELEPORT, HID_QUIRK_IGNORE }, | ||
566 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_NETWORKANALYSER, HID_QUIRK_IGNORE }, | ||
567 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POWERCONTROL, HID_QUIRK_IGNORE }, | ||
568 | { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_MACHINETEST, HID_QUIRK_IGNORE }, | ||
569 | { USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1024LS, HID_QUIRK_IGNORE }, | ||
570 | { USB_VENDOR_ID_MCC, USB_DEVICE_ID_MCC_PMD1208LS, HID_QUIRK_IGNORE }, | ||
571 | { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_IGNORE }, | ||
572 | { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS1, HID_QUIRK_IGNORE }, | ||
573 | { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100, HID_QUIRK_IGNORE }, | ||
574 | { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 20, HID_QUIRK_IGNORE }, | ||
575 | { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 30, HID_QUIRK_IGNORE }, | ||
576 | { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 100, HID_QUIRK_IGNORE }, | ||
577 | { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 108, HID_QUIRK_IGNORE }, | ||
578 | { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 118, HID_QUIRK_IGNORE }, | ||
579 | { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 200, HID_QUIRK_IGNORE }, | ||
580 | { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 300, HID_QUIRK_IGNORE }, | ||
581 | { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 400, HID_QUIRK_IGNORE }, | ||
582 | { USB_VENDOR_ID_ONTRAK, USB_DEVICE_ID_ONTRAK_ADU100 + 500, HID_QUIRK_IGNORE }, | ||
583 | { USB_VENDOR_ID_PANJIT, 0x0001, HID_QUIRK_IGNORE }, | ||
584 | { USB_VENDOR_ID_PANJIT, 0x0002, HID_QUIRK_IGNORE }, | ||
585 | { USB_VENDOR_ID_PANJIT, 0x0003, HID_QUIRK_IGNORE }, | ||
586 | { USB_VENDOR_ID_PANJIT, 0x0004, HID_QUIRK_IGNORE }, | ||
587 | { USB_VENDOR_ID_SOUNDGRAPH, USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD, HID_QUIRK_IGNORE }, | ||
588 | { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO, HID_QUIRK_IGNORE }, | ||
589 | { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_GOTEMP, HID_QUIRK_IGNORE }, | ||
590 | { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_SKIP, HID_QUIRK_IGNORE }, | ||
591 | { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_CYCLOPS, HID_QUIRK_IGNORE }, | ||
592 | { USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LCSPEC, HID_QUIRK_IGNORE }, | ||
593 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_4_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, | ||
594 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_1_PHIDGETSERVO_20, HID_QUIRK_IGNORE }, | ||
595 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_8_8_4_IF_KIT, HID_QUIRK_IGNORE }, | ||
596 | { USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K, HID_QUIRK_IGNORE }, | ||
597 | |||
598 | { USB_VENDOR_ID_ACECAD, USB_DEVICE_ID_ACECAD_FLAIR, HID_QUIRK_IGNORE }, | ||
599 | { USB_VENDOR_ID_ACECAD, USB_DEVICE_ID_ACECAD_302, HID_QUIRK_IGNORE }, | ||
600 | |||
601 | { USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT1, HID_QUIRK_IGNORE }, | ||
602 | { USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICKIT2, HID_QUIRK_IGNORE }, | ||
603 | |||
604 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_ELITE_KBD, HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL | HID_QUIRK_LOGITECH_EXPANDED_KEYMAP }, | ||
605 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_CORDLESS_DESKTOP_LX500, HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL | HID_QUIRK_LOGITECH_EXPANDED_KEYMAP }, | ||
606 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_LX3, HID_QUIRK_INVERT_HWHEEL }, | ||
607 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_V150, HID_QUIRK_INVERT_HWHEEL }, | ||
608 | |||
609 | { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_NE4K, HID_QUIRK_MICROSOFT_KEYS }, | ||
610 | { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_LK6K, HID_QUIRK_MICROSOFT_KEYS }, | ||
611 | |||
612 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE, HID_QUIRK_MIGHTYMOUSE | HID_QUIRK_INVERT_HWHEEL }, | ||
613 | |||
614 | { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, | 45 | { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, |
615 | { USB_VENDOR_ID_PLAYDOTCOM, USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII, HID_QUIRK_MULTI_INPUT }, | 46 | { USB_VENDOR_ID_PLAYDOTCOM, USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII, HID_QUIRK_MULTI_INPUT }, |
616 | 47 | ||
617 | { USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER, HID_QUIRK_SONY_PS3_CONTROLLER | HID_QUIRK_HIDDEV }, | ||
618 | |||
619 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_UC100KM, HID_QUIRK_NOGET }, | 48 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_UC100KM, HID_QUIRK_NOGET }, |
620 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_CS124U, HID_QUIRK_NOGET }, | 49 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_CS124U, HID_QUIRK_NOGET }, |
621 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET }, | 50 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET }, |
@@ -623,144 +52,13 @@ static const struct hid_blacklist { | |||
623 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET }, | 52 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET }, |
624 | { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, | 53 | { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, |
625 | { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, | 54 | { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, |
626 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_EXTREME_3D, HID_QUIRK_NOGET }, | ||
627 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WHEEL, HID_QUIRK_NOGET }, | ||
628 | { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0, HID_QUIRK_NOGET }, | ||
629 | { USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE, HID_QUIRK_NOGET }, | ||
630 | { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, | 55 | { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, |
631 | { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET }, | 56 | { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET }, |
632 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, | 57 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, |
633 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, | 58 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, |
634 | 59 | ||
635 | { USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, | 60 | { USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, |
636 | 61 | { USB_VENDOR_ID_WISEGROUP_LTD2, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, | |
637 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, | ||
638 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, | ||
639 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, | ||
640 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD}, | ||
641 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, | ||
642 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, | ||
643 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD}, | ||
644 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER3_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, | ||
645 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, | ||
646 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE | HID_QUIRK_APPLE_ISO_KEYBOARD}, | ||
647 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, | ||
648 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ANSI, HID_QUIRK_APPLE_HAS_FN }, | ||
649 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD }, | ||
650 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_JIS, HID_QUIRK_APPLE_HAS_FN }, | ||
651 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, | ||
652 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, | ||
653 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, | ||
654 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN }, | ||
655 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD }, | ||
656 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN }, | ||
657 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, | ||
658 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD | HID_QUIRK_IGNORE_MOUSE}, | ||
659 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING_JIS, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE}, | ||
660 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ANSI, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE}, | ||
661 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_ISO, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_APPLE_ISO_KEYBOARD | HID_QUIRK_IGNORE_MOUSE }, | ||
662 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING2_JIS, HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, | ||
663 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, | ||
664 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY, HID_QUIRK_APPLE_NUMLOCK_EMULATION | HID_QUIRK_APPLE_HAS_FN | HID_QUIRK_IGNORE_MOUSE }, | ||
665 | |||
666 | { USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_W7658, HID_QUIRK_RESET_LEDS }, | ||
667 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_KBD, HID_QUIRK_RESET_LEDS }, | ||
668 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY, HID_QUIRK_IGNORE }, | ||
669 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_2, HID_QUIRK_IGNORE }, | ||
670 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_3, HID_QUIRK_IGNORE }, | ||
671 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_4, HID_QUIRK_IGNORE }, | ||
672 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_5, HID_QUIRK_IGNORE }, | ||
673 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_6, HID_QUIRK_IGNORE }, | ||
674 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_7, HID_QUIRK_IGNORE }, | ||
675 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_8, HID_QUIRK_IGNORE }, | ||
676 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_9, HID_QUIRK_IGNORE }, | ||
677 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_10, HID_QUIRK_IGNORE }, | ||
678 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_11, HID_QUIRK_IGNORE }, | ||
679 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_12, HID_QUIRK_IGNORE }, | ||
680 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_13, HID_QUIRK_IGNORE }, | ||
681 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_14, HID_QUIRK_IGNORE }, | ||
682 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_15, HID_QUIRK_IGNORE }, | ||
683 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_16, HID_QUIRK_IGNORE }, | ||
684 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_17, HID_QUIRK_IGNORE }, | ||
685 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_18, HID_QUIRK_IGNORE }, | ||
686 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_19, HID_QUIRK_IGNORE }, | ||
687 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_20, HID_QUIRK_IGNORE }, | ||
688 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_21, HID_QUIRK_IGNORE }, | ||
689 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_22, HID_QUIRK_IGNORE }, | ||
690 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_23, HID_QUIRK_IGNORE }, | ||
691 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_24, HID_QUIRK_IGNORE }, | ||
692 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_25, HID_QUIRK_IGNORE }, | ||
693 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_26, HID_QUIRK_IGNORE }, | ||
694 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_27, HID_QUIRK_IGNORE }, | ||
695 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_28, HID_QUIRK_IGNORE }, | ||
696 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_29, HID_QUIRK_IGNORE }, | ||
697 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_30, HID_QUIRK_IGNORE }, | ||
698 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_31, HID_QUIRK_IGNORE }, | ||
699 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_32, HID_QUIRK_IGNORE }, | ||
700 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_33, HID_QUIRK_IGNORE }, | ||
701 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_34, HID_QUIRK_IGNORE }, | ||
702 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_35, HID_QUIRK_IGNORE }, | ||
703 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_36, HID_QUIRK_IGNORE }, | ||
704 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_37, HID_QUIRK_IGNORE }, | ||
705 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_38, HID_QUIRK_IGNORE }, | ||
706 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_39, HID_QUIRK_IGNORE }, | ||
707 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_40, HID_QUIRK_IGNORE }, | ||
708 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_41, HID_QUIRK_IGNORE }, | ||
709 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_42, HID_QUIRK_IGNORE }, | ||
710 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_43, HID_QUIRK_IGNORE }, | ||
711 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_44, HID_QUIRK_IGNORE }, | ||
712 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_45, HID_QUIRK_IGNORE }, | ||
713 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_46, HID_QUIRK_IGNORE }, | ||
714 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_47, HID_QUIRK_IGNORE }, | ||
715 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_48, HID_QUIRK_IGNORE }, | ||
716 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_49, HID_QUIRK_IGNORE }, | ||
717 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_50, HID_QUIRK_IGNORE }, | ||
718 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_51, HID_QUIRK_IGNORE }, | ||
719 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_52, HID_QUIRK_IGNORE }, | ||
720 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_53, HID_QUIRK_IGNORE }, | ||
721 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_54, HID_QUIRK_IGNORE }, | ||
722 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_55, HID_QUIRK_IGNORE }, | ||
723 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_56, HID_QUIRK_IGNORE }, | ||
724 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_57, HID_QUIRK_IGNORE }, | ||
725 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_58, HID_QUIRK_IGNORE }, | ||
726 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_59, HID_QUIRK_IGNORE }, | ||
727 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_60, HID_QUIRK_IGNORE }, | ||
728 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_61, HID_QUIRK_IGNORE }, | ||
729 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_62, HID_QUIRK_IGNORE }, | ||
730 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_63, HID_QUIRK_IGNORE }, | ||
731 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_64, HID_QUIRK_IGNORE }, | ||
732 | { USB_VENDOR_ID_NATIONAL_SEMICONDUCTOR, USB_DEVICE_ID_N_S_HARMONY, HID_QUIRK_IGNORE }, | ||
733 | { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_GPEN_560, HID_QUIRK_IGNORE }, | ||
734 | |||
735 | { 0, 0 } | ||
736 | }; | ||
737 | |||
738 | /* Quirks for devices which require report descriptor fixup go here */ | ||
739 | static const struct hid_rdesc_blacklist { | ||
740 | __u16 idVendor; | ||
741 | __u16 idProduct; | ||
742 | __u32 quirks; | ||
743 | } hid_rdesc_blacklist[] = { | ||
744 | |||
745 | { USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION, HID_QUIRK_RDESC_CYMOTION }, | ||
746 | |||
747 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER, HID_QUIRK_RDESC_LOGITECH }, | ||
748 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER, HID_QUIRK_RDESC_LOGITECH }, | ||
749 | { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER_2, HID_QUIRK_RDESC_LOGITECH }, | ||
750 | { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_DESKTOP_RECV_1028, HID_QUIRK_RDESC_MICROSOFT_RECV_1028 }, | ||
751 | |||
752 | { USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E, HID_QUIRK_RDESC_BUTTON_CONSUMER }, | ||
753 | |||
754 | { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_JIS, HID_QUIRK_RDESC_MACBOOK_JIS }, | ||
755 | |||
756 | { USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE, HID_QUIRK_RDESC_PETALYNX }, | ||
757 | |||
758 | { USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE, HID_QUIRK_RDESC_SAMSUNG_REMOTE }, | ||
759 | |||
760 | { USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP, HID_QUIRK_RDESC_SUNPLUS_WDESKTOP }, | ||
761 | |||
762 | { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1, HID_QUIRK_RDESC_SWAPPED_MIN_MAX }, | ||
763 | { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2, HID_QUIRK_RDESC_SWAPPED_MIN_MAX }, | ||
764 | 62 | ||
765 | { 0, 0 } | 63 | { 0, 0 } |
766 | }; | 64 | }; |
@@ -974,16 +272,6 @@ u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct) | |||
974 | u32 quirks = 0; | 272 | u32 quirks = 0; |
975 | const struct hid_blacklist *bl_entry = NULL; | 273 | const struct hid_blacklist *bl_entry = NULL; |
976 | 274 | ||
977 | /* Ignore all Wacom devices */ | ||
978 | if (idVendor == USB_VENDOR_ID_WACOM) | ||
979 | return HID_QUIRK_IGNORE; | ||
980 | |||
981 | /* ignore all Code Mercenaries IOWarrior devices */ | ||
982 | if (idVendor == USB_VENDOR_ID_CODEMERCS) | ||
983 | if (idProduct >= USB_DEVICE_ID_CODEMERCS_IOW_FIRST && | ||
984 | idProduct <= USB_DEVICE_ID_CODEMERCS_IOW_LAST) | ||
985 | return HID_QUIRK_IGNORE; | ||
986 | |||
987 | /* NCR devices must not be queried for reports */ | 275 | /* NCR devices must not be queried for reports */ |
988 | if (idVendor == USB_VENDOR_ID_NCR && | 276 | if (idVendor == USB_VENDOR_ID_NCR && |
989 | idProduct >= USB_DEVICE_ID_NCR_FIRST && | 277 | idProduct >= USB_DEVICE_ID_NCR_FIRST && |
@@ -1002,221 +290,3 @@ u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct) | |||
1002 | } | 290 | } |
1003 | 291 | ||
1004 | EXPORT_SYMBOL_GPL(usbhid_lookup_quirk); | 292 | EXPORT_SYMBOL_GPL(usbhid_lookup_quirk); |
1005 | |||
1006 | /* | ||
1007 | * Cherry Cymotion keyboard have an invalid HID report descriptor, | ||
1008 | * that needs fixing before we can parse it. | ||
1009 | */ | ||
1010 | static void usbhid_fixup_cymotion_descriptor(char *rdesc, int rsize) | ||
1011 | { | ||
1012 | if (rsize >= 17 && rdesc[11] == 0x3c && rdesc[12] == 0x02) { | ||
1013 | printk(KERN_INFO "Fixing up Cherry Cymotion report descriptor\n"); | ||
1014 | rdesc[11] = rdesc[16] = 0xff; | ||
1015 | rdesc[12] = rdesc[17] = 0x03; | ||
1016 | } | ||
1017 | } | ||
1018 | |||
1019 | |||
1020 | /* | ||
1021 | * Certain Logitech keyboards send in report #3 keys which are far | ||
1022 | * above the logical maximum described in descriptor. This extends | ||
1023 | * the original value of 0x28c of logical maximum to 0x104d | ||
1024 | */ | ||
1025 | static void usbhid_fixup_logitech_descriptor(unsigned char *rdesc, int rsize) | ||
1026 | { | ||
1027 | if (rsize >= 90 && rdesc[83] == 0x26 | ||
1028 | && rdesc[84] == 0x8c | ||
1029 | && rdesc[85] == 0x02) { | ||
1030 | printk(KERN_INFO "Fixing up Logitech keyboard report descriptor\n"); | ||
1031 | rdesc[84] = rdesc[89] = 0x4d; | ||
1032 | rdesc[85] = rdesc[90] = 0x10; | ||
1033 | } | ||
1034 | } | ||
1035 | |||
1036 | static void usbhid_fixup_sunplus_wdesktop(unsigned char *rdesc, int rsize) | ||
1037 | { | ||
1038 | if (rsize >= 107 && rdesc[104] == 0x26 | ||
1039 | && rdesc[105] == 0x80 | ||
1040 | && rdesc[106] == 0x03) { | ||
1041 | printk(KERN_INFO "Fixing up Sunplus Wireless Desktop report descriptor\n"); | ||
1042 | rdesc[105] = rdesc[110] = 0x03; | ||
1043 | rdesc[106] = rdesc[111] = 0x21; | ||
1044 | } | ||
1045 | } | ||
1046 | |||
1047 | /* | ||
1048 | * Samsung IrDA remote controller (reports as Cypress USB Mouse). | ||
1049 | * | ||
1050 | * Vendor specific report #4 has a size of 48 bit, | ||
1051 | * and therefore is not accepted when inspecting the descriptors. | ||
1052 | * As a workaround we reinterpret the report as: | ||
1053 | * Variable type, count 6, size 8 bit, log. maximum 255 | ||
1054 | * The burden to reconstruct the data is moved into user space. | ||
1055 | */ | ||
1056 | static void usbhid_fixup_samsung_irda_descriptor(unsigned char *rdesc, | ||
1057 | int rsize) | ||
1058 | { | ||
1059 | if (rsize >= 182 && rdesc[175] == 0x25 | ||
1060 | && rdesc[176] == 0x40 | ||
1061 | && rdesc[177] == 0x75 | ||
1062 | && rdesc[178] == 0x30 | ||
1063 | && rdesc[179] == 0x95 | ||
1064 | && rdesc[180] == 0x01 | ||
1065 | && rdesc[182] == 0x40) { | ||
1066 | printk(KERN_INFO "Fixing up Samsung IrDA report descriptor\n"); | ||
1067 | rdesc[176] = 0xff; | ||
1068 | rdesc[178] = 0x08; | ||
1069 | rdesc[180] = 0x06; | ||
1070 | rdesc[182] = 0x42; | ||
1071 | } | ||
1072 | } | ||
1073 | |||
1074 | /* Petalynx Maxter Remote has maximum for consumer page set too low */ | ||
1075 | static void usbhid_fixup_petalynx_descriptor(unsigned char *rdesc, int rsize) | ||
1076 | { | ||
1077 | if (rsize >= 60 && rdesc[39] == 0x2a | ||
1078 | && rdesc[40] == 0xf5 | ||
1079 | && rdesc[41] == 0x00 | ||
1080 | && rdesc[59] == 0x26 | ||
1081 | && rdesc[60] == 0xf9 | ||
1082 | && rdesc[61] == 0x00) { | ||
1083 | printk(KERN_INFO "Fixing up Petalynx Maxter Remote report descriptor\n"); | ||
1084 | rdesc[60] = 0xfa; | ||
1085 | rdesc[40] = 0xfa; | ||
1086 | } | ||
1087 | } | ||
1088 | |||
1089 | /* | ||
1090 | * Some USB barcode readers from cypress have usage min and usage max in | ||
1091 | * the wrong order | ||
1092 | */ | ||
1093 | static void usbhid_fixup_cypress_descriptor(unsigned char *rdesc, int rsize) | ||
1094 | { | ||
1095 | short fixed = 0; | ||
1096 | int i; | ||
1097 | |||
1098 | for (i = 0; i < rsize - 4; i++) { | ||
1099 | if (rdesc[i] == 0x29 && rdesc [i+2] == 0x19) { | ||
1100 | unsigned char tmp; | ||
1101 | |||
1102 | rdesc[i] = 0x19; rdesc[i+2] = 0x29; | ||
1103 | tmp = rdesc[i+3]; | ||
1104 | rdesc[i+3] = rdesc[i+1]; | ||
1105 | rdesc[i+1] = tmp; | ||
1106 | } | ||
1107 | } | ||
1108 | |||
1109 | if (fixed) | ||
1110 | printk(KERN_INFO "Fixing up Cypress report descriptor\n"); | ||
1111 | } | ||
1112 | |||
1113 | /* | ||
1114 | * MacBook JIS keyboard has wrong logical maximum | ||
1115 | */ | ||
1116 | static void usbhid_fixup_macbook_descriptor(unsigned char *rdesc, int rsize) | ||
1117 | { | ||
1118 | if (rsize >= 60 && rdesc[53] == 0x65 | ||
1119 | && rdesc[59] == 0x65) { | ||
1120 | printk(KERN_INFO "Fixing up MacBook JIS keyboard report descriptor\n"); | ||
1121 | rdesc[53] = rdesc[59] = 0xe7; | ||
1122 | } | ||
1123 | } | ||
1124 | |||
1125 | static void usbhid_fixup_button_consumer_descriptor(unsigned char *rdesc, int rsize) | ||
1126 | { | ||
1127 | if (rsize >= 30 && rdesc[29] == 0x05 | ||
1128 | && rdesc[30] == 0x09) { | ||
1129 | printk(KERN_INFO "Fixing up button/consumer in HID report descriptor\n"); | ||
1130 | rdesc[30] = 0x0c; | ||
1131 | } | ||
1132 | } | ||
1133 | |||
1134 | /* | ||
1135 | * Microsoft Wireless Desktop Receiver (Model 1028) has several | ||
1136 | * 'Usage Min/Max' where it ought to have 'Physical Min/Max' | ||
1137 | */ | ||
1138 | static void usbhid_fixup_microsoft_descriptor(unsigned char *rdesc, int rsize) | ||
1139 | { | ||
1140 | if (rsize == 571 && rdesc[284] == 0x19 | ||
1141 | && rdesc[286] == 0x2a | ||
1142 | && rdesc[304] == 0x19 | ||
1143 | && rdesc[306] == 0x29 | ||
1144 | && rdesc[352] == 0x1a | ||
1145 | && rdesc[355] == 0x2a | ||
1146 | && rdesc[557] == 0x19 | ||
1147 | && rdesc[559] == 0x29) { | ||
1148 | printk(KERN_INFO "Fixing up Microsoft Wireless Receiver Model 1028 report descriptor\n"); | ||
1149 | rdesc[284] = rdesc[304] = rdesc[557] = 0x35; | ||
1150 | rdesc[352] = 0x36; | ||
1151 | rdesc[286] = rdesc[355] = 0x46; | ||
1152 | rdesc[306] = rdesc[559] = 0x45; | ||
1153 | } | ||
1154 | } | ||
1155 | |||
1156 | static void __usbhid_fixup_report_descriptor(__u32 quirks, char *rdesc, unsigned rsize) | ||
1157 | { | ||
1158 | if ((quirks & HID_QUIRK_RDESC_CYMOTION)) | ||
1159 | usbhid_fixup_cymotion_descriptor(rdesc, rsize); | ||
1160 | |||
1161 | if (quirks & HID_QUIRK_RDESC_LOGITECH) | ||
1162 | usbhid_fixup_logitech_descriptor(rdesc, rsize); | ||
1163 | |||
1164 | if (quirks & HID_QUIRK_RDESC_SWAPPED_MIN_MAX) | ||
1165 | usbhid_fixup_cypress_descriptor(rdesc, rsize); | ||
1166 | |||
1167 | if (quirks & HID_QUIRK_RDESC_PETALYNX) | ||
1168 | usbhid_fixup_petalynx_descriptor(rdesc, rsize); | ||
1169 | |||
1170 | if (quirks & HID_QUIRK_RDESC_MACBOOK_JIS) | ||
1171 | usbhid_fixup_macbook_descriptor(rdesc, rsize); | ||
1172 | |||
1173 | if (quirks & HID_QUIRK_RDESC_BUTTON_CONSUMER) | ||
1174 | usbhid_fixup_button_consumer_descriptor(rdesc, rsize); | ||
1175 | |||
1176 | if (quirks & HID_QUIRK_RDESC_SAMSUNG_REMOTE) | ||
1177 | usbhid_fixup_samsung_irda_descriptor(rdesc, rsize); | ||
1178 | |||
1179 | if (quirks & HID_QUIRK_RDESC_MICROSOFT_RECV_1028) | ||
1180 | usbhid_fixup_microsoft_descriptor(rdesc, rsize); | ||
1181 | |||
1182 | if (quirks & HID_QUIRK_RDESC_SUNPLUS_WDESKTOP) | ||
1183 | usbhid_fixup_sunplus_wdesktop(rdesc, rsize); | ||
1184 | } | ||
1185 | |||
1186 | /** | ||
1187 | * usbhid_fixup_report_descriptor: check if report descriptor needs fixup | ||
1188 | * | ||
1189 | * Description: | ||
1190 | * Walks the hid_rdesc_blacklist[] array and checks whether the device | ||
1191 | * is known to have broken report descriptor that needs to be fixed up | ||
1192 | * prior to entering the HID parser | ||
1193 | * | ||
1194 | * Returns: nothing | ||
1195 | */ | ||
1196 | void usbhid_fixup_report_descriptor(const u16 idVendor, const u16 idProduct, | ||
1197 | char *rdesc, unsigned rsize, char **quirks_param) | ||
1198 | { | ||
1199 | int n, m; | ||
1200 | u16 paramVendor, paramProduct; | ||
1201 | u32 quirks; | ||
1202 | |||
1203 | /* static rdesc quirk entries */ | ||
1204 | for (n = 0; hid_rdesc_blacklist[n].idVendor; n++) | ||
1205 | if (hid_rdesc_blacklist[n].idVendor == idVendor && | ||
1206 | hid_rdesc_blacklist[n].idProduct == idProduct) | ||
1207 | __usbhid_fixup_report_descriptor(hid_rdesc_blacklist[n].quirks, | ||
1208 | rdesc, rsize); | ||
1209 | |||
1210 | /* runtime rdesc quirk entries handling */ | ||
1211 | for (n = 0; quirks_param[n] && n < MAX_USBHID_BOOT_QUIRKS; n++) { | ||
1212 | m = sscanf(quirks_param[n], "0x%hx:0x%hx:0x%x", | ||
1213 | ¶mVendor, ¶mProduct, &quirks); | ||
1214 | |||
1215 | if (m != 3) | ||
1216 | printk(KERN_WARNING | ||
1217 | "Could not parse HID quirk module param %s\n", | ||
1218 | quirks_param[n]); | ||
1219 | else if (paramVendor == idVendor && paramProduct == idProduct) | ||
1220 | __usbhid_fixup_report_descriptor(quirks, rdesc, rsize); | ||
1221 | } | ||
1222 | } | ||
diff --git a/drivers/hid/usbhid/hid-tmff.c b/drivers/hid/usbhid/hid-tmff.c deleted file mode 100644 index 144578b1a00c..000000000000 --- a/drivers/hid/usbhid/hid-tmff.c +++ /dev/null | |||
@@ -1,225 +0,0 @@ | |||
1 | /* | ||
2 | * Force feedback support for various HID compliant devices by ThrustMaster: | ||
3 | * ThrustMaster FireStorm Dual Power 2 | ||
4 | * and possibly others whose device ids haven't been added. | ||
5 | * | ||
6 | * Modified to support ThrustMaster devices by Zinx Verituse | ||
7 | * on 2003-01-25 from the Logitech force feedback driver, | ||
8 | * which is by Johann Deneux. | ||
9 | * | ||
10 | * Copyright (c) 2003 Zinx Verituse <zinx@epicsol.org> | ||
11 | * Copyright (c) 2002 Johann Deneux | ||
12 | */ | ||
13 | |||
14 | /* | ||
15 | * This program is free software; you can redistribute it and/or modify | ||
16 | * it under the terms of the GNU General Public License as published by | ||
17 | * the Free Software Foundation; either version 2 of the License, or | ||
18 | * (at your option) any later version. | ||
19 | * | ||
20 | * This program is distributed in the hope that it will be useful, | ||
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
23 | * GNU General Public License for more details. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License | ||
26 | * along with this program; if not, write to the Free Software | ||
27 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
28 | */ | ||
29 | |||
30 | #include <linux/input.h> | ||
31 | |||
32 | #undef DEBUG | ||
33 | #include <linux/usb.h> | ||
34 | |||
35 | #include <linux/hid.h> | ||
36 | #include "usbhid.h" | ||
37 | |||
38 | /* Usages for thrustmaster devices I know about */ | ||
39 | #define THRUSTMASTER_USAGE_FF (HID_UP_GENDESK | 0xbb) | ||
40 | |||
41 | struct dev_type { | ||
42 | u16 idVendor; | ||
43 | u16 idProduct; | ||
44 | const signed short *ff; | ||
45 | }; | ||
46 | |||
47 | static const signed short ff_rumble[] = { | ||
48 | FF_RUMBLE, | ||
49 | -1 | ||
50 | }; | ||
51 | |||
52 | static const signed short ff_joystick[] = { | ||
53 | FF_CONSTANT, | ||
54 | -1 | ||
55 | }; | ||
56 | |||
57 | static const struct dev_type devices[] = { | ||
58 | { 0x44f, 0xb300, ff_rumble }, | ||
59 | { 0x44f, 0xb304, ff_rumble }, | ||
60 | { 0x44f, 0xb651, ff_rumble }, /* FGT Rumble Force Wheel */ | ||
61 | { 0x44f, 0xb654, ff_joystick }, /* FGT Force Feedback Wheel */ | ||
62 | }; | ||
63 | |||
64 | struct tmff_device { | ||
65 | struct hid_report *report; | ||
66 | struct hid_field *ff_field; | ||
67 | }; | ||
68 | |||
69 | /* Changes values from 0 to 0xffff into values from minimum to maximum */ | ||
70 | static inline int hid_tmff_scale_u16(unsigned int in, | ||
71 | int minimum, int maximum) | ||
72 | { | ||
73 | int ret; | ||
74 | |||
75 | ret = (in * (maximum - minimum) / 0xffff) + minimum; | ||
76 | if (ret < minimum) | ||
77 | return minimum; | ||
78 | if (ret > maximum) | ||
79 | return maximum; | ||
80 | return ret; | ||
81 | } | ||
82 | |||
83 | /* Changes values from -0x80 to 0x7f into values from minimum to maximum */ | ||
84 | static inline int hid_tmff_scale_s8(int in, | ||
85 | int minimum, int maximum) | ||
86 | { | ||
87 | int ret; | ||
88 | |||
89 | ret = (((in + 0x80) * (maximum - minimum)) / 0xff) + minimum; | ||
90 | if (ret < minimum) | ||
91 | return minimum; | ||
92 | if (ret > maximum) | ||
93 | return maximum; | ||
94 | return ret; | ||
95 | } | ||
96 | |||
97 | static int hid_tmff_play(struct input_dev *dev, void *data, struct ff_effect *effect) | ||
98 | { | ||
99 | struct hid_device *hid = input_get_drvdata(dev); | ||
100 | struct tmff_device *tmff = data; | ||
101 | struct hid_field *ff_field = tmff->ff_field; | ||
102 | int x, y; | ||
103 | int left, right; /* Rumbling */ | ||
104 | |||
105 | switch (effect->type) { | ||
106 | case FF_CONSTANT: | ||
107 | x = hid_tmff_scale_s8(effect->u.ramp.start_level, | ||
108 | ff_field->logical_minimum, | ||
109 | ff_field->logical_maximum); | ||
110 | y = hid_tmff_scale_s8(effect->u.ramp.end_level, | ||
111 | ff_field->logical_minimum, | ||
112 | ff_field->logical_maximum); | ||
113 | |||
114 | dbg_hid("(x, y)=(%04x, %04x)\n", x, y); | ||
115 | ff_field->value[0] = x; | ||
116 | ff_field->value[1] = y; | ||
117 | usbhid_submit_report(hid, tmff->report, USB_DIR_OUT); | ||
118 | break; | ||
119 | |||
120 | case FF_RUMBLE: | ||
121 | left = hid_tmff_scale_u16(effect->u.rumble.weak_magnitude, | ||
122 | ff_field->logical_minimum, | ||
123 | ff_field->logical_maximum); | ||
124 | right = hid_tmff_scale_u16(effect->u.rumble.strong_magnitude, | ||
125 | ff_field->logical_minimum, | ||
126 | ff_field->logical_maximum); | ||
127 | |||
128 | dbg_hid("(left,right)=(%08x, %08x)\n", left, right); | ||
129 | ff_field->value[0] = left; | ||
130 | ff_field->value[1] = right; | ||
131 | usbhid_submit_report(hid, tmff->report, USB_DIR_OUT); | ||
132 | break; | ||
133 | } | ||
134 | return 0; | ||
135 | } | ||
136 | |||
137 | int hid_tmff_init(struct hid_device *hid) | ||
138 | { | ||
139 | struct tmff_device *tmff; | ||
140 | struct hid_report *report; | ||
141 | struct list_head *report_list; | ||
142 | struct hid_input *hidinput = list_entry(hid->inputs.next, struct hid_input, list); | ||
143 | struct input_dev *input_dev = hidinput->input; | ||
144 | const signed short *ff_bits = ff_joystick; | ||
145 | int error; | ||
146 | int i; | ||
147 | |||
148 | tmff = kzalloc(sizeof(struct tmff_device), GFP_KERNEL); | ||
149 | if (!tmff) | ||
150 | return -ENOMEM; | ||
151 | |||
152 | /* Find the report to use */ | ||
153 | report_list = &hid->report_enum[HID_OUTPUT_REPORT].report_list; | ||
154 | list_for_each_entry(report, report_list, list) { | ||
155 | int fieldnum; | ||
156 | |||
157 | for (fieldnum = 0; fieldnum < report->maxfield; ++fieldnum) { | ||
158 | struct hid_field *field = report->field[fieldnum]; | ||
159 | |||
160 | if (field->maxusage <= 0) | ||
161 | continue; | ||
162 | |||
163 | switch (field->usage[0].hid) { | ||
164 | case THRUSTMASTER_USAGE_FF: | ||
165 | if (field->report_count < 2) { | ||
166 | warn("ignoring FF field with report_count < 2"); | ||
167 | continue; | ||
168 | } | ||
169 | |||
170 | if (field->logical_maximum == field->logical_minimum) { | ||
171 | warn("ignoring FF field with logical_maximum == logical_minimum"); | ||
172 | continue; | ||
173 | } | ||
174 | |||
175 | if (tmff->report && tmff->report != report) { | ||
176 | warn("ignoring FF field in other report"); | ||
177 | continue; | ||
178 | } | ||
179 | |||
180 | if (tmff->ff_field && tmff->ff_field != field) { | ||
181 | warn("ignoring duplicate FF field"); | ||
182 | continue; | ||
183 | } | ||
184 | |||
185 | tmff->report = report; | ||
186 | tmff->ff_field = field; | ||
187 | |||
188 | for (i = 0; i < ARRAY_SIZE(devices); i++) { | ||
189 | if (input_dev->id.vendor == devices[i].idVendor && | ||
190 | input_dev->id.product == devices[i].idProduct) { | ||
191 | ff_bits = devices[i].ff; | ||
192 | break; | ||
193 | } | ||
194 | } | ||
195 | |||
196 | for (i = 0; ff_bits[i] >= 0; i++) | ||
197 | set_bit(ff_bits[i], input_dev->ffbit); | ||
198 | |||
199 | break; | ||
200 | |||
201 | default: | ||
202 | warn("ignoring unknown output usage %08x", field->usage[0].hid); | ||
203 | continue; | ||
204 | } | ||
205 | } | ||
206 | } | ||
207 | |||
208 | if (!tmff->report) { | ||
209 | err("cant find FF field in output reports\n"); | ||
210 | error = -ENODEV; | ||
211 | goto fail; | ||
212 | } | ||
213 | |||
214 | error = input_ff_create_memless(input_dev, tmff, hid_tmff_play); | ||
215 | if (error) | ||
216 | goto fail; | ||
217 | |||
218 | info("Force feedback for ThrustMaster devices by Zinx Verituse <zinx@epicsol.org>"); | ||
219 | return 0; | ||
220 | |||
221 | fail: | ||
222 | kfree(tmff); | ||
223 | return error; | ||
224 | } | ||
225 | |||
diff --git a/drivers/hid/usbhid/hid-zpff.c b/drivers/hid/usbhid/hid-zpff.c deleted file mode 100644 index 5a688274f6a3..000000000000 --- a/drivers/hid/usbhid/hid-zpff.c +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | /* | ||
2 | * Force feedback support for Zeroplus based devices | ||
3 | * | ||
4 | * Copyright (c) 2005, 2006 Anssi Hannula <anssi.hannula@gmail.com> | ||
5 | */ | ||
6 | |||
7 | /* | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | |||
24 | #include <linux/input.h> | ||
25 | #include <linux/usb.h> | ||
26 | #include <linux/hid.h> | ||
27 | #include "usbhid.h" | ||
28 | |||
29 | struct zpff_device { | ||
30 | struct hid_report *report; | ||
31 | }; | ||
32 | |||
33 | static int hid_zpff_play(struct input_dev *dev, void *data, | ||
34 | struct ff_effect *effect) | ||
35 | { | ||
36 | struct hid_device *hid = input_get_drvdata(dev); | ||
37 | struct zpff_device *zpff = data; | ||
38 | int left, right; | ||
39 | |||
40 | /* | ||
41 | * The following is specified the other way around in the Zeroplus | ||
42 | * datasheet but the order below is correct for the XFX Executioner; | ||
43 | * however it is possible that the XFX Executioner is an exception | ||
44 | */ | ||
45 | |||
46 | left = effect->u.rumble.strong_magnitude; | ||
47 | right = effect->u.rumble.weak_magnitude; | ||
48 | dbg_hid("called with 0x%04x 0x%04x\n", left, right); | ||
49 | |||
50 | left = left * 0x7f / 0xffff; | ||
51 | right = right * 0x7f / 0xffff; | ||
52 | |||
53 | zpff->report->field[2]->value[0] = left; | ||
54 | zpff->report->field[3]->value[0] = right; | ||
55 | dbg_hid("running with 0x%02x 0x%02x\n", left, right); | ||
56 | usbhid_submit_report(hid, zpff->report, USB_DIR_OUT); | ||
57 | |||
58 | return 0; | ||
59 | } | ||
60 | |||
61 | int hid_zpff_init(struct hid_device *hid) | ||
62 | { | ||
63 | struct zpff_device *zpff; | ||
64 | struct hid_report *report; | ||
65 | struct hid_input *hidinput = list_entry(hid->inputs.next, | ||
66 | struct hid_input, list); | ||
67 | struct list_head *report_list = | ||
68 | &hid->report_enum[HID_OUTPUT_REPORT].report_list; | ||
69 | struct input_dev *dev = hidinput->input; | ||
70 | int error; | ||
71 | |||
72 | if (list_empty(report_list)) { | ||
73 | printk(KERN_ERR "hid-zpff: no output report found\n"); | ||
74 | return -ENODEV; | ||
75 | } | ||
76 | |||
77 | report = list_entry(report_list->next, struct hid_report, list); | ||
78 | |||
79 | if (report->maxfield < 4) { | ||
80 | printk(KERN_ERR "hid-zpff: not enough fields in report\n"); | ||
81 | return -ENODEV; | ||
82 | } | ||
83 | |||
84 | zpff = kzalloc(sizeof(struct zpff_device), GFP_KERNEL); | ||
85 | if (!zpff) | ||
86 | return -ENOMEM; | ||
87 | |||
88 | set_bit(FF_RUMBLE, dev->ffbit); | ||
89 | |||
90 | error = input_ff_create_memless(dev, zpff, hid_zpff_play); | ||
91 | if (error) { | ||
92 | kfree(zpff); | ||
93 | return error; | ||
94 | } | ||
95 | |||
96 | zpff->report = report; | ||
97 | zpff->report->field[0]->value[0] = 0x00; | ||
98 | zpff->report->field[1]->value[0] = 0x02; | ||
99 | zpff->report->field[2]->value[0] = 0x00; | ||
100 | zpff->report->field[3]->value[0] = 0x00; | ||
101 | usbhid_submit_report(hid, zpff->report, USB_DIR_OUT); | ||
102 | |||
103 | printk(KERN_INFO "Force feedback for Zeroplus based devices by " | ||
104 | "Anssi Hannula <anssi.hannula@gmail.com>\n"); | ||
105 | |||
106 | return 0; | ||
107 | } | ||
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c index 842e9edb888e..babd65dd46ad 100644 --- a/drivers/hid/usbhid/hiddev.c +++ b/drivers/hid/usbhid/hiddev.c | |||
@@ -790,21 +790,23 @@ static struct usb_class_driver hiddev_class = { | |||
790 | /* | 790 | /* |
791 | * This is where hid.c calls us to connect a hid device to the hiddev driver | 791 | * This is where hid.c calls us to connect a hid device to the hiddev driver |
792 | */ | 792 | */ |
793 | int hiddev_connect(struct hid_device *hid) | 793 | int hiddev_connect(struct hid_device *hid, unsigned int force) |
794 | { | 794 | { |
795 | struct hiddev *hiddev; | 795 | struct hiddev *hiddev; |
796 | struct usbhid_device *usbhid = hid->driver_data; | 796 | struct usbhid_device *usbhid = hid->driver_data; |
797 | int i; | ||
798 | int retval; | 797 | int retval; |
799 | 798 | ||
800 | for (i = 0; i < hid->maxcollection; i++) | 799 | if (!force) { |
801 | if (hid->collection[i].type == | 800 | unsigned int i; |
802 | HID_COLLECTION_APPLICATION && | 801 | for (i = 0; i < hid->maxcollection; i++) |
803 | !IS_INPUT_APPLICATION(hid->collection[i].usage)) | 802 | if (hid->collection[i].type == |
804 | break; | 803 | HID_COLLECTION_APPLICATION && |
804 | !IS_INPUT_APPLICATION(hid->collection[i].usage)) | ||
805 | break; | ||
805 | 806 | ||
806 | if (i == hid->maxcollection && (hid->quirks & HID_QUIRK_HIDDEV) == 0) | 807 | if (i == hid->maxcollection) |
807 | return -1; | 808 | return -1; |
809 | } | ||
808 | 810 | ||
809 | if (!(hiddev = kzalloc(sizeof(struct hiddev), GFP_KERNEL))) | 811 | if (!(hiddev = kzalloc(sizeof(struct hiddev), GFP_KERNEL))) |
810 | return -1; | 812 | return -1; |
diff --git a/drivers/hid/usbhid/usbhid.h b/drivers/hid/usbhid/usbhid.h index 62d2d7c925bd..abedb13c623e 100644 --- a/drivers/hid/usbhid/usbhid.h +++ b/drivers/hid/usbhid/usbhid.h | |||
@@ -67,7 +67,7 @@ struct usbhid_device { | |||
67 | spinlock_t ctrllock; /* Control fifo spinlock */ | 67 | spinlock_t ctrllock; /* Control fifo spinlock */ |
68 | 68 | ||
69 | struct urb *urbout; /* Output URB */ | 69 | struct urb *urbout; /* Output URB */ |
70 | struct hid_report *out[HID_CONTROL_FIFO_SIZE]; /* Output pipe fifo */ | 70 | struct hid_output_fifo out[HID_CONTROL_FIFO_SIZE]; /* Output pipe fifo */ |
71 | unsigned char outhead, outtail; /* Output pipe fifo head & tail */ | 71 | unsigned char outhead, outtail; /* Output pipe fifo head & tail */ |
72 | char *outbuf; /* Output buffer */ | 72 | char *outbuf; /* Output buffer */ |
73 | dma_addr_t outbuf_dma; /* Output buffer dma */ | 73 | dma_addr_t outbuf_dma; /* Output buffer dma */ |
@@ -82,7 +82,7 @@ struct usbhid_device { | |||
82 | }; | 82 | }; |
83 | 83 | ||
84 | #define hid_to_usb_dev(hid_dev) \ | 84 | #define hid_to_usb_dev(hid_dev) \ |
85 | container_of(hid_dev->dev->parent, struct usb_device, dev) | 85 | container_of(hid_dev->dev.parent->parent, struct usb_device, dev) |
86 | 86 | ||
87 | #endif | 87 | #endif |
88 | 88 | ||
diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c index 0caaafe01843..b342926dd7fc 100644 --- a/drivers/hid/usbhid/usbkbd.c +++ b/drivers/hid/usbhid/usbkbd.c | |||
@@ -105,14 +105,16 @@ static void usb_kbd_irq(struct urb *urb) | |||
105 | if (usb_kbd_keycode[kbd->old[i]]) | 105 | if (usb_kbd_keycode[kbd->old[i]]) |
106 | input_report_key(kbd->dev, usb_kbd_keycode[kbd->old[i]], 0); | 106 | input_report_key(kbd->dev, usb_kbd_keycode[kbd->old[i]], 0); |
107 | else | 107 | else |
108 | info("Unknown key (scancode %#x) released.", kbd->old[i]); | 108 | dev_info(&urb->dev->dev, |
109 | "Unknown key (scancode %#x) released.\n", kbd->old[i]); | ||
109 | } | 110 | } |
110 | 111 | ||
111 | if (kbd->new[i] > 3 && memscan(kbd->old + 2, kbd->new[i], 6) == kbd->old + 8) { | 112 | if (kbd->new[i] > 3 && memscan(kbd->old + 2, kbd->new[i], 6) == kbd->old + 8) { |
112 | if (usb_kbd_keycode[kbd->new[i]]) | 113 | if (usb_kbd_keycode[kbd->new[i]]) |
113 | input_report_key(kbd->dev, usb_kbd_keycode[kbd->new[i]], 1); | 114 | input_report_key(kbd->dev, usb_kbd_keycode[kbd->new[i]], 1); |
114 | else | 115 | else |
115 | info("Unknown key (scancode %#x) pressed.", kbd->new[i]); | 116 | dev_info(&urb->dev->dev, |
117 | "Unknown key (scancode %#x) released.\n", kbd->new[i]); | ||
116 | } | 118 | } |
117 | } | 119 | } |
118 | 120 | ||
@@ -159,7 +161,8 @@ static void usb_kbd_led(struct urb *urb) | |||
159 | struct usb_kbd *kbd = urb->context; | 161 | struct usb_kbd *kbd = urb->context; |
160 | 162 | ||
161 | if (urb->status) | 163 | if (urb->status) |
162 | warn("led urb status %d received", urb->status); | 164 | dev_warn(&urb->dev->dev, "led urb status %d received\n", |
165 | urb->status); | ||
163 | 166 | ||
164 | if (*(kbd->leds) == kbd->newleds) | 167 | if (*(kbd->leds) == kbd->newleds) |
165 | return; | 168 | return; |
@@ -352,7 +355,8 @@ static int __init usb_kbd_init(void) | |||
352 | { | 355 | { |
353 | int result = usb_register(&usb_kbd_driver); | 356 | int result = usb_register(&usb_kbd_driver); |
354 | if (result == 0) | 357 | if (result == 0) |
355 | info(DRIVER_VERSION ":" DRIVER_DESC); | 358 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" |
359 | DRIVER_DESC "\n"); | ||
356 | return result; | 360 | return result; |
357 | } | 361 | } |
358 | 362 | ||
diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c index 35689ef172cc..72ab4b268096 100644 --- a/drivers/hid/usbhid/usbmouse.c +++ b/drivers/hid/usbhid/usbmouse.c | |||
@@ -31,6 +31,11 @@ | |||
31 | #include <linux/usb/input.h> | 31 | #include <linux/usb/input.h> |
32 | #include <linux/hid.h> | 32 | #include <linux/hid.h> |
33 | 33 | ||
34 | /* for apple IDs */ | ||
35 | #ifdef CONFIG_USB_HID_MODULE | ||
36 | #include "../hid-ids.h" | ||
37 | #endif | ||
38 | |||
34 | /* | 39 | /* |
35 | * Version Information | 40 | * Version Information |
36 | */ | 41 | */ |
@@ -240,7 +245,8 @@ static int __init usb_mouse_init(void) | |||
240 | { | 245 | { |
241 | int retval = usb_register(&usb_mouse_driver); | 246 | int retval = usb_register(&usb_mouse_driver); |
242 | if (retval == 0) | 247 | if (retval == 0) |
243 | info(DRIVER_VERSION ":" DRIVER_DESC); | 248 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" |
249 | DRIVER_DESC "\n"); | ||
244 | return retval; | 250 | return retval; |
245 | } | 251 | } |
246 | 252 | ||