2 * USB device quirk handling logic and table
4 * Copyright (c) 2007 Oliver Neukum
5 * Copyright (c) 2007 Greg Kroah-Hartman <gregkh@suse.de>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation, version 2.
14 #include <linux/usb.h>
15 #include <linux/usb/quirks.h>
16 #include <linux/usb/hcd.h>
19 /* Lists of quirky USB devices, split in device quirks and interface quirks.
20 * Device quirks are applied at the very beginning of the enumeration process,
21 * right after reading the device descriptor. They can thus only match on device
24 * Interface quirks are applied after reading all the configuration descriptors.
25 * They can match on both device and interface information.
27 * Note that the DELAY_INIT and HONOR_BNUMINTERFACES quirks do not make sense as
28 * interface quirks, as they only influence the enumeration process which is run
29 * before processing the interface quirks.
31 * Please keep the lists ordered by:
36 static const struct usb_device_id usb_quirk_list[] = {
37 /* CBM - Flash disk */
38 { USB_DEVICE(0x0204, 0x6025), .driver_info = USB_QUIRK_RESET_RESUME },
40 /* WORLDE Controller KS49 or Prodipe MIDI 49C USB controller */
41 { USB_DEVICE(0x0218, 0x0201), .driver_info =
42 USB_QUIRK_CONFIG_INTF_STRINGS },
44 /* WORLDE easy key (easykey.25) MIDI controller */
45 { USB_DEVICE(0x0218, 0x0401), .driver_info =
46 USB_QUIRK_CONFIG_INTF_STRINGS },
48 /* HP 5300/5370C scanner */
49 { USB_DEVICE(0x03f0, 0x0701), .driver_info =
50 USB_QUIRK_STRING_FETCH_255 },
52 /* HP v222w 16GB Mini USB Drive */
53 { USB_DEVICE(0x03f0, 0x3f40), .driver_info = USB_QUIRK_DELAY_INIT },
55 /* Creative SB Audigy 2 NX */
56 { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME },
59 { USB_DEVICE(0x0424, 0x3503), .driver_info = USB_QUIRK_RESET_RESUME },
61 /* Microsoft Wireless Laser Mouse 6000 Receiver */
62 { USB_DEVICE(0x045e, 0x00e1), .driver_info = USB_QUIRK_RESET_RESUME },
64 /* Microsoft LifeCam-VX700 v2.0 */
65 { USB_DEVICE(0x045e, 0x0770), .driver_info = USB_QUIRK_RESET_RESUME },
67 /* Microsoft Surface Dock Ethernet (RTL8153 GigE) */
68 { USB_DEVICE(0x045e, 0x07c6), .driver_info = USB_QUIRK_NO_LPM },
70 /* Cherry Stream G230 2.0 (G85-231) and 3.0 (G85-232) */
71 { USB_DEVICE(0x046a, 0x0023), .driver_info = USB_QUIRK_RESET_RESUME },
73 /* Logitech HD Webcam C270 */
74 { USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME },
76 /* Logitech HD Pro Webcams C920, C920-C, C922, C925e and C930e */
77 { USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT },
78 { USB_DEVICE(0x046d, 0x0841), .driver_info = USB_QUIRK_DELAY_INIT },
79 { USB_DEVICE(0x046d, 0x0843), .driver_info = USB_QUIRK_DELAY_INIT },
80 { USB_DEVICE(0x046d, 0x085b), .driver_info = USB_QUIRK_DELAY_INIT },
81 { USB_DEVICE(0x046d, 0x085c), .driver_info = USB_QUIRK_DELAY_INIT },
83 /* Logitech ConferenceCam CC3000e */
84 { USB_DEVICE(0x046d, 0x0847), .driver_info = USB_QUIRK_DELAY_INIT },
85 { USB_DEVICE(0x046d, 0x0848), .driver_info = USB_QUIRK_DELAY_INIT },
87 /* Logitech PTZ Pro Camera */
88 { USB_DEVICE(0x046d, 0x0853), .driver_info = USB_QUIRK_DELAY_INIT },
90 /* Logitech Screen Share */
91 { USB_DEVICE(0x046d, 0x086c), .driver_info = USB_QUIRK_NO_LPM },
93 /* Logitech Quickcam Fusion */
94 { USB_DEVICE(0x046d, 0x08c1), .driver_info = USB_QUIRK_RESET_RESUME },
96 /* Logitech Quickcam Orbit MP */
97 { USB_DEVICE(0x046d, 0x08c2), .driver_info = USB_QUIRK_RESET_RESUME },
99 /* Logitech Quickcam Pro for Notebook */
100 { USB_DEVICE(0x046d, 0x08c3), .driver_info = USB_QUIRK_RESET_RESUME },
102 /* Logitech Quickcam Pro 5000 */
103 { USB_DEVICE(0x046d, 0x08c5), .driver_info = USB_QUIRK_RESET_RESUME },
105 /* Logitech Quickcam OEM Dell Notebook */
106 { USB_DEVICE(0x046d, 0x08c6), .driver_info = USB_QUIRK_RESET_RESUME },
108 /* Logitech Quickcam OEM Cisco VT Camera II */
109 { USB_DEVICE(0x046d, 0x08c7), .driver_info = USB_QUIRK_RESET_RESUME },
111 /* Logitech Harmony 700-series */
112 { USB_DEVICE(0x046d, 0xc122), .driver_info = USB_QUIRK_DELAY_INIT },
114 /* Philips PSC805 audio device */
115 { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },
117 /* Plantronic Audio 655 DSP */
118 { USB_DEVICE(0x047f, 0xc008), .driver_info = USB_QUIRK_RESET_RESUME },
120 /* Plantronic Audio 648 USB */
121 { USB_DEVICE(0x047f, 0xc013), .driver_info = USB_QUIRK_RESET_RESUME },
123 /* Artisman Watchdog Dongle */
124 { USB_DEVICE(0x04b4, 0x0526), .driver_info =
125 USB_QUIRK_CONFIG_INTF_STRINGS },
127 /* Microchip Joss Optical infrared touchboard device */
128 { USB_DEVICE(0x04d8, 0x000c), .driver_info =
129 USB_QUIRK_CONFIG_INTF_STRINGS },
131 /* CarrolTouch 4000U */
132 { USB_DEVICE(0x04e7, 0x0009), .driver_info = USB_QUIRK_RESET_RESUME },
134 /* CarrolTouch 4500U */
135 { USB_DEVICE(0x04e7, 0x0030), .driver_info = USB_QUIRK_RESET_RESUME },
137 /* Samsung Android phone modem - ID conflict with SPH-I500 */
138 { USB_DEVICE(0x04e8, 0x6601), .driver_info =
139 USB_QUIRK_CONFIG_INTF_STRINGS },
141 /* Elan Touchscreen */
142 { USB_DEVICE(0x04f3, 0x0089), .driver_info =
143 USB_QUIRK_DEVICE_QUALIFIER },
145 { USB_DEVICE(0x04f3, 0x009b), .driver_info =
146 USB_QUIRK_DEVICE_QUALIFIER },
148 { USB_DEVICE(0x04f3, 0x010c), .driver_info =
149 USB_QUIRK_DEVICE_QUALIFIER },
151 { USB_DEVICE(0x04f3, 0x0125), .driver_info =
152 USB_QUIRK_DEVICE_QUALIFIER },
154 { USB_DEVICE(0x04f3, 0x016f), .driver_info =
155 USB_QUIRK_DEVICE_QUALIFIER },
157 { USB_DEVICE(0x04f3, 0x0381), .driver_info =
160 { USB_DEVICE(0x04f3, 0x21b8), .driver_info =
161 USB_QUIRK_DEVICE_QUALIFIER },
164 { USB_DEVICE(0x0582, 0x0007), .driver_info = USB_QUIRK_RESET_RESUME },
167 { USB_DEVICE(0x0582, 0x0027), .driver_info = USB_QUIRK_RESET_RESUME },
169 /* Alcor Micro Corp. Hub */
170 { USB_DEVICE(0x058f, 0x9254), .driver_info = USB_QUIRK_RESET_RESUME },
173 { USB_DEVICE(0x05ac, 0x021a), .driver_info = USB_QUIRK_RESET_RESUME },
175 /* Genesys Logic hub, internally used by KY-688 USB 3.1 Type-C Hub */
176 { USB_DEVICE(0x05e3, 0x0612), .driver_info = USB_QUIRK_NO_LPM },
178 /* ELSA MicroLink 56K */
179 { USB_DEVICE(0x05cc, 0x2267), .driver_info = USB_QUIRK_RESET_RESUME },
181 /* Genesys Logic hub, internally used by Moshi USB to Ethernet Adapter */
182 { USB_DEVICE(0x05e3, 0x0616), .driver_info = USB_QUIRK_NO_LPM },
185 { USB_DEVICE(0x0638, 0x0a13), .driver_info =
186 USB_QUIRK_STRING_FETCH_255 },
188 /* Saitek Cyborg Gold Joystick */
189 { USB_DEVICE(0x06a3, 0x0006), .driver_info =
190 USB_QUIRK_CONFIG_INTF_STRINGS },
192 /* Agfa SNAPSCAN 1212U */
193 { USB_DEVICE(0x06bd, 0x0001), .driver_info = USB_QUIRK_RESET_RESUME },
195 /* Guillemot Webcam Hercules Dualpix Exchange (2nd ID) */
196 { USB_DEVICE(0x06f8, 0x0804), .driver_info = USB_QUIRK_RESET_RESUME },
198 /* Guillemot Webcam Hercules Dualpix Exchange*/
199 { USB_DEVICE(0x06f8, 0x3005), .driver_info = USB_QUIRK_RESET_RESUME },
201 /* Guillemot Hercules DJ Console audio card (BZ 208357) */
202 { USB_DEVICE(0x06f8, 0xb000), .driver_info =
203 USB_QUIRK_ENDPOINT_BLACKLIST },
205 /* Midiman M-Audio Keystation 88es */
206 { USB_DEVICE(0x0763, 0x0192), .driver_info = USB_QUIRK_RESET_RESUME },
208 /* SanDisk Ultra Fit and Ultra Flair */
209 { USB_DEVICE(0x0781, 0x5583), .driver_info = USB_QUIRK_NO_LPM },
210 { USB_DEVICE(0x0781, 0x5591), .driver_info = USB_QUIRK_NO_LPM },
212 /* M-Systems Flash Disk Pioneers */
213 { USB_DEVICE(0x08ec, 0x1000), .driver_info = USB_QUIRK_RESET_RESUME },
215 /* Baum Vario Ultra */
216 { USB_DEVICE(0x0904, 0x6101), .driver_info =
217 USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL },
218 { USB_DEVICE(0x0904, 0x6102), .driver_info =
219 USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL },
220 { USB_DEVICE(0x0904, 0x6103), .driver_info =
221 USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL },
223 /* Keytouch QWERTY Panel keyboard */
224 { USB_DEVICE(0x0926, 0x3333), .driver_info =
225 USB_QUIRK_CONFIG_INTF_STRINGS },
227 /* Kingston DataTraveler 3.0 */
228 { USB_DEVICE(0x0951, 0x1666), .driver_info = USB_QUIRK_NO_LPM },
230 /* X-Rite/Gretag-Macbeth Eye-One Pro display colorimeter */
231 { USB_DEVICE(0x0971, 0x2000), .driver_info = USB_QUIRK_NO_SET_INTF },
233 /* ELMO L-12F document camera */
234 { USB_DEVICE(0x09a1, 0x0028), .driver_info = USB_QUIRK_DELAY_CTRL_MSG },
236 /* Broadcom BCM92035DGROM BT dongle */
237 { USB_DEVICE(0x0a5c, 0x2021), .driver_info = USB_QUIRK_RESET_RESUME },
239 /* MAYA44USB sound device */
240 { USB_DEVICE(0x0a92, 0x0091), .driver_info = USB_QUIRK_RESET_RESUME },
242 /* ASUS Base Station(T100) */
243 { USB_DEVICE(0x0b05, 0x17e0), .driver_info =
244 USB_QUIRK_IGNORE_REMOTE_WAKEUP },
246 /* Realtek Semiconductor Corp. Mass Storage Device (Multicard Reader)*/
247 { USB_DEVICE(0x0bda, 0x0151), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS },
249 /* Realtek hub in Dell WD19 (Type-C) */
250 { USB_DEVICE(0x0bda, 0x0487), .driver_info = USB_QUIRK_NO_LPM },
251 { USB_DEVICE(0x0bda, 0x5487), .driver_info = USB_QUIRK_RESET_RESUME },
253 /* Generic RTL8153 based ethernet adapters */
254 { USB_DEVICE(0x0bda, 0x8153), .driver_info = USB_QUIRK_NO_LPM },
256 /* SONiX USB DEVICE Touchpad */
257 { USB_DEVICE(0x0c45, 0x7056), .driver_info =
258 USB_QUIRK_IGNORE_REMOTE_WAKEUP },
260 /* Action Semiconductor flash disk */
261 { USB_DEVICE(0x10d6, 0x2200), .driver_info =
262 USB_QUIRK_STRING_FETCH_255 },
264 /* SKYMEDI USB_DRIVE */
265 { USB_DEVICE(0x1516, 0x8628), .driver_info = USB_QUIRK_RESET_RESUME },
267 /* Razer - Razer Blade Keyboard */
268 { USB_DEVICE(0x1532, 0x0116), .driver_info =
269 USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL },
271 /* Lenovo ThinkPad USB-C Dock Gen2 Ethernet (RTL8153 GigE) */
272 { USB_DEVICE(0x17ef, 0xa387), .driver_info = USB_QUIRK_NO_LPM },
274 /* BUILDWIN Photo Frame */
275 { USB_DEVICE(0x1908, 0x1315), .driver_info =
276 USB_QUIRK_HONOR_BNUMINTERFACES },
278 /* Protocol and OTG Electrical Test Device */
279 { USB_DEVICE(0x1a0a, 0x0200), .driver_info =
280 USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL },
282 /* Corsair K70 RGB */
283 { USB_DEVICE(0x1b1c, 0x1b13), .driver_info = USB_QUIRK_DELAY_INIT |
284 USB_QUIRK_DELAY_CTRL_MSG },
287 { USB_DEVICE(0x1b1c, 0x1b15), .driver_info = USB_QUIRK_DELAY_INIT |
288 USB_QUIRK_DELAY_CTRL_MSG },
290 /* Corsair Strafe RGB */
291 { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT |
292 USB_QUIRK_DELAY_CTRL_MSG },
294 /* Corsair K70 LUX RGB */
295 { USB_DEVICE(0x1b1c, 0x1b33), .driver_info = USB_QUIRK_DELAY_INIT },
297 /* Corsair K70 LUX */
298 { USB_DEVICE(0x1b1c, 0x1b36), .driver_info = USB_QUIRK_DELAY_INIT },
300 /* Corsair K70 RGB RAPDIFIRE */
301 { USB_DEVICE(0x1b1c, 0x1b38), .driver_info = USB_QUIRK_DELAY_INIT |
302 USB_QUIRK_DELAY_CTRL_MSG },
304 /* MIDI keyboard WORLDE MINI */
305 { USB_DEVICE(0x1c75, 0x0204), .driver_info =
306 USB_QUIRK_CONFIG_INTF_STRINGS },
308 /* Acer C120 LED Projector */
309 { USB_DEVICE(0x1de1, 0xc102), .driver_info = USB_QUIRK_NO_LPM },
311 /* Blackmagic Design Intensity Shuttle */
312 { USB_DEVICE(0x1edb, 0xbd3b), .driver_info = USB_QUIRK_NO_LPM },
314 /* Blackmagic Design UltraStudio SDI */
315 { USB_DEVICE(0x1edb, 0xbd4f), .driver_info = USB_QUIRK_NO_LPM },
317 /* Hauppauge HVR-950q */
318 { USB_DEVICE(0x2040, 0x7200), .driver_info =
319 USB_QUIRK_CONFIG_INTF_STRINGS },
321 /* Raydium Touchscreen */
322 { USB_DEVICE(0x2386, 0x3114), .driver_info = USB_QUIRK_NO_LPM },
324 { USB_DEVICE(0x2386, 0x3119), .driver_info = USB_QUIRK_NO_LPM },
326 { USB_DEVICE(0x2386, 0x350e), .driver_info = USB_QUIRK_NO_LPM },
329 { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM },
332 { USB_DEVICE(0x413c, 0xb062), .driver_info = USB_QUIRK_NO_LPM | USB_QUIRK_RESET_RESUME },
335 { USB_DEVICE(0x4296, 0x7570), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS },
337 /* INTEL VALUE SSD */
338 { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
340 /* novation SoundControl XL */
341 { USB_DEVICE(0x1235, 0x0061), .driver_info = USB_QUIRK_RESET_RESUME },
343 { } /* terminating entry must be last */
346 static const struct usb_device_id usb_interface_quirk_list[] = {
347 /* Logitech UVC Cameras */
348 { USB_VENDOR_AND_INTERFACE_INFO(0x046d, USB_CLASS_VIDEO, 1, 0),
349 .driver_info = USB_QUIRK_RESET_RESUME },
351 { } /* terminating entry must be last */
354 static const struct usb_device_id usb_amd_resume_quirk_list[] = {
355 /* Lenovo Mouse with Pixart controller */
356 { USB_DEVICE(0x17ef, 0x602e), .driver_info = USB_QUIRK_RESET_RESUME },
359 { USB_DEVICE(0x093a, 0x2500), .driver_info = USB_QUIRK_RESET_RESUME },
360 { USB_DEVICE(0x093a, 0x2510), .driver_info = USB_QUIRK_RESET_RESUME },
361 { USB_DEVICE(0x093a, 0x2521), .driver_info = USB_QUIRK_RESET_RESUME },
362 { USB_DEVICE(0x03f0, 0x2b4a), .driver_info = USB_QUIRK_RESET_RESUME },
364 /* Logitech Optical Mouse M90/M100 */
365 { USB_DEVICE(0x046d, 0xc05a), .driver_info = USB_QUIRK_RESET_RESUME },
367 { } /* terminating entry must be last */
371 * Entries for blacklisted endpoints that should be ignored when parsing
372 * configuration descriptors.
374 * Matched for devices with USB_QUIRK_ENDPOINT_BLACKLIST.
376 static const struct usb_device_id usb_endpoint_blacklist[] = {
377 { USB_DEVICE_INTERFACE_NUMBER(0x06f8, 0xb000, 5), .driver_info = 0x01 },
378 { USB_DEVICE_INTERFACE_NUMBER(0x06f8, 0xb000, 5), .driver_info = 0x81 },
382 bool usb_endpoint_is_blacklisted(struct usb_device *udev,
383 struct usb_host_interface *intf,
384 struct usb_endpoint_descriptor *epd)
386 const struct usb_device_id *id;
387 unsigned int address;
389 for (id = usb_endpoint_blacklist; id->match_flags; ++id) {
390 if (!usb_match_device(udev, id))
393 if (!usb_match_one_id_intf(udev, intf, id))
396 address = id->driver_info;
397 if (address == epd->bEndpointAddress)
404 static bool usb_match_any_interface(struct usb_device *udev,
405 const struct usb_device_id *id)
409 for (i = 0; i < udev->descriptor.bNumConfigurations; ++i) {
410 struct usb_host_config *cfg = &udev->config[i];
413 for (j = 0; j < cfg->desc.bNumInterfaces; ++j) {
414 struct usb_interface_cache *cache;
415 struct usb_host_interface *intf;
417 cache = cfg->intf_cache[j];
418 if (cache->num_altsetting == 0)
421 intf = &cache->altsetting[0];
422 if (usb_match_one_id_intf(udev, intf, id))
430 static int usb_amd_resume_quirk(struct usb_device *udev)
434 hcd = bus_to_hcd(udev->bus);
435 /* The device should be attached directly to root hub */
436 if (udev->level == 1 && hcd->amd_resume_bug == 1)
442 static u32 __usb_detect_quirks(struct usb_device *udev,
443 const struct usb_device_id *id)
447 for (; id->match_flags; id++) {
448 if (!usb_match_device(udev, id))
451 if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_INFO) &&
452 !usb_match_any_interface(udev, id))
455 quirks |= (u32)(id->driver_info);
462 * Detect any quirks the device has, and do any housekeeping for it if needed.
464 void usb_detect_quirks(struct usb_device *udev)
466 udev->quirks = __usb_detect_quirks(udev, usb_quirk_list);
469 * Pixart-based mice would trigger remote wakeup issue on AMD
470 * Yangtze chipset, so set them as RESET_RESUME flag.
472 if (usb_amd_resume_quirk(udev))
473 udev->quirks |= __usb_detect_quirks(udev,
474 usb_amd_resume_quirk_list);
477 dev_dbg(&udev->dev, "USB quirks for this device: %x\n",
480 #ifdef CONFIG_USB_DEFAULT_PERSIST
481 if (!(udev->quirks & USB_QUIRK_RESET))
482 udev->persist_enabled = 1;
484 /* Hubs are automatically enabled for USB-PERSIST */
485 if (udev->descriptor.bDeviceClass == USB_CLASS_HUB)
486 udev->persist_enabled = 1;
487 #endif /* CONFIG_USB_DEFAULT_PERSIST */
490 void usb_detect_interface_quirks(struct usb_device *udev)
494 quirks = __usb_detect_quirks(udev, usb_interface_quirk_list);
498 dev_dbg(&udev->dev, "USB interface quirks for this device: %x\n",
500 udev->quirks |= quirks;