diff options
-rw-r--r-- | board/purism/librem5/spl.c | 6 | ||||
-rw-r--r-- | board/samsung/common/exynos5-dt.c | 6 | ||||
-rw-r--r-- | board/st/stih410-b2260/board.c | 6 | ||||
-rw-r--r-- | board/ti/am43xx/board.c | 11 | ||||
-rw-r--r-- | drivers/usb/dwc3/core.c | 25 | ||||
-rw-r--r-- | drivers/usb/dwc3/dwc3-omap.c | 4 | ||||
-rw-r--r-- | include/dwc3-omap-uboot.h | 1 | ||||
-rw-r--r-- | include/dwc3-uboot.h | 1 |
8 files changed, 24 insertions, 36 deletions
diff --git a/board/purism/librem5/spl.c b/board/purism/librem5/spl.c index 581f092..9aadc55 100644 --- a/board/purism/librem5/spl.c +++ b/board/purism/librem5/spl.c @@ -418,12 +418,6 @@ out: return rv; } -int dm_usb_gadget_handle_interrupts(struct udevice *dev) -{ - dwc3_uboot_handle_interrupt(dev); - return 0; -} - static void dwc3_nxp_usb_phy_init(struct dwc3_device *dwc3) { u32 RegData; diff --git a/board/samsung/common/exynos5-dt.c b/board/samsung/common/exynos5-dt.c index 95cf6d2..b3e87c9 100644 --- a/board/samsung/common/exynos5-dt.c +++ b/board/samsung/common/exynos5-dt.c @@ -122,12 +122,6 @@ static struct dwc3_device dwc3_device_data = { .index = 0, }; -int dm_usb_gadget_handle_interrupts(struct udevice *dev) -{ - dwc3_uboot_handle_interrupt(dev); - return 0; -} - int board_usb_init(int index, enum usb_init_type init) { struct exynos_usb3_phy *phy = (struct exynos_usb3_phy *) diff --git a/board/st/stih410-b2260/board.c b/board/st/stih410-b2260/board.c index e21cbc2..8281757 100644 --- a/board/st/stih410-b2260/board.c +++ b/board/st/stih410-b2260/board.c @@ -50,12 +50,6 @@ static struct dwc3_device dwc3_device_data = { .index = 0, }; -int dm_usb_gadget_handle_interrupts(struct udevice *dev) -{ - dwc3_uboot_handle_interrupt(dev); - return 0; -} - int board_usb_init(int index, enum usb_init_type init) { int node; diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c index ea0d0b9..a4679a2 100644 --- a/board/ti/am43xx/board.c +++ b/board/ti/am43xx/board.c @@ -759,17 +759,6 @@ static struct ti_usb_phy_device usb_phy2_device = { .usb2_phy_power = (void *)USB2_PHY2_POWER, .index = 1, }; - -int dm_usb_gadget_handle_interrupts(struct udevice *dev) -{ - u32 status; - - status = dwc3_omap_uboot_interrupt_status(dev); - if (status) - dwc3_uboot_handle_interrupt(dev); - - return 0; -} #endif /* CONFIG_USB_DWC3 */ #if defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_XHCI_OMAP) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 4b4fcd8..09737be 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -983,6 +983,11 @@ void dwc3_uboot_exit(int index) } } +MODULE_ALIAS("platform:dwc3"); +MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>"); +MODULE_LICENSE("GPL v2"); +MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver"); + /** * dwc3_uboot_handle_interrupt - handle dwc3 core interrupt * @dev: device of this controller @@ -1004,10 +1009,22 @@ void dwc3_uboot_handle_interrupt(struct udevice *dev) } } -MODULE_ALIAS("platform:dwc3"); -MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>"); -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; +} + +int dm_usb_gadget_handle_interrupts(struct udevice *dev) +{ + if (!dwc3_uboot_interrupt_status(dev)) + return 0; + + dwc3_uboot_handle_interrupt(dev); + + return 0; +} +#endif #if CONFIG_IS_ENABLED(PHY) && CONFIG_IS_ENABLED(DM_USB) int dwc3_setup_phy(struct udevice *dev, struct phy_bulk *phys) diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index 4fadb4a..53c4d48 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -428,7 +428,7 @@ void dwc3_omap_uboot_exit(int index) } /** - * dwc3_omap_uboot_interrupt_status - check the status of interrupt + * dwc3_uboot_interrupt_status - check the status of interrupt * @dev: device of this controller * * Checks the status of interrupts and returns true if an interrupt @@ -436,7 +436,7 @@ void dwc3_omap_uboot_exit(int index) * * Generally called from board file. */ -int dwc3_omap_uboot_interrupt_status(struct udevice *dev) +int dwc3_uboot_interrupt_status(struct udevice *dev) { struct dwc3_omap *omap = NULL; diff --git a/include/dwc3-omap-uboot.h b/include/dwc3-omap-uboot.h index ed92bfc..f220705 100644 --- a/include/dwc3-omap-uboot.h +++ b/include/dwc3-omap-uboot.h @@ -27,5 +27,4 @@ struct dwc3_omap_device { int dwc3_omap_uboot_init(struct dwc3_omap_device *dev); void dwc3_omap_uboot_exit(int index); -int dwc3_omap_uboot_interrupt_status(struct udevice *dev); #endif /* __DWC3_OMAP_UBOOT_H_ */ diff --git a/include/dwc3-uboot.h b/include/dwc3-uboot.h index 35cfbb9..5f13f5b 100644 --- a/include/dwc3-uboot.h +++ b/include/dwc3-uboot.h @@ -44,6 +44,7 @@ struct dwc3_device { 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; |