From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kishon Vijay Abraham I Date: Mon, 18 Aug 2014 19:58:31 +0530 Subject: [U-Boot] [UBOOT RFC PATCH 09/13] common: cmd_dfu: add an API that takes controller index for handling interrupts In-Reply-To: <1408372115-4570-1-git-send-email-kishon@ti.com> References: <1408372115-4570-1-git-send-email-kishon@ti.com> Message-ID: <1408372115-4570-10-git-send-email-kishon@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- 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 -- 1.9.1