From patchwork Mon Aug 18 14:28:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 35525 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F082B20676 for ; Mon, 18 Aug 2014 15:12:32 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lf10sf47412720pab.9 for ; Mon, 18 Aug 2014 08:12:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=Eo9IRIMBzY5rugtqKDkDH94N9JOZ4DAiPMaduHE7PEA=; b=G8HPjbxBimx3mJtVFOLgQ6uuDhO0/U8icNY5o6nA4NuQBri+q8+DIm9rSNIhYz41qm DNspyRUFP/51Ai6tmi6i3WUdGlCgDD1P6M6UDDDvqWkdIYtuO/44WUOtt37m/P4KjVec YVmbd7x6sBC/c3fVNyoYd4ck43udjB/Phok1c7fWa6dXSjkfM/29dlHZRYUTwgLE561d jzen8kiQflxlakoc02N5r+YYG5ZumXneo2WNoHmX5zdiQ7r1z+ZmDc2rCmHvCe2qSR8l ujKDppqGQMRZS6y3XlxClYRGxYyaqK0vCAUegAevFNEFMnNYrjb9/R/eeV7dIOPHCocI tOQA== X-Gm-Message-State: ALoCoQlhqcjNn6w2ZSA4hG8axQGdEb54isKnNcfCuYMlWNHidibsIbMAtBmA6oLALsBYQ5YbwQW5 X-Received: by 10.68.216.231 with SMTP id ot7mr11884320pbc.2.1408374750628; Mon, 18 Aug 2014 08:12:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.130 with SMTP id a2ls2351858qgf.90.gmail; Mon, 18 Aug 2014 08:12:30 -0700 (PDT) X-Received: by 10.52.148.2 with SMTP id to2mr5347580vdb.38.1408374750493; Mon, 18 Aug 2014 08:12:30 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id 20si7209007vdb.67.2014.08.18.08.12.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Aug 2014 08:12:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id hq11so5913784vcb.16 for ; Mon, 18 Aug 2014 08:12:30 -0700 (PDT) X-Received: by 10.221.47.9 with SMTP id uq9mr920789vcb.48.1408374750388; Mon, 18 Aug 2014 08:12:30 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp160502vcb; Mon, 18 Aug 2014 08:12:29 -0700 (PDT) X-Received: by 10.194.58.244 with SMTP id u20mr31929559wjq.36.1408374749157; Mon, 18 Aug 2014 08:12:29 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id ef9si25852149wjd.82.2014.08.18.08.12.28 for ; Mon, 18 Aug 2014 08:12:29 -0700 (PDT) Received-SPF: none (google.com: u-boot-bounces@lists.denx.de does not designate permitted sender hosts) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8F3A04B617; Mon, 18 Aug 2014 17:10:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4EjW8oe4YmxS; Mon, 18 Aug 2014 17:10:27 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 71B694B657; Mon, 18 Aug 2014 17:08:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CE38F4A03B for ; Mon, 18 Aug 2014 16:29:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SwbUIFMZCIJH for ; Mon, 18 Aug 2014 16:29:44 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by theia.denx.de (Postfix) with ESMTPS id 067604B14B for ; Mon, 18 Aug 2014 16:29:05 +0200 (CEST) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s7IET4T7021629 for ; Mon, 18 Aug 2014 09:29:04 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s7IET2LU027580 for ; Mon, 18 Aug 2014 09:29:04 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Mon, 18 Aug 2014 09:29:03 -0500 Received: from a0393678lt.apr.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s7IESbMA003614; Mon, 18 Aug 2014 09:29:01 -0500 From: Kishon Vijay Abraham I To: , , , , , , Date: Mon, 18 Aug 2014 19:58:31 +0530 Message-ID: <1408372115-4570-10-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1408372115-4570-1-git-send-email-kishon@ti.com> References: <1408372115-4570-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 18 Aug 2014 17:07:53 +0200 Subject: [U-Boot] [UBOOT RFC PATCH 09/13] common: cmd_dfu: add an API that takes controller index for handling interrupts X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: kishon@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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