@@ -254,6 +254,11 @@ static void dwc3_event_buffers_cleanup(struct dwc3 *dwc)
}
}
+int dwc3_core_gadget_helper(struct dwc3 *dwc)
+{
+ return dwc3_event_buffers_setup(dwc);
+}
+
static int dwc3_alloc_scratch_buffers(struct dwc3 *dwc)
{
if (!dwc->has_hibernation)
@@ -981,6 +981,7 @@ struct dwc3_gadget_ep_cmd_params {
/* prototypes */
void dwc3_set_mode(struct dwc3 *dwc, u32 mode);
int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc);
+int dwc3_core_gadget_helper(struct dwc3 *dwc);
#if IS_ENABLED(CONFIG_USB_DWC3_HOST) || IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE)
int dwc3_host_init(struct dwc3 *dwc);
This helper function, facilitates to re-initialize the event buffers. It re-initilizes the event buffers while switching role from HOST to DEVICE mode. The DWC3 IP shares internal RAM for both HOST and Device specific registers. So while switching roles from HOST to Device modes, it's required to re-initialize the EVENT buffer registers for the Device mode to continue work properly. dwc3_event_buffers_setup() is exported out from core.c via wrapper dwc3_core_gadget_helper() which will be invoked from dwc3 otg driver. Signed-off-by: George Cherian <george.cherian@ti.com> --- drivers/usb/dwc3/core.c | 5 +++++ drivers/usb/dwc3/core.h | 1 + 2 files changed, 6 insertions(+)