Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f42cd57 authored by Azhar Shaikh's avatar Azhar Shaikh
Browse files

usb: gadget: Fix disabling L1 LPM capability on SS devices connected as HS



Commit 628fd947 ("usb: gadget: Disable L1 LPM capability") sets
the USB version of Superspeed devices connected at High Speed devices
as 0x0200.
Consider the below case:
1. Connect HS cable - USB type is 0x0200
2. Disconnect HS cable and connect SS cable - USB type is 0x0300
3. Disconnect SS cable and again connect HS cable - USB type is 0x0300
So for Superspeed devices connected at High Speed incorrect USB type
is being set.
Fix this by adding a simple else check and explicitly setting it to 0x0200.

Change-Id: I5746049870973bcdbe38ccfda56fec5c8e8f0f13
Signed-off-by: default avatarAzhar Shaikh <azhars@codeaurora.org>
parent f1d461b6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1630,6 +1630,8 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
					cdev->desc.bcdUSB = cpu_to_le16(0x0210);
					DBG(cdev,
					"Config HS device with LPM(L1)\n");
				} else {
					cdev->desc.bcdUSB = cpu_to_le16(0x0200);
				}
			} else if (gadget->l1_supported) {
				cdev->desc.bcdUSB = cpu_to_le16(0x0210);