xref: /OK3568_Linux_fs/kernel/include/linux/usb/quirks.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * This file holds the definitions of quirks found in USB devices.
4*4882a593Smuzhiyun  * Only quirks that affect the whole device, not an interface,
5*4882a593Smuzhiyun  * belong here.
6*4882a593Smuzhiyun  */
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun #ifndef __LINUX_USB_QUIRKS_H
9*4882a593Smuzhiyun #define __LINUX_USB_QUIRKS_H
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun /* string descriptors must not be fetched using a 255-byte read */
12*4882a593Smuzhiyun #define USB_QUIRK_STRING_FETCH_255		BIT(0)
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun /* device can't resume correctly so reset it instead */
15*4882a593Smuzhiyun #define USB_QUIRK_RESET_RESUME			BIT(1)
16*4882a593Smuzhiyun 
17*4882a593Smuzhiyun /* device can't handle Set-Interface requests */
18*4882a593Smuzhiyun #define USB_QUIRK_NO_SET_INTF			BIT(2)
19*4882a593Smuzhiyun 
20*4882a593Smuzhiyun /* device can't handle its Configuration or Interface strings */
21*4882a593Smuzhiyun #define USB_QUIRK_CONFIG_INTF_STRINGS		BIT(3)
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun /* device can't be reset(e.g morph devices), don't use reset */
24*4882a593Smuzhiyun #define USB_QUIRK_RESET				BIT(4)
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun /* device has more interface descriptions than the bNumInterfaces count,
27*4882a593Smuzhiyun    and can't handle talking to these interfaces */
28*4882a593Smuzhiyun #define USB_QUIRK_HONOR_BNUMINTERFACES		BIT(5)
29*4882a593Smuzhiyun 
30*4882a593Smuzhiyun /* device needs a pause during initialization, after we read the device
31*4882a593Smuzhiyun    descriptor */
32*4882a593Smuzhiyun #define USB_QUIRK_DELAY_INIT			BIT(6)
33*4882a593Smuzhiyun 
34*4882a593Smuzhiyun /*
35*4882a593Smuzhiyun  * For high speed and super speed interupt endpoints, the USB 2.0 and
36*4882a593Smuzhiyun  * USB 3.0 spec require the interval in microframes
37*4882a593Smuzhiyun  * (1 microframe = 125 microseconds) to be calculated as
38*4882a593Smuzhiyun  * interval = 2 ^ (bInterval-1).
39*4882a593Smuzhiyun  *
40*4882a593Smuzhiyun  * Devices with this quirk report their bInterval as the result of this
41*4882a593Smuzhiyun  * calculation instead of the exponent variable used in the calculation.
42*4882a593Smuzhiyun  */
43*4882a593Smuzhiyun #define USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL	BIT(7)
44*4882a593Smuzhiyun 
45*4882a593Smuzhiyun /* device can't handle device_qualifier descriptor requests */
46*4882a593Smuzhiyun #define USB_QUIRK_DEVICE_QUALIFIER		BIT(8)
47*4882a593Smuzhiyun 
48*4882a593Smuzhiyun /* device generates spurious wakeup, ignore remote wakeup capability */
49*4882a593Smuzhiyun #define USB_QUIRK_IGNORE_REMOTE_WAKEUP		BIT(9)
50*4882a593Smuzhiyun 
51*4882a593Smuzhiyun /* device can't handle Link Power Management */
52*4882a593Smuzhiyun #define USB_QUIRK_NO_LPM			BIT(10)
53*4882a593Smuzhiyun 
54*4882a593Smuzhiyun /*
55*4882a593Smuzhiyun  * Device reports its bInterval as linear frames instead of the
56*4882a593Smuzhiyun  * USB 2.0 calculation.
57*4882a593Smuzhiyun  */
58*4882a593Smuzhiyun #define USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL	BIT(11)
59*4882a593Smuzhiyun 
60*4882a593Smuzhiyun /*
61*4882a593Smuzhiyun  * Device needs to be disconnected before suspend to prevent spurious
62*4882a593Smuzhiyun  * wakeup.
63*4882a593Smuzhiyun  */
64*4882a593Smuzhiyun #define USB_QUIRK_DISCONNECT_SUSPEND		BIT(12)
65*4882a593Smuzhiyun 
66*4882a593Smuzhiyun /* Device needs a pause after every control message. */
67*4882a593Smuzhiyun #define USB_QUIRK_DELAY_CTRL_MSG		BIT(13)
68*4882a593Smuzhiyun 
69*4882a593Smuzhiyun /* Hub needs extra delay after resetting its port. */
70*4882a593Smuzhiyun #define USB_QUIRK_HUB_SLOW_RESET		BIT(14)
71*4882a593Smuzhiyun 
72*4882a593Smuzhiyun /* device has endpoints that should be ignored */
73*4882a593Smuzhiyun #define USB_QUIRK_ENDPOINT_IGNORE		BIT(15)
74*4882a593Smuzhiyun 
75*4882a593Smuzhiyun /* device can't support auto suspend function */
76*4882a593Smuzhiyun #define USB_QUIRK_AUTO_SUSPEND			BIT(16)
77*4882a593Smuzhiyun 
78*4882a593Smuzhiyun #endif /* __LINUX_USB_QUIRKS_H */
79