Commit ca1c1189 authored by Simon Appleby's avatar Simon Appleby Committed by Felipe Balbi

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: default avatarSimon Appleby <simon.appleby@pickeringtest.com>
Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
parent 7b0a271d
......@@ -369,9 +369,20 @@ static inline void set_max_speed(struct net2280_ep *ep, u32 max)
static const u32 ep_enhanced[9] = { 0x10, 0x60, 0x30, 0x80,
0x50, 0x20, 0x70, 0x40, 0x90 };
if (ep->dev->enhanced_mode)
if (ep->dev->enhanced_mode) {
reg = ep_enhanced[ep->num];
else{
switch (ep->dev->gadget.speed) {
case USB_SPEED_SUPER:
reg += 2;
break;
case USB_SPEED_FULL:
reg += 1;
break;
case USB_SPEED_HIGH:
default:
break;
}
} else {
reg = (ep->num + 1) * 0x10;
if (ep->dev->gadget.speed != USB_SPEED_HIGH)
reg += 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment