summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Appleby <Simon.Appleby@pickeringtest.com>2016-02-09 09:19:46 +0000
committerFelipe Balbi <balbi@kernel.org>2016-02-23 08:51:38 +0200
commitca1c11894274c1687417945c034d6b8aee49f625 (patch)
tree9ad0ec398ec33374d3642b6f9aae3e3312d83c94
parent7b0a271d5cadf5fbb5a9c7cb868776af2a2c248c (diff)
downloadlinux-stable-ca1c11894274c1687417945c034d6b8aee49f625.tar.gz
linux-stable-ca1c11894274c1687417945c034d6b8aee49f625.tar.bz2
linux-stable-ca1c11894274c1687417945c034d6b8aee49f625.zip
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 <simon.appleby@pickeringtest.com> Signed-off-by: Felipe Balbi <balbi@kernel.org>
-rw-r--r--drivers/usb/gadget/udc/net2280.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/usb/gadget/udc/net2280.h b/drivers/usb/gadget/udc/net2280.h
index 4dff60d34f73..0d32052bf16f 100644
--- a/drivers/usb/gadget/udc/net2280.h
+++ b/drivers/usb/gadget/udc/net2280.h
@@ -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;