[PATCH] usb: gadget: dwc2_udc_otg: Fix dwc2_gadget_start()

Marek Vasut marex at denx.de
Wed Feb 10 15:26:01 CET 2021


On 2/10/21 3:17 PM, Patrice Chotard wrote:
> Since commit 8745b9ebccae ("usb: gadget: add super speed support")
> ums was no more functional on platform which use dwc2_udc_otg driver.
> 
> Remove the speed test in dwc2_gadget_start() to fix it.
> Tested on stm32mp157c-ev1 board.

Isn't the speed check correct though ?

What is really going on when this fails ?

> Fixes: c791c8431c34 ("usb: dwc2: convert driver to DM_USB_GADGET")
> 
> Signed-off-by: Patrice Chotard <patrice.chotard at foss.st.com>
> ---
> 
>   drivers/usb/gadget/dwc2_udc_otg.c | 10 ++--------
>   1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c
> index e3871e381e..4f3d761eb1 100644
> --- a/drivers/usb/gadget/dwc2_udc_otg.c
> +++ b/drivers/usb/gadget/dwc2_udc_otg.c
> @@ -248,10 +248,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
>   
>   	debug_cond(DEBUG_SETUP != 0, "%s: %s\n", __func__, "no name");
>   
> -	if (!driver
> -	    || (driver->speed != USB_SPEED_FULL
> -		&& driver->speed != USB_SPEED_HIGH)
> -	    || !driver->bind || !driver->disconnect || !driver->setup)
> +	if (!driver || !driver->bind || !driver->disconnect || !driver->setup)
>   		return -EINVAL;
>   	if (!dev)
>   		return -ENODEV;
> @@ -320,10 +317,7 @@ static int dwc2_gadget_start(struct usb_gadget *g,
>   
>   	debug_cond(DEBUG_SETUP != 0, "%s: %s\n", __func__, "no name");
>   
> -	if (!driver ||
> -	    (driver->speed != USB_SPEED_FULL &&
> -	     driver->speed != USB_SPEED_HIGH) ||
> -	    !driver->bind || !driver->disconnect || !driver->setup)
> +	if (!driver || !driver->bind || !driver->disconnect || !driver->setup)
>   		return -EINVAL;
>   
>   	if (!dev)
> 


[...]


More information about the U-Boot mailing list