Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: dwc3: gadget: Remove invalid low-speed setting

None of the DWC_usb3x IPs (and all their versions) supports low-speed
setting in device mode. In the early days, our "Early Adopter Edition"
DWC_usb3 databook shows that the controller may be configured to operate
in low-speed, but it was revised on release. Let's remove this invalid
speed setting to avoid any confusion.

Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/258b1c7fbb966454f4c4c2c1367508998498fc30.1615509438.git.Thinh.Nguyen@synopsys.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Thinh Nguyen and committed by
Greg Kroah-Hartman
0c59f678 575b1ac4

-11
-1
drivers/usb/dwc3/core.c
··· 1394 1394 1395 1395 /* Check the maximum_speed parameter */ 1396 1396 switch (dwc->maximum_speed) { 1397 - case USB_SPEED_LOW: 1398 1397 case USB_SPEED_FULL: 1399 1398 case USB_SPEED_HIGH: 1400 1399 break;
-2
drivers/usb/dwc3/core.h
··· 398 398 #define DWC3_DCFG_SUPERSPEED (4 << 0) 399 399 #define DWC3_DCFG_HIGHSPEED (0 << 0) 400 400 #define DWC3_DCFG_FULLSPEED BIT(0) 401 - #define DWC3_DCFG_LOWSPEED (2 << 0) 402 401 403 402 #define DWC3_DCFG_NUMP_SHIFT 17 404 403 #define DWC3_DCFG_NUMP(n) (((n) >> DWC3_DCFG_NUMP_SHIFT) & 0x1f) ··· 491 492 #define DWC3_DSTS_SUPERSPEED (4 << 0) 492 493 #define DWC3_DSTS_HIGHSPEED (0 << 0) 493 494 #define DWC3_DSTS_FULLSPEED BIT(0) 494 - #define DWC3_DSTS_LOWSPEED (2 << 0) 495 495 496 496 /* Device Generic Command Register */ 497 497 #define DWC3_DGCMD_SET_LMP 0x01
-8
drivers/usb/dwc3/gadget.c
··· 2113 2113 reg |= DWC3_DCFG_SUPERSPEED; 2114 2114 } else { 2115 2115 switch (speed) { 2116 - case USB_SPEED_LOW: 2117 - reg |= DWC3_DCFG_LOWSPEED; 2118 - break; 2119 2116 case USB_SPEED_FULL: 2120 2117 reg |= DWC3_DCFG_FULLSPEED; 2121 2118 break; ··· 3451 3454 dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(64); 3452 3455 dwc->gadget->ep0->maxpacket = 64; 3453 3456 dwc->gadget->speed = USB_SPEED_FULL; 3454 - break; 3455 - case DWC3_DSTS_LOWSPEED: 3456 - dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(8); 3457 - dwc->gadget->ep0->maxpacket = 8; 3458 - dwc->gadget->speed = USB_SPEED_LOW; 3459 3457 break; 3460 3458 } 3461 3459