[U-Boot] [PATCH 02/10] drivers: usb: dwc3-omap: move usb_gadget_handle_interrupts from board files to drivers
Mugunthan V N
mugunthanvnm at ti.com
Tue Mar 15 13:14:11 CET 2016
In board files of am437x, dra7xx and am5xx,
usb_gadget_handle_interrupts() is just a place holder to handle
dwc3 interrupts, nothing related to board is handled here, so
move usb_gadget_handle_interrupts() from board files to
dwc3-omap.c to avoid code duplication based on boards.
Signed-off-by: Mugunthan V N <mugunthanvnm at ti.com>
---
board/ti/am43xx/board.c | 11 -----------
board/ti/am57xx/board.c | 11 -----------
board/ti/dra7xx/evm.c | 11 -----------
drivers/usb/dwc3/dwc3-omap.c | 12 ++++++++++++
4 files changed, 12 insertions(+), 33 deletions(-)
diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c
index 770726c..16bbbd1 100644
--- a/board/ti/am43xx/board.c
+++ b/board/ti/am43xx/board.c
@@ -764,17 +764,6 @@ int board_usb_cleanup(int index, enum usb_init_type init)
return 0;
}
-
-int usb_gadget_handle_interrupts(int index)
-{
- u32 status;
-
- status = dwc3_omap_uboot_interrupt_status(index);
- if (status)
- dwc3_uboot_handle_interrupt(index);
-
- return 0;
-}
#endif
#ifdef CONFIG_DRIVER_TI_CPSW
diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c
index 042f9ab..0e9664a 100644
--- a/board/ti/am57xx/board.c
+++ b/board/ti/am57xx/board.c
@@ -411,17 +411,6 @@ int board_usb_cleanup(int index, enum usb_init_type init)
disable_usb_clocks(index);
return 0;
}
-
-int usb_gadget_handle_interrupts(int index)
-{
- u32 status;
-
- status = dwc3_omap_uboot_interrupt_status(index);
- if (status)
- dwc3_uboot_handle_interrupt(index);
-
- return 0;
-}
#endif
#ifdef CONFIG_DRIVER_TI_CPSW
diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
index eebec88..50a9b72 100644
--- a/board/ti/dra7xx/evm.c
+++ b/board/ti/dra7xx/evm.c
@@ -209,17 +209,6 @@ int board_usb_cleanup(int index, enum usb_init_type init)
disable_usb_clocks(index);
return 0;
}
-
-int usb_gadget_handle_interrupts(int index)
-{
- u32 status;
-
- status = dwc3_omap_uboot_interrupt_status(index);
- if (status)
- dwc3_uboot_handle_interrupt(index);
-
- return 0;
-}
#endif
#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_OS_BOOT)
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index afbd845..31d15f5 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -23,6 +23,7 @@
#include <linux/usb/otg.h>
#include <linux/compat.h>
+#include <dwc3-uboot.h>
#include "linux-compat.h"
@@ -445,6 +446,17 @@ int dwc3_omap_uboot_interrupt_status(int index)
return 0;
}
+int usb_gadget_handle_interrupts(int index)
+{
+ u32 status;
+
+ status = dwc3_omap_uboot_interrupt_status(index);
+ if (status)
+ dwc3_uboot_handle_interrupt(index);
+
+ return 0;
+}
+
MODULE_ALIAS("platform:omap-dwc3");
MODULE_AUTHOR("Felipe Balbi <balbi at ti.com>");
MODULE_LICENSE("GPL v2");
--
2.7.2.333.g70bd996
More information about the U-Boot
mailing list