diff options
| author | Marek Vasut <[email protected]> | 2024-03-17 05:42:52 +0100 |
|---|---|---|
| committer | Mattijs Korpershoek <[email protected]> | 2024-04-02 09:08:07 +0200 |
| commit | 4d158980897085a5b0255ab910208d8afc8522dc (patch) | |
| tree | a26bbb4a713c654c950b6055363eca136c665687 /drivers | |
| parent | 42839c0fdf7893200d214200a1bd539fb4fbdf65 (diff) | |
usb: udc: dwc3: Fold board dm_usb_gadget_handle_interrupts() into DWC3 gadget
The dm_usb_gadget_handle_interrupts() has no place in board code. Move
this into DWC3 driver. The OMAP implementation is special, add new weak
dwc3_uboot_interrupt_status() function to decide whether DWC3 interrupt
handling should be called, and override it in OMAP DWC3 code, to repair
the special OMAP interrupt handling code until OMAP gets switched over
to DM UDC proper.
Signed-off-by: Marek Vasut <[email protected]>
Reviewed-by: Caleb Connolly <[email protected]>
Reviewed-by: Mattijs Korpershoek <[email protected]>
Tested-by: Mattijs Korpershoek <[email protected]> # vim3
Tested-by: Caleb Connolly <[email protected]> # qcom sdm845
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mattijs Korpershoek <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/usb/dwc3/core.c | 25 | ||||
| -rw-r--r-- | drivers/usb/dwc3/dwc3-omap.c | 4 |
2 files changed, 23 insertions, 6 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 4b4fcd8a22e..09737be9a9c 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 <[email protected]>"); +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 <[email protected]>"); -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 4fadb4a3e20..53c4d4826b4 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; |
