[PATCH v4 2/7] usb: dwc3: Switch to device mode on gadget start

Sverdlin, Alexander alexander.sverdlin at siemens.com
Fri Apr 12 22:33:49 CEST 2024


Hi Sjoerd!

On Fri, 2024-01-12 at 09:52 +0100, Sjoerd Simons wrote:
> When dr_mode is "otg" the dwc3 is initially configured in _OTG mode;
> However in this mode the gadget functionality doesn't work without
> further configuration. To resolve that on gadget start switch to _DEVICE
> mode globally and go back to _OTG on stop again.
> 
> For this the dwc3_set_mode is renamed to dwc3_core_set_mode to avoid a
> conflict with the same function exposed by xhci-dwc3
> 
> Signed-off-by: Sjoerd Simons <sjoerd at collabora.com>
> Reviewed-by: Mattijs Korpershoek <mkorpershoek at baylibre.com>

Works for me with both dr_mode "otg" and "peripheral" on AM6232:

Tested-by: Alexander Sverdlin <alexander.sverdlin at siemens.com>

> ---
> 
> Changes in v4:
> - New patch
> 
>  drivers/usb/dwc3/core.c   | 10 +++++-----
>  drivers/usb/dwc3/core.h   |  1 +
>  drivers/usb/dwc3/gadget.c |  6 ++++++
>  3 files changed, 12 insertions(+), 5 deletions(-)

-- 
Alexander Sverdlin
Siemens AG
www.siemens.com


More information about the U-Boot mailing list