162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * This file holds the definitions of quirks found in USB devices. 462306a36Sopenharmony_ci * Only quirks that affect the whole device, not an interface, 562306a36Sopenharmony_ci * belong here. 662306a36Sopenharmony_ci */ 762306a36Sopenharmony_ci 862306a36Sopenharmony_ci#ifndef __LINUX_USB_QUIRKS_H 962306a36Sopenharmony_ci#define __LINUX_USB_QUIRKS_H 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci/* string descriptors must not be fetched using a 255-byte read */ 1262306a36Sopenharmony_ci#define USB_QUIRK_STRING_FETCH_255 BIT(0) 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci/* device can't resume correctly so reset it instead */ 1562306a36Sopenharmony_ci#define USB_QUIRK_RESET_RESUME BIT(1) 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci/* device can't handle Set-Interface requests */ 1862306a36Sopenharmony_ci#define USB_QUIRK_NO_SET_INTF BIT(2) 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci/* device can't handle its Configuration or Interface strings */ 2162306a36Sopenharmony_ci#define USB_QUIRK_CONFIG_INTF_STRINGS BIT(3) 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci/* device can't be reset(e.g morph devices), don't use reset */ 2462306a36Sopenharmony_ci#define USB_QUIRK_RESET BIT(4) 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ci/* device has more interface descriptions than the bNumInterfaces count, 2762306a36Sopenharmony_ci and can't handle talking to these interfaces */ 2862306a36Sopenharmony_ci#define USB_QUIRK_HONOR_BNUMINTERFACES BIT(5) 2962306a36Sopenharmony_ci 3062306a36Sopenharmony_ci/* device needs a pause during initialization, after we read the device 3162306a36Sopenharmony_ci descriptor */ 3262306a36Sopenharmony_ci#define USB_QUIRK_DELAY_INIT BIT(6) 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci/* 3562306a36Sopenharmony_ci * For high speed and super speed interrupt endpoints, the USB 2.0 and 3662306a36Sopenharmony_ci * USB 3.0 spec require the interval in microframes 3762306a36Sopenharmony_ci * (1 microframe = 125 microseconds) to be calculated as 3862306a36Sopenharmony_ci * interval = 2 ^ (bInterval-1). 3962306a36Sopenharmony_ci * 4062306a36Sopenharmony_ci * Devices with this quirk report their bInterval as the result of this 4162306a36Sopenharmony_ci * calculation instead of the exponent variable used in the calculation. 4262306a36Sopenharmony_ci */ 4362306a36Sopenharmony_ci#define USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL BIT(7) 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci/* device can't handle device_qualifier descriptor requests */ 4662306a36Sopenharmony_ci#define USB_QUIRK_DEVICE_QUALIFIER BIT(8) 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ci/* device generates spurious wakeup, ignore remote wakeup capability */ 4962306a36Sopenharmony_ci#define USB_QUIRK_IGNORE_REMOTE_WAKEUP BIT(9) 5062306a36Sopenharmony_ci 5162306a36Sopenharmony_ci/* device can't handle Link Power Management */ 5262306a36Sopenharmony_ci#define USB_QUIRK_NO_LPM BIT(10) 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci/* 5562306a36Sopenharmony_ci * Device reports its bInterval as linear frames instead of the 5662306a36Sopenharmony_ci * USB 2.0 calculation. 5762306a36Sopenharmony_ci */ 5862306a36Sopenharmony_ci#define USB_QUIRK_LINEAR_FRAME_INTR_BINTERVAL BIT(11) 5962306a36Sopenharmony_ci 6062306a36Sopenharmony_ci/* 6162306a36Sopenharmony_ci * Device needs to be disconnected before suspend to prevent spurious 6262306a36Sopenharmony_ci * wakeup. 6362306a36Sopenharmony_ci */ 6462306a36Sopenharmony_ci#define USB_QUIRK_DISCONNECT_SUSPEND BIT(12) 6562306a36Sopenharmony_ci 6662306a36Sopenharmony_ci/* Device needs a pause after every control message. */ 6762306a36Sopenharmony_ci#define USB_QUIRK_DELAY_CTRL_MSG BIT(13) 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_ci/* Hub needs extra delay after resetting its port. */ 7062306a36Sopenharmony_ci#define USB_QUIRK_HUB_SLOW_RESET BIT(14) 7162306a36Sopenharmony_ci 7262306a36Sopenharmony_ci/* device has endpoints that should be ignored */ 7362306a36Sopenharmony_ci#define USB_QUIRK_ENDPOINT_IGNORE BIT(15) 7462306a36Sopenharmony_ci 7562306a36Sopenharmony_ci#endif /* __LINUX_USB_QUIRKS_H */ 76