From patchwork Thu Feb 5 13:24:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 44426 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 5C0C621521 for ; Thu, 5 Feb 2015 13:24:52 +0000 (UTC) Received: by mail-wg0-f70.google.com with SMTP id b13sf5326185wgh.1 for ; Thu, 05 Feb 2015 05:24:51 -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=RHw04f4O0rfMuu/MRQljuv6sRdvcJKMmzaEMn67N3U0=; b=Rf/ACGgz2DrtB1RQ4zdkqSL0VTGbBo7lCjuG8paTPj6jIHhtWFZZMNh2SWFvJ8fBhW O99HUqXwEu4UAZWLCl+gEUbAglrxrRqxlRv9Adp+m5mLkHZaxZs08blhFIcSe+hGqZeZ jyFxDknHU/PN8IUVEhxz/rP4qGmUN7RinTejDfMyVHxFhoKCpm77FZ77UnXjtuorO1EI nbhPCDwoz8iR2w74NLkMyF9G0Lv5yJkPXdpttCRjsQU0Me0iv+whFow8URStSUVZGcyL idmvISK/0d6WLSuVNktLCKBU0058FLjN4CI1YyuW9ca/a5f5ErW3o53NpqUD+RSd5Lj4 lznA== X-Gm-Message-State: ALoCoQkjts7O7g6BrfRNsm6832WyI5dyz+WNsHOcsRi1blMHF96Tq9DGLCNAIP0BteJ7S/sWDGeZ X-Received: by 10.152.28.71 with SMTP id z7mr489624lag.7.1423142691634; Thu, 05 Feb 2015 05:24:51 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.234 with SMTP id bb10ls154619lab.90.gmail; Thu, 05 Feb 2015 05:24:51 -0800 (PST) X-Received: by 10.152.6.195 with SMTP id d3mr3590928laa.36.1423142691492; Thu, 05 Feb 2015 05:24:51 -0800 (PST) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id e2si3986088lbc.31.2015.02.05.05.24.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Feb 2015 05:24:51 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by mail-lb0-f179.google.com with SMTP id z11so6146651lbi.10 for ; Thu, 05 Feb 2015 05:24:51 -0800 (PST) X-Received: by 10.152.44.170 with SMTP id f10mr13225lam.106.1423142691351; Thu, 05 Feb 2015 05:24:51 -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 h5csp1138870lbj; Thu, 5 Feb 2015 05:24:50 -0800 (PST) X-Received: by 10.70.127.239 with SMTP id nj15mr5629526pdb.136.1423142689459; Thu, 05 Feb 2015 05:24:49 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4si6254019pdk.18.2015.02.05.05.24.48; Thu, 05 Feb 2015 05:24:49 -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 S1757492AbbBENYr (ORCPT + 4 others); Thu, 5 Feb 2015 08:24:47 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:33352 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757241AbbBENYq (ORCPT ); Thu, 5 Feb 2015 08:24:46 -0500 Received: by pdbnh10 with SMTP id nh10so5179042pdb.0 for ; Thu, 05 Feb 2015 05:24:46 -0800 (PST) X-Received: by 10.70.0.166 with SMTP id 6mr3926595pdf.19.1423142686386; Thu, 05 Feb 2015 05:24:46 -0800 (PST) Received: from localhost.localdomain (119.81.172.112-static.reverse.softlayer.com. [119.81.172.112]) by mx.google.com with ESMTPSA id tk7sm5165683pab.23.2015.02.05.05.24.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Feb 2015 05:24:44 -0800 (PST) From: Zhangfei Gao To: Mian Yousaf Kaukab , balbi@ti.com, john.youn@synopsys.com, Sergei Shtylyov Cc: linux-usb@vger.kernel.org, Zhangfei Gao Subject: [PATCH v2 2/2] usb: dwc2: gadget reuse ahbcfg assigned from platform Date: Thu, 5 Feb 2015 21:24:03 +0800 Message-Id: <1423142643-12280-3-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1423142643-12280-1-git-send-email-zhangfei.gao@linaro.org> References: <1423142643-12280-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.179 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..82b520a 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 |