Skip to content

Commit ca1c118

Browse files
Simon Applebyfelipebalbi
authored andcommitted
usb: gadget: net2280: fix endpoint max packet for super speed connections
This patch fixes the register offset used for super-speed connection's max packet size. Without it using the 338x series of devices in enhanced mode will only allow full or high speed operation to function correctly. Signed-off-by: Simon Appleby <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent 7b0a271 commit ca1c118

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

drivers/usb/gadget/udc/net2280.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,20 @@ static inline void set_max_speed(struct net2280_ep *ep, u32 max)
369369
static const u32 ep_enhanced[9] = { 0x10, 0x60, 0x30, 0x80,
370370
0x50, 0x20, 0x70, 0x40, 0x90 };
371371

372-
if (ep->dev->enhanced_mode)
372+
if (ep->dev->enhanced_mode) {
373373
reg = ep_enhanced[ep->num];
374-
else{
374+
switch (ep->dev->gadget.speed) {
375+
case USB_SPEED_SUPER:
376+
reg += 2;
377+
break;
378+
case USB_SPEED_FULL:
379+
reg += 1;
380+
break;
381+
case USB_SPEED_HIGH:
382+
default:
383+
break;
384+
}
385+
} else {
375386
reg = (ep->num + 1) * 0x10;
376387
if (ep->dev->gadget.speed != USB_SPEED_HIGH)
377388
reg += 1;

0 commit comments

Comments
 (0)