From 286f4af0dfc6f8015cef3bfc83fcf796dc66927c Mon Sep 17 00:00:00 2001 From: Udipto Goswami Date: Wed, 4 Aug 2021 20:40:24 +0530 Subject: [PATCH] Revert "usb: dwc3: Add support of disable L1 in HS mode" This reverts commit c3de8d217902 ("usb: dwc3: Add support of disable L1 in HS mode") since the patch had implemented the functionality by changing the bcdUSB to 2.0. Eventhough it solves the problem, this results in compliance failures. Fix this by reverting the implementation. This will allow the compliance to detect the DUT as L1 supported device. Change-Id: I30894618584ebedf697dd98e0c94a42c961bc49d Signed-off-by: Udipto Goswami --- drivers/usb/dwc3/core.c | 2 -- drivers/usb/dwc3/core.h | 1 - drivers/usb/dwc3/gadget.c | 2 +- drivers/usb/gadget/composite.c | 3 +-- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 5395c52edf3d..6791b4ca95dd 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1485,8 +1485,6 @@ static void dwc3_get_properties(struct dwc3 *dwc) "snps,dis-tx-ipgap-linecheck-quirk"); dwc->parkmode_disable_ss_quirk = device_property_read_bool(dev, "snps,parkmode-disable-ss-quirk"); - dwc->usb2_l1_disable = device_property_read_bool(dev, - "snps,usb2-l1-disable"); dwc->tx_de_emphasis_quirk = device_property_read_bool(dev, "snps,tx_de_emphasis_quirk"); diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index a019b0e6180e..fee3cf068915 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -1363,7 +1363,6 @@ struct dwc3 { unsigned tx_de_emphasis:2; unsigned err_evt_seen:1; unsigned enable_bus_suspend:1; - unsigned usb2_l1_disable:1; atomic_t in_lpm; bool b_suspend; diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 6452a161c89b..4ef8f79f660c 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -4369,7 +4369,7 @@ int dwc3_gadget_init(struct dwc3 *dwc) dwc->gadget.speed = USB_SPEED_UNKNOWN; dwc->gadget.sg_supported = true; dwc->gadget.name = "dwc3-gadget"; - dwc->gadget.lpm_capable = !dwc->usb2_l1_disable; + dwc->gadget.lpm_capable = true; /* * FIXME We might be setting max_speed to desc.bMaxPacketSize0 = cdev->gadget->ep0->maxpacket; - cdev->desc.bcdUSB = cpu_to_le16(0x0200); if (gadget_is_superspeed(gadget)) { if (gadget->speed >= USB_SPEED_SUPER) { cdev->desc.bcdUSB = cpu_to_le16(0x0320); cdev->desc.bMaxPacketSize0 = 9; - } else if (gadget->lpm_capable) { + } else { cdev->desc.bcdUSB = cpu_to_le16(0x0210); } } else {