
Since there can be multiple USB controllers in the system, usb_gadget_handle_interrupts should take controller index as arguments. However such an API can only be added in board file so added board_usb_gadget_handle_interrupts(). usb_gadget_handle_interrupts() should be deprecated.
Signed-off-by: Kishon Vijay Abraham I kishon@ti.com --- common/cmd_dfu.c | 1 + include/usb.h | 7 +++++++ 2 files changed, 8 insertions(+)
diff --git a/common/cmd_dfu.c b/common/cmd_dfu.c index 1e7d50c..f27ba52 100644 --- a/common/cmd_dfu.c +++ b/common/cmd_dfu.c @@ -52,6 +52,7 @@ static int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) goto exit;
usb_gadget_handle_interrupts(); + board_usb_gadget_handle_interrupts(controller_index); } exit: g_dnl_unregister(); diff --git a/include/usb.h b/include/usb.h index d9fedee..26c6462 100644 --- a/include/usb.h +++ b/include/usb.h @@ -197,6 +197,13 @@ int board_usb_init(int index, enum usb_init_type init); */ int board_usb_cleanup(int index, enum usb_init_type init);
+/* + * Can be use to handle interrupts from a specific controller. + * + * @index index of the USB controller + */ +int board_usb_gadget_handle_interrupts(int index); + #ifdef CONFIG_USB_STORAGE
#define USB_MAX_STOR_DEV 5