From patchwork Fri Jan 6 12:45:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 90161 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp9434394qgi; Fri, 6 Jan 2017 04:57:34 -0800 (PST) X-Received: by 10.99.222.85 with SMTP id y21mr141173491pgi.119.1483707454774; Fri, 06 Jan 2017 04:57:34 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j19si9090020pgn.187.2017.01.06.04.57.34; Fri, 06 Jan 2017 04:57:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762533AbdAFMzc (ORCPT + 25 others); Fri, 6 Jan 2017 07:55:32 -0500 Received: from mail-pg0-f52.google.com ([74.125.83.52]:35295 "EHLO mail-pg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751472AbdAFMyR (ORCPT ); Fri, 6 Jan 2017 07:54:17 -0500 Received: by mail-pg0-f52.google.com with SMTP id i5so187275223pgh.2 for ; Fri, 06 Jan 2017 04:52:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=SRayUMdrRTUpIcY031GOEIJyFC186/Cj5thtrVQ8Or4=; b=HTKeODrRXh/Fno93vPcViNgmNiWcv9ehKTheWmGMC8sAqVlH1xo/6QPcVzy6SYKAUx n5niOWkeq/5fRS5JcPncI20zE96YjAVU3ImpC6RTDBgZrucqVbJgk+0nY2SWp33PEFrC nm3/YZU6UilzOmHoOQ3d8SbLJtG4NSv3kZTAE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=SRayUMdrRTUpIcY031GOEIJyFC186/Cj5thtrVQ8Or4=; b=azjCJK+jEDDB1CtEwBnJtUoRpGAvgfHjJ/s+nynPbrHiRWtgDMPqMShAeG1R8rf4pD xsK83Btt1lFX3qTz1tBBc0hW+tZJdOPFe9CZ74DLC6hfSQVkH9+QiXTsGSHe15MbJbnP gTdh0h4DiI4CFseeSN13mNmoTPNBRq2qivhjQzLsZvaZGTUQsrmnv/R80oY55CpgA87u n42CLPQkNOUbmMukNwh+iV9907qe5rR5cZPdbI7ZMEaXS1LG+afGPsQWntzjZksLHELW 5O9gR+7TiElCxmQjpq1uCBqhSJpoG8MjbNF96wZ0oZsHwHeUYxCXjXE5KZIPGJV4Ogoo gmWQ== X-Gm-Message-State: AIkVDXIhA7PLeJD2ps1DK0R2HAF9BaXIKb7v8/00F3BOGPqcIz45/7VrLG6Mw98Jc9bUftyW X-Received: by 10.99.230.83 with SMTP id p19mr138198789pgj.138.1483706751823; Fri, 06 Jan 2017 04:45:51 -0800 (PST) Received: from localhost.localdomain ([103.192.224.50]) by smtp.gmail.com with ESMTPSA id r88sm160050910pfe.93.2017.01.06.04.45.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 06 Jan 2017 04:45:50 -0800 (PST) From: Leo Yan To: John Youn , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Guodong Xu , John Stultz , Zhangfei Gao Cc: Leo Yan Subject: [PATCH] usb: dwc2: use u32 for DT binding parameters Date: Fri, 6 Jan 2017 20:45:31 +0800 Message-Id: <1483706731-11469-1-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 05ee799f2021 ("usb: dwc2: Move gadget settings into core_params") changes to type u16 for DT binding "g-rx-fifo-size" and "g-np-tx-fifo-size" but use type u32 for "g-tx-fifo-size". Finally the the first two parameters cannot be passed successfully with wrong data format. This is found the data transferring broken on 96boards Hikey. This patch is to change all parameters to u32 type, and verified on Hikey board the DT parameters can pass successfully. Signed-off-by: Leo Yan --- drivers/usb/dwc2/core.h | 4 ++-- drivers/usb/dwc2/params.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) -- 2.7.4 Tested-by: John Stultz diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h index 935ef36..7b2bc39 100644 --- a/drivers/usb/dwc2/core.h +++ b/drivers/usb/dwc2/core.h @@ -496,8 +496,8 @@ struct dwc2_core_params { * properties and cannot be set directly in this structure. */ bool g_dma; - u16 g_rx_fifo_size; - u16 g_np_tx_fifo_size; + u32 g_rx_fifo_size; + u32 g_np_tx_fifo_size; u32 g_tx_fifo_size[MAX_EPS_CHANNELS]; }; diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c index c96ae72..e7b12ef 100644 --- a/drivers/usb/dwc2/params.c +++ b/drivers/usb/dwc2/params.c @@ -402,16 +402,16 @@ static void dwc2_set_param(struct dwc2_hsotg *hsotg, void *param, } /** - * dwc2_set_param_u16() - Set a u16 parameter + * dwc2_set_param_u32() - Set a u32 parameter * * See dwc2_set_param(). */ -static void dwc2_set_param_u16(struct dwc2_hsotg *hsotg, u16 *param, +static void dwc2_set_param_u32(struct dwc2_hsotg *hsotg, u32 *param, bool lookup, char *property, u16 legacy, u16 def, u16 min, u16 max) { dwc2_set_param(hsotg, param, lookup, property, - legacy, def, min, max, 2); + legacy, def, min, max, 4); } /** @@ -1186,12 +1186,12 @@ static void dwc2_set_parameters(struct dwc2_hsotg *hsotg, * auto-detect if the hardware does not support the * default. */ - dwc2_set_param_u16(hsotg, &p->g_rx_fifo_size, + dwc2_set_param_u32(hsotg, &p->g_rx_fifo_size, true, "g-rx-fifo-size", 2048, hw->rx_fifo_size, 16, hw->rx_fifo_size); - dwc2_set_param_u16(hsotg, &p->g_np_tx_fifo_size, + dwc2_set_param_u32(hsotg, &p->g_np_tx_fifo_size, true, "g-np-tx-fifo-size", 1024, hw->dev_nperio_tx_fifo_size, 16, hw->dev_nperio_tx_fifo_size);