From patchwork Thu Sep 26 01:41:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 278075 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id BFF202C016B for ; Thu, 26 Sep 2013 11:46:18 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1C9684A0C3; Thu, 26 Sep 2013 03:46:17 +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 MF2iUDIgvngL; Thu, 26 Sep 2013 03:46:16 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 886F14A0B6; Thu, 26 Sep 2013 03:45:58 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1EAFE4A0A2 for ; Thu, 26 Sep 2013 03:45:53 +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 hFi45kOE8+rK for ; Thu, 26 Sep 2013 03:45:46 +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 mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) by theia.denx.de (Postfix) with ESMTPS id C24314A08D for ; Thu, 26 Sep 2013 03:45:39 +0200 (CEST) Received: by mail-pd0-f177.google.com with SMTP id y10so444282pdj.8 for ; Wed, 25 Sep 2013 18:45:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eoXod6Tgzig8/vNYyM0YkkT4At2P1gWmehXlnb9G544=; b=A+VmQRak/s29eaRbKIAwQ0COzpCmgBMsTXli3hrj6fEcGdHXtA4wn2OawUPClCmjM+ VvMe9l89Xw8aoUEEIAKNzMnChunKVP3AIrNhbXWRUbqG/Fi35cdC/iWbrsxKADC3I+JV kHiEwtg/rVRBgFwVQOaTpi9TTyFR3cWvnugy71SiLrQcBTFX/LP83jgAEKq/rD2dELUU b3OlW/pE5UcIB0lYfE/J7Y2iFJ6aBKAUHC35wX+Q17vSRcnNKXs92NJ62PaTzAYlNe2Z gW9UJmxyV9+UrRglwTVQucvVSoFGyfrDvrfoMeBgopKdXFy/89xbtjec+bz6koiQ/xCz SLuw== X-Gm-Message-State: ALoCoQk66oCRgFilWRTr48uGY07Lj/SknTXcbjArdF2EQBLp1onEvKqBwSz/j6DHx79QcYzxiLE0 X-Received: by 10.66.189.98 with SMTP id gh2mr2452587pac.60.1380159933363; Wed, 25 Sep 2013 18:45:33 -0700 (PDT) Received: from officeserver-2 ([70.96.116.236]) by mx.google.com with ESMTPSA id ed3sm26657851pbc.6.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 25 Sep 2013 18:45:32 -0700 (PDT) Received: from tkisky by officeserver-2 with local (Exim 4.80) (envelope-from ) id 1VP0a4-0006tp-EB; Wed, 25 Sep 2013 18:41:24 -0700 From: Troy Kisky To: marek.vasut@gmail.com Date: Wed, 25 Sep 2013 18:41:13 -0700 Message-Id: <1380159678-26416-14-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1380159678-26416-1-git-send-email-troy.kisky@boundarydevices.com> References: <1380159678-26416-1-git-send-email-troy.kisky@boundarydevices.com> Cc: fabio.estevam@freescale.com, otavio@ossystems.com.br, leiwen@marvell.com, u-boot@lists.denx.de Subject: [U-Boot] [PATCH V5 13/18] usb: gadget: mv_udc: optimize ep_enable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Only get head if not ep0. Signed-off-by: Troy Kisky --- v4: no change v5: no change --- drivers/usb/gadget/mv_udc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c index 3509aa8..ff3f3b5 100644 --- a/drivers/usb/gadget/mv_udc.c +++ b/drivers/usb/gadget/mv_udc.c @@ -216,10 +216,8 @@ static void mv_ep_free_request(struct usb_ep *ep, struct usb_request *_req) static void ep_enable(int num, int in, int maxpacket) { - struct ept_queue_head *head; struct mv_udc *udc = (struct mv_udc *)controller.ctrl->hcor; unsigned n; - head = mv_get_qh(num, in); n = readl(&udc->epctrl[num]); if (in) @@ -228,6 +226,8 @@ static void ep_enable(int num, int in, int maxpacket) n |= (CTRL_RXE | CTRL_RXR | CTRL_RXT_BULK); if (num != 0) { + struct ept_queue_head *head = mv_get_qh(num, in); + head->config = CONFIG_MAX_PKT(maxpacket) | CONFIG_ZLT; mv_flush_qh(num); }