usb: gadget: dwc2_udc_otg: Fix dwc2_gadget_start() and usb_gadget_register_driver()
authorPatrice Chotard <patrice.chotard@foss.st.com>
Wed, 17 Feb 2021 09:17:27 +0000 (10:17 +0100)
committerMarek Vasut <marex@denx.de>
Fri, 26 Feb 2021 14:30:55 +0000 (15:30 +0100)
commit0a7e5e5f103867789328067f87e34b25b26fc3b0
treee24f60a84868902078487e2c2036aac2df0ed110
parentba0b984bb0246b5ceea29fd0ac9d8b011a30f77b
usb: gadget: dwc2_udc_otg: Fix dwc2_gadget_start() and usb_gadget_register_driver()

Since commit 8745b9ebccae ("usb: gadget: add super speed support")
ums was no more functional on platform which use dwc2_udc_otg driver.

This was due to a too restrictive test which checked that the gadget
driver speed was either FS or HS.

So all gadget driver with max speed set to speed higher than
HS (SS in case of composite gadget driver in our case) are not
allowed, which is wrong.

Update the speed test in usb_gadget_register_driver() and in
dwc2_gadget_start() to allow all gadget driver speed equal or higher
than FS.

Tested on stm32mp157c-ev1 board.

Fixes: c791c8431c34 ("usb: dwc2: convert driver to DM_USB_GADGET")

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
drivers/usb/gadget/dwc2_udc_otg.c