usb: dwc3: gadget: Allow booting in host mode
Typically gadget drivers will call usb_composite_probe() during
bootup which initializes the UDC. However, for DRD/OTG devices,
if the controller is already activated in host mode,
dwc3_gadget_start() will fail trying to enable ep0, causing the
gadget driver to fail to bind during its probe.
To fix this, skip the device-specific initialization in
dwc_gadget_start() if the driver supports OTG. Instead,
dwc3_gadget_restart() will handle it when device mode is activated
via dwc3_gadget_run_stop(). Finally, factor out the common init
sequence into a new __dwc3_gadget_start() helper.
Change-Id: Ie83da8e4736c367fe72d41928a460b00820701aa
Signed-off-by:
Jack Pham <jackp@codeaurora.org>
Loading
Please register or sign in to comment