From patchwork Wed Feb 4 08:01:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 44326 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 391D121513 for ; Wed, 4 Feb 2015 08:01:35 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id b13sf148470wgh.1 for ; Wed, 04 Feb 2015 00:01:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=sTk3E3ykXwII5zjbVGRqRF3yD3nJ84JDtS90nqrc34Y=; b=lVVvsq2QPlBBOvXKZGjqpiuiDMZRe+YQqUuYBfvBMvunjO275G50fk04NNB59erw3T +h+dwRkI1bDqxO1StuPWYkkeOMy56ROL8me9srbgBs7Zn+EbmcO+pdMf1UZWkELqjweF avfZNar915FYvPMRvXyAtD4z1BFmo6/NoGlC/FQ9VJZyiR1zhvZzGEKmH2hfEX8waqsB e989XDSD7myP0Z60ng2hulL6NjY4rmrjRQhsgBbeH2LQBLXakyKxRK9EU5j/SXZgAFEA UL5H0qBuXBgcjpWX86+Yhf0yLV50TGzAt1pxHQVuRjJC32NHqRd63hQiQaeLZLz3iiGP Deng== X-Gm-Message-State: ALoCoQlV+fsxJppY6ian+yENzStb2rvCfPJeJvKQGFa7QpipEDxujE9vSLutESMmPR81Qz/FWY4A X-Received: by 10.180.12.146 with SMTP id y18mr117429wib.6.1423036894520; Wed, 04 Feb 2015 00:01:34 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.197 with SMTP id g5ls452lam.99.gmail; Wed, 04 Feb 2015 00:01:34 -0800 (PST) X-Received: by 10.112.27.173 with SMTP id u13mr913332lbg.7.1423036894160; Wed, 04 Feb 2015 00:01:34 -0800 (PST) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id sg5si728282lbb.19.2015.02.04.00.01.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Feb 2015 00:01:34 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id u10so119125lbd.9 for ; Wed, 04 Feb 2015 00:01:34 -0800 (PST) X-Received: by 10.112.144.164 with SMTP id sn4mr23605864lbb.2.1423036894067; Wed, 04 Feb 2015 00:01:34 -0800 (PST) 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.112.35.133 with SMTP id h5csp337844lbj; Wed, 4 Feb 2015 00:01:32 -0800 (PST) X-Received: by 10.68.241.102 with SMTP id wh6mr44075074pbc.18.1423036892624; Wed, 04 Feb 2015 00:01:32 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bk4si1196575pbb.144.2015.02.04.00.01.31; Wed, 04 Feb 2015 00:01:32 -0800 (PST) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754220AbbBDIBa (ORCPT + 4 others); Wed, 4 Feb 2015 03:01:30 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:48423 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752856AbbBDIB3 (ORCPT ); Wed, 4 Feb 2015 03:01:29 -0500 Received: by mail-pa0-f52.google.com with SMTP id kx10so324458pab.11 for ; Wed, 04 Feb 2015 00:01:29 -0800 (PST) X-Received: by 10.66.120.129 with SMTP id lc1mr45235708pab.86.1423036889415; Wed, 04 Feb 2015 00:01:29 -0800 (PST) Received: from localhost.localdomain ([180.150.153.56]) by mx.google.com with ESMTPSA id pp6sm1077738pdb.92.2015.02.04.00.01.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Feb 2015 00:01:27 -0800 (PST) From: Zhangfei Gao To: Mian Yousaf Kaukab , balbi@ti.com, john.youn@synopsys.com Cc: linux-usb@vger.kernel.org, Zhangfei Gao Subject: [PATCH 2/2] usb: dwc2: gadget reuse ahbcfg assigned from platform Date: Wed, 4 Feb 2015 16:01:10 +0800 Message-Id: <1423036870-31392-3-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1423036870-31392-1-git-send-email-zhangfei.gao@linaro.org> References: <1423036870-31392-1-git-send-email-zhangfei.gao@linaro.org> Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: zhangfei.gao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Gadget directly set GAHBCFG_HBSTLEN_INCR4, reuse ahbcfg if assigned from platform Signed-off-by: Zhangfei Gao --- drivers/usb/dwc2/core.c | 2 +- drivers/usb/dwc2/gadget.c | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc2/core.c b/drivers/usb/dwc2/core.c index d5197d4..8d388cc 100644 --- a/drivers/usb/dwc2/core.c +++ b/drivers/usb/dwc2/core.c @@ -2563,7 +2563,7 @@ void dwc2_set_param_reload_ctl(struct dwc2_hsotg *hsotg, int val) void dwc2_set_param_ahbcfg(struct dwc2_hsotg *hsotg, int val) { - if (val != -1) + if (val) hsotg->core_params->ahbcfg = val; else hsotg->core_params->ahbcfg = GAHBCFG_HBSTLEN_INCR4 << diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index 15aa578..20085de 100644 --- a/drivers/usb/dwc2/gadget.c +++ b/drivers/usb/dwc2/gadget.c @@ -2314,9 +2314,13 @@ void s3c_hsotg_core_init_disconnected(struct dwc2_hsotg *hsotg, GINTSTS_USBSUSP | GINTSTS_WKUPINT, hsotg->regs + GINTMSK); + if ((hsotg->core_params) && (hsotg->core_params->ahbcfg != -1)) + val = hsotg->core_params->ahbcfg & ~GAHBCFG_CTRL_MASK; + else + val = GAHBCFG_HBSTLEN_INCR4 << GAHBCFG_HBSTLEN_SHIFT; + if (using_dma(hsotg)) - writel(GAHBCFG_GLBL_INTR_EN | GAHBCFG_DMA_EN | - (GAHBCFG_HBSTLEN_INCR4 << GAHBCFG_HBSTLEN_SHIFT), + writel(GAHBCFG_GLBL_INTR_EN | GAHBCFG_DMA_EN | val, hsotg->regs + GAHBCFG); else writel(((hsotg->dedicated_fifos) ? (GAHBCFG_NP_TXF_EMP_LVL |