usb: dwc3: gadget: let us set lower max_speed
authorBen McCauley <ben.mccauley@garmin.com>
Mon, 16 Nov 2015 16:47:24 +0000 (10:47 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Dec 2015 19:31:21 +0000 (14:31 -0500)
commitae3bb766f618041ccd882607cb6237a51d63f0ed
tree8018fb6ed87b437a4a8a35c2a959de31522a4e7e
parentb380e1570a80c9f87aaab4201426859816380706
usb: dwc3: gadget: let us set lower max_speed

commit b9e51b2b1fda19143f48d182ed7a2943f21e1ae4 upstream.

In some SoCs, dwc3 is implemented as a USB2.0 only
core, meaning that it can't ever achieve SuperSpeed.

Currect driver always sets gadget.max_speed to
USB_SPEED_SUPER unconditionally. This can causes
issues to some Host stacks where the host will issue
a GetBOS() request and we will reply with a BOS
containing Superspeed Capability Descriptor.

At least Windows seems to be upset by this fact and
prints a warning that we should connect $this device
to another port.

[ balbi@ti.com : rewrote entire commit, including
source code comment to make a lot clearer what the
problem is ]

Signed-off-by: Ben McCauley <ben.mccauley@garmin.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/gadget.c