MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver");
+#if !CONFIG_IS_ENABLED(DM_USB_GADGET)
+__weak int dwc3_uboot_interrupt_status(struct udevice *dev)
+{
+ return 1;
+}
+
/**
- * dwc3_uboot_handle_interrupt - handle dwc3 core interrupt
+ * dm_usb_gadget_handle_interrupts - handle dwc3 core interrupt
* @dev: device of this controller
*
* Invokes dwc3 gadget interrupts.
*
* Generally called from board file.
*/
-void dwc3_uboot_handle_interrupt(struct udevice *dev)
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
{
struct dwc3 *dwc = NULL;
+ if (!dwc3_uboot_interrupt_status(dev))
+ return 0;
+
list_for_each_entry(dwc, &dwc3_list, list) {
if (dwc->dev != dev)
continue;
dwc3_gadget_uboot_handle_interrupt(dwc);
break;
}
-}
-
-#if !CONFIG_IS_ENABLED(DM_USB_GADGET)
-__weak int dwc3_uboot_interrupt_status(struct udevice *dev)
-{
- return 1;
-}
-
-int dm_usb_gadget_handle_interrupts(struct udevice *dev)
-{
- if (!dwc3_uboot_interrupt_status(dev))
- return 0;
-
- dwc3_uboot_handle_interrupt(dev);
return 0;
}
int dwc3_uboot_init(struct dwc3_device *dev);
void dwc3_uboot_exit(int index);
int dwc3_uboot_interrupt_status(struct udevice *dev);
-void dwc3_uboot_handle_interrupt(struct udevice *dev);
struct phy;
#if CONFIG_IS_ENABLED(PHY) && CONFIG_IS_ENABLED(DM_USB)