usb: gadget: composite: Fix bcdUSB for non-SuperSpeed gadget

This patch set bcdUSB to 0x0200 for non-SuperSpeed gadget
which disable LPM. It can avoid usb bus enter LPM.

Test on RK356X platform, connect USB2.0 ADB to the PC USB
host port, without this patch, the usb bus will enter LPM
dynamically and trigger the USB DWC3 controller suspend
interrupt event frequently (more than 1000 interrupts per
second).

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Id0b9d54800e471512a417933868f76181c89e99d
This commit is contained in:
William Wu
2024-05-07 20:06:42 +08:00
committed by Tao Huang
parent 941de7d1c6
commit a3c8a03bae

View File

@@ -1745,7 +1745,10 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
cdev->desc.bcdUSB = cpu_to_le16(0x0320);
cdev->desc.bMaxPacketSize0 = 9;
} else {
cdev->desc.bcdUSB = cpu_to_le16(0x0210);
if (gadget->lpm_capable)
cdev->desc.bcdUSB = cpu_to_le16(0x0210);
else
cdev->desc.bcdUSB = cpu_to_le16(0x0200);
}
} else {
if (gadget->lpm_capable)