提交 ca1c1189 编写于 作者: S Simon Appleby 提交者: 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: NSimon Appleby <simon.appleby@pickeringtest.com>
Signed-off-by: NFelipe Balbi <balbi@kernel.org>
上级 7b0a271d
...@@ -369,9 +369,20 @@ static inline void set_max_speed(struct net2280_ep *ep, u32 max) ...@@ -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, static const u32 ep_enhanced[9] = { 0x10, 0x60, 0x30, 0x80,
0x50, 0x20, 0x70, 0x40, 0x90 }; 0x50, 0x20, 0x70, 0x40, 0x90 };
if (ep->dev->enhanced_mode) if (ep->dev->enhanced_mode) {
reg = ep_enhanced[ep->num]; 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; reg = (ep->num + 1) * 0x10;
if (ep->dev->gadget.speed != USB_SPEED_HIGH) if (ep->dev->gadget.speed != USB_SPEED_HIGH)
reg += 1; reg += 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册