From patchwork Sat Feb 26 18:41:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Geis X-Patchwork-Id: 546395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 115E9C43219 for ; Sat, 26 Feb 2022 18:42:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232766AbiBZSmf (ORCPT ); Sat, 26 Feb 2022 13:42:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232752AbiBZSmd (ORCPT ); Sat, 26 Feb 2022 13:42:33 -0500 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8146827EC37; Sat, 26 Feb 2022 10:41:58 -0800 (PST) Received: by mail-qk1-x72a.google.com with SMTP id v5so7291275qkj.4; Sat, 26 Feb 2022 10:41:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gOsPhZEWEQuuT2NShwv+/GSU4LHuvEm9yYvo2QoT/EQ=; b=R/KSu7/gavFinTUC20uEgLVG35ZIykqp3uptjNeINv1ka6InCTj1HVRehTJ8MWuNHY cBqTZOU3zOnyrjzc+rsL50Q0aCvVS5LG0+B1bjwzXpXL08iSpSvxBbDer6F0WTniHtSo MiXoxQawrpOodNXq9i85BHHG/FMTh7D0bHEXF/THfg6/LyAhnNG3PXzLm0dYDn8ldFKw +GvBK2hTSIric62sja6XothC9bBtmBWERqVaTTO45wSpSthE1OBUk5PAD5zGnxsyCxyz vUgtwKZSxqmxZC2cf8V1GRpxEmQ0NqOJ+3abZhxGiuFUO2SqzWQiLuWHaliaQAAeiGi3 PzbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gOsPhZEWEQuuT2NShwv+/GSU4LHuvEm9yYvo2QoT/EQ=; b=pF4Io6PQNo+F/FbGmpZDDHKCt/dlrshcLRWwp7yVVbev0GhBHpUnEv0k6HtMIc3wlJ cOtlD3A208dxtrFwZ3AoV/nNquekeH5c/bGNdSYxbUEjVcSl3jlGoCNSUrz0T5eOvN2V FcwBKbqNIwQMlZ+3yRzIj5darWBvgtQNuq/EMSx0nVeVUUAsjxFY+6ftGuYYKi2QkSxH yq/wnYo1cvdfNFjBjEcprvfy+sZ61bGHTIBkQ6+1rtgR7Itk2/NNRbevuefkhawkME3I pcWQWACUKPGvSzAPI0Om7TS9YZhjZSLvpVOG3kIRMAvM2MkCdUdGzxugI9zRpNPvLi8V 05Bg== X-Gm-Message-State: AOAM533dZ7ZGpTRqb6J7J6w9P7ZSxoqB2SfMLgqtLbu/6qGvbo3BsF/v n6bdesqgqVyO89G3Uk27zTw= X-Google-Smtp-Source: ABdhPJxCMJ/DgDWAppj+Kl9sdGzkRlm8iCGGKIndo6Lf3q5EL5QDB1gCMVii5QhrxfaQdKYl/m2dww== X-Received: by 2002:a05:620a:1219:b0:60d:da3e:86d6 with SMTP id u25-20020a05620a121900b0060dda3e86d6mr7557051qkj.473.1645900917626; Sat, 26 Feb 2022 10:41:57 -0800 (PST) Received: from master-x64.sparksnet ([2601:153:980:85b1::10]) by smtp.gmail.com with ESMTPSA id p68-20020a378d47000000b006491d2d1450sm2891983qkd.10.2022.02.26.10.41.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 10:41:57 -0800 (PST) From: Peter Geis To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Heiko Stuebner Cc: linux-rockchip@lists.infradead.org, michael.riesch@wolfvision.net, Peter Geis , linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 03/11] dt-bindings: usb: dwc3: add description for rk3568 Date: Sat, 26 Feb 2022 13:41:39 -0500 Message-Id: <20220226184147.769964-4-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220226184147.769964-1-pgwipeout@gmail.com> References: <20220226184147.769964-1-pgwipeout@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The rk3568 dwc3 controllers are backwards compatible with the rk3399. Add the device tree description for it. Signed-off-by: Peter Geis Acked-by: Rob Herring --- Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml index 04077f2d7faf..b3798d94d2fd 100644 --- a/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/rockchip,dwc3.yaml @@ -30,6 +30,7 @@ select: enum: - rockchip,rk3328-dwc3 - rockchip,rk3399-dwc3 + - rockchip,rk3568-dwc3 required: - compatible @@ -39,6 +40,7 @@ properties: - enum: - rockchip,rk3328-dwc3 - rockchip,rk3399-dwc3 + - rockchip,rk3568-dwc3 - const: snps,dwc3 reg: From patchwork Sat Feb 26 18:41:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Geis X-Patchwork-Id: 546664 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D65D0C433F5 for ; Sat, 26 Feb 2022 18:42:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232810AbiBZSmn (ORCPT ); Sat, 26 Feb 2022 13:42:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232761AbiBZSmg (ORCPT ); Sat, 26 Feb 2022 13:42:36 -0500 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57DFE1E64FC; Sat, 26 Feb 2022 10:42:00 -0800 (PST) Received: by mail-qv1-xf2d.google.com with SMTP id g23so9331368qvb.4; Sat, 26 Feb 2022 10:42:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JPaFw68OuUtIuwUUWQ/YAMH/m6245D2UW9piC4irepM=; b=ohRGljgT9n6KnhWzIuhLOYMf4bAC0dxu6b56hKPwmyQR2gsWwMTrz14Z51YO4pyzTp iLnS19UfDKhkgkv/iN6+wX8hVbk9GrLjjR1XSU/zfMnLNb4TRio7YbcyLP4Qxt1KQQQL UQKbxD+rgoKozrjZwohwOnOROk5jpDk0ma0XXbOqCoKJFcYwzVwtuIJptoOUvcpFz9Hp xpwShpVieevWiy289bGM3OikL75ksOKsxT4g8p0dNGP5ygFWTo3XhzBzME0n2Tz4U7V8 bUnv7P/jvEhCjy7m1d3ythOsojy6Dt3RpC9udGp2AecZfpx6YRnFdxXiam/qzTVqKdH4 Tr/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JPaFw68OuUtIuwUUWQ/YAMH/m6245D2UW9piC4irepM=; b=gx9nRJbixMfHowclL+MJQF87zSaho9TkxgYFpILRdX/Qu0m0Ywnahh+ZO1hJG1zrZr P1ZX5wyyfFIft4GmjOKcrTpVqm7fYnuXMRPbK31R0yiyL1FP7+yfNDTmaXIbcc1l0Q3L 6op7sRXmrRbDZwXII/0sWg57OWKoFUg5ooylJsLGkLgt7HX2ElxxONlqOYdoYRd3o7jS o1yh24K1goadc/qaZ/x2rqCOJu5K8I4jTz9oCKjHRHT67iqg7YFrZE9kIPsAZvEISTd3 1tHi2sBdisY8b9GYyzf05Cl5H5TO8aDynCqlvt7UXJcPOLu2A2pR0OXjE4D68vvc9qNZ 57AQ== X-Gm-Message-State: AOAM531rrHZrCxuOYiLOUUp54eMkgr8GK/4C1yNn/D5ruEiCbOLlywN7 RmyaUP9YlW4He4Nzx9CLOYU= X-Google-Smtp-Source: ABdhPJwJUDRCCIp2NWBMNr9lFrQqnh7qaiYPDRkqrxmJD+kt1LzNR99zq5nU9nI+38qgTE3HZz9VZg== X-Received: by 2002:a05:6214:1c8e:b0:432:4f21:aedb with SMTP id ib14-20020a0562141c8e00b004324f21aedbmr9584724qvb.74.1645900919471; Sat, 26 Feb 2022 10:41:59 -0800 (PST) Received: from master-x64.sparksnet ([2601:153:980:85b1::10]) by smtp.gmail.com with ESMTPSA id p68-20020a378d47000000b006491d2d1450sm2891983qkd.10.2022.02.26.10.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 10:41:59 -0800 (PST) From: Peter Geis To: Felipe Balbi , Greg Kroah-Hartman Cc: linux-rockchip@lists.infradead.org, heiko@sntech.de, michael.riesch@wolfvision.net, Bin Yang , Peter Geis , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 05/11] usb: dwc3: core: do not use 3.0 clock when operating in 2.0 mode Date: Sat, 26 Feb 2022 13:41:41 -0500 Message-Id: <20220226184147.769964-6-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220226184147.769964-1-pgwipeout@gmail.com> References: <20220226184147.769964-1-pgwipeout@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Bin Yang In the 3.0 device core, if the core is programmed to operate in 2.0 only, then setting the GUCTL1.DEV_FORCE_20_CLK_FOR_30_CLK makes the internal 2.0(utmi/ulpi) clock to be routed as the 3.0 (pipe) clock. Enabling this feature allows the pipe3 clock to be not-running when forcibly operating in 2.0 device mode. Signed-off-by: Bin Yang Signed-off-by: Peter Geis --- drivers/usb/dwc3/core.c | 5 +++++ drivers/usb/dwc3/core.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 18adddfba3da..416d83a055fe 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1167,6 +1167,11 @@ static int dwc3_core_init(struct dwc3 *dwc) if (dwc->parkmode_disable_ss_quirk) reg |= DWC3_GUCTL1_PARKMODE_DISABLE_SS; + if (DWC3_VER_IS_WITHIN(DWC3, 290A, ANY) && + (dwc->maximum_speed == USB_SPEED_HIGH || + dwc->maximum_speed == USB_SPEED_FULL)) + reg |= DWC3_GUCTL1_DEV_FORCE_20_CLK_FOR_30_CLK; + dwc3_writel(dwc->regs, DWC3_GUCTL1, reg); } diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index eb9c1efced05..ea3ca04406bb 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -259,6 +259,7 @@ /* Global User Control 1 Register */ #define DWC3_GUCTL1_DEV_DECOUPLE_L1L2_EVT BIT(31) #define DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS BIT(28) +#define DWC3_GUCTL1_DEV_FORCE_20_CLK_FOR_30_CLK BIT(26) #define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW BIT(24) #define DWC3_GUCTL1_PARKMODE_DISABLE_SS BIT(17) From patchwork Sat Feb 26 18:41:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Geis X-Patchwork-Id: 546393 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C04E8C433FE for ; Sat, 26 Feb 2022 18:43:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232790AbiBZSnt (ORCPT ); Sat, 26 Feb 2022 13:43:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232781AbiBZSmh (ORCPT ); Sat, 26 Feb 2022 13:42:37 -0500 Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com [IPv6:2607:f8b0:4864:20::f33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A46F27EC2C; Sat, 26 Feb 2022 10:42:01 -0800 (PST) Received: by mail-qv1-xf33.google.com with SMTP id d3so9322367qvb.5; Sat, 26 Feb 2022 10:42:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ART3VPTUZNh7t0v6KbRBSIgrQKQirMcxNBZ8VtKI13E=; b=BGwaxaoC37S+fVgxW1fQDl1kfafaT1IfFXgMmkQOSrfm+P5E4Aw+KzcmD4DoRix+Lv g4rtOlPzErqWh6/sfSjAlu+CGJKXoSjRFtkGguLtvvgH8OtWmJTeIbG8c+mB4lAw8A34 Cwye2+un5+voVjugHoUsrQx7C2cVZ4tsOw/mal87+xmnVOMvJ2vkgq13lrOmvLLWIbdN nlcTEywk3No8rmA5fIsL9IWVwwieIBVgpgSJueinzwrttSTmF1FRTYnzvYwOqmf3Xjn2 VESivSb9U23X2XKlD7pWJ2U36xGRvOPOhHOyqVplYrJeTtIzcTKOi2SXCUGUKHP0mgi8 g7hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ART3VPTUZNh7t0v6KbRBSIgrQKQirMcxNBZ8VtKI13E=; b=GXxlsSN4HoVMeWyddHBmJ7GR+H/G3jtxGe8JaqIeMzUqJePrtISvaHn71g1SRcJA0E 9nDfIYq/2LOQICpEZuZc8ENIuPosd8VjHP8v/rV+Ve+kQa9QSXbiNrDMoPQXc068LWUG xldmCCji/kxNHD8FBPj1OKdFK9dnZahxlIAOfAtMbC1oPLt4IlC64EveLq4z2W74H/1L kDds6RzzmwzaAf+Y6wTuDVobnDP6DQHvWlSZvOcpzFk0X5jG2Sdt1GgJg3YHPyP4LnJb h9E2i3BXn6WYksn28Pw45NOMwtTAB4jZJW2YWgmEcuYP7C+m+MnQ7PsaGAqvCIImxSgR /QXQ== X-Gm-Message-State: AOAM533iJiuSwW1TTU/nhoPOYDkrzNDY8L88h2br07shHKH1/kmXM1W9 PIsl9uKZRNiDV6Xb9BWF+jk= X-Google-Smtp-Source: ABdhPJwZgSr/DyiHHH2vovnnZ7PAQIm+AH/LuKDHWznqObTdKXELfVozhERENSQ3MPhwqjlSTLtI9g== X-Received: by 2002:ad4:5ba8:0:b0:42c:1046:419e with SMTP id 8-20020ad45ba8000000b0042c1046419emr9768577qvq.119.1645900920340; Sat, 26 Feb 2022 10:42:00 -0800 (PST) Received: from master-x64.sparksnet ([2601:153:980:85b1::10]) by smtp.gmail.com with ESMTPSA id p68-20020a378d47000000b006491d2d1450sm2891983qkd.10.2022.02.26.10.41.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 10:42:00 -0800 (PST) From: Peter Geis To: Felipe Balbi , Greg Kroah-Hartman Cc: linux-rockchip@lists.infradead.org, heiko@sntech.de, michael.riesch@wolfvision.net, Peter Geis , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 06/11] usb: dwc3: reorder dwc-of-simple compatibles Date: Sat, 26 Feb 2022 13:41:42 -0500 Message-Id: <20220226184147.769964-7-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220226184147.769964-1-pgwipeout@gmail.com> References: <20220226184147.769964-1-pgwipeout@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The dwc3-of-simple driver is getting rather disorganized with the new inclusions. Reorder the dwc3-of-simple compatibles to be alphabetical. Signed-off-by: Peter Geis --- drivers/usb/dwc3/dwc3-of-simple.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c index 71fd620c5161..9dc6295df6b1 100644 --- a/drivers/usb/dwc3/dwc3-of-simple.c +++ b/drivers/usb/dwc3/dwc3-of-simple.c @@ -171,12 +171,12 @@ static const struct dev_pm_ops dwc3_of_simple_dev_pm_ops = { }; static const struct of_device_id of_dwc3_simple_match[] = { - { .compatible = "rockchip,rk3399-dwc3" }, - { .compatible = "cavium,octeon-7130-usb-uctl" }, - { .compatible = "sprd,sc9860-dwc3" }, { .compatible = "allwinner,sun50i-h6-dwc3" }, + { .compatible = "cavium,octeon-7130-usb-uctl" }, { .compatible = "hisilicon,hi3670-dwc3" }, { .compatible = "intel,keembay-dwc3" }, + { .compatible = "rockchip,rk3399-dwc3" }, + { .compatible = "sprd,sc9860-dwc3" }, { /* Sentinel */ } }; MODULE_DEVICE_TABLE(of, of_dwc3_simple_match); From patchwork Sat Feb 26 18:41:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Geis X-Patchwork-Id: 546663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7CFBC433F5 for ; Sat, 26 Feb 2022 18:43:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232682AbiBZSnr (ORCPT ); Sat, 26 Feb 2022 13:43:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232783AbiBZSmi (ORCPT ); Sat, 26 Feb 2022 13:42:38 -0500 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FC8F27EDDD; Sat, 26 Feb 2022 10:42:02 -0800 (PST) Received: by mail-qk1-x72e.google.com with SMTP id g24so7310145qkl.3; Sat, 26 Feb 2022 10:42:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=im3jhqbRxcVhFb0LH+3d/Ku9WkG9V/8mj+qtSjXi2MQ=; b=Ghkzii35oEk0YNg6aKLT06vzZxLa3oWyc8XXhLkK50PQvvtyAZ44Poo+pCTWs3/FYP VG+UdXBgWy6ag7Cfs2cHJ0bPZPm7x1GsCwp4nKcdnGWpg1BgbTOaLovYZ+NolLFzqtLH FaOGERTBPDxNQUb/av0MME2hS8Pm4u+1wZ/D424jQg48qq0oDYa0kBkPxZXYvXvCF6nj +zdA2CNMTMbwApgREqeBE3u1+7SK5A3YnjIUTZw45LSTTQhkMe7NV78iTUoXMmUQrZvt 3d+ZfhmhaqTsIo87prgrjpxnO2V3xRAthKeTnexl4kvWUaELlz8MDh8CuRkMDYRIPle9 KiRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=im3jhqbRxcVhFb0LH+3d/Ku9WkG9V/8mj+qtSjXi2MQ=; b=tmZzArOY/tw5gNvOHmFA01OjA6PC6XLiybfio2sI9zxpZkxOrATEJ1GCcEsiUDzqP1 XaeuxmZAiEIr+2buN1Y6j/iCQt7WQGwJu4FF6fZJtEfdenAeZ6rKIvTVyC6vpvY12w8v ovJ/XiLt5Uu396lLscsr6tsoDppBiEwyOS/N8PHLNGF/Ad3liq6HVCfSHb+sj1BItPqK NT+KL0ZE8b0cQmLvAlBeEh3zp7YY6JtP6Nmw9WTTUB2Sq2fHQENa9aYYrSurAMTMrOtM d7jBIcPzeqa495B0VECyqi0s0gu5UkO9AJXMjKc7VWTBjHkINJoMQ6dmmbdccBhsWMDE NGQA== X-Gm-Message-State: AOAM5331uFdV0Nhv13A/HvIJBjbJtfCiTnVbKuR1TxtBEUZW+ZyBHP4K zFhzeFmvsc/EiTI4798WQtSjClVPeHYybA== X-Google-Smtp-Source: ABdhPJym8DP8QPfFSS/2U7TpSb8ylxzl1V/5tXc7tQFPh+tZlC8Q//yyix0ycdxzLkpBzfZ7lwweGQ== X-Received: by 2002:a37:e213:0:b0:5f1:8911:855e with SMTP id g19-20020a37e213000000b005f18911855emr7748469qki.174.1645900921264; Sat, 26 Feb 2022 10:42:01 -0800 (PST) Received: from master-x64.sparksnet ([2601:153:980:85b1::10]) by smtp.gmail.com with ESMTPSA id p68-20020a378d47000000b006491d2d1450sm2891983qkd.10.2022.02.26.10.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 10:42:01 -0800 (PST) From: Peter Geis To: Felipe Balbi , Greg Kroah-Hartman Cc: linux-rockchip@lists.infradead.org, heiko@sntech.de, michael.riesch@wolfvision.net, Peter Geis , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 07/11] usb: dwc3: convert dwc3-of-simple to use match-data Date: Sat, 26 Feb 2022 13:41:43 -0500 Message-Id: <20220226184147.769964-8-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220226184147.769964-1-pgwipeout@gmail.com> References: <20220226184147.769964-1-pgwipeout@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The upcoming support for rk3568 will reuse data from rk3399. Instead of adding a bunch of of_device_is_compatible as we add support for new devices, lets get ahead of the problem and use of_match_data instead. Signed-off-by: Peter Geis --- drivers/usb/dwc3/dwc3-of-simple.c | 39 ++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c index 9dc6295df6b1..57ba9427ad74 100644 --- a/drivers/usb/dwc3/dwc3-of-simple.c +++ b/drivers/usb/dwc3/dwc3-of-simple.c @@ -30,12 +30,16 @@ struct dwc3_of_simple { bool need_reset; }; +struct dwc3_of_simple_data { + bool need_reset; +}; + static int dwc3_of_simple_probe(struct platform_device *pdev) { struct dwc3_of_simple *simple; struct device *dev = &pdev->dev; struct device_node *np = dev->of_node; - + const struct dwc3_of_simple_data *data = of_device_get_match_data(dev); int ret; simple = devm_kzalloc(dev, sizeof(*simple), GFP_KERNEL); @@ -49,8 +53,8 @@ static int dwc3_of_simple_probe(struct platform_device *pdev) * Some controllers need to toggle the usb3-otg reset before trying to * initialize the PHY, otherwise the PHY times out. */ - if (of_device_is_compatible(np, "rockchip,rk3399-dwc3")) - simple->need_reset = true; + if (data->need_reset) + simple->need_reset = data->need_reset; simple->resets = of_reset_control_array_get(np, false, true, true); @@ -170,13 +174,30 @@ static const struct dev_pm_ops dwc3_of_simple_dev_pm_ops = { dwc3_of_simple_runtime_resume, NULL) }; +static const struct dwc3_of_simple_data dwc3_of_simple_data_rk3399 = { + .need_reset = true, +}; + static const struct of_device_id of_dwc3_simple_match[] = { - { .compatible = "allwinner,sun50i-h6-dwc3" }, - { .compatible = "cavium,octeon-7130-usb-uctl" }, - { .compatible = "hisilicon,hi3670-dwc3" }, - { .compatible = "intel,keembay-dwc3" }, - { .compatible = "rockchip,rk3399-dwc3" }, - { .compatible = "sprd,sc9860-dwc3" }, + { + .compatible = "allwinner,sun50i-h6-dwc3", + }, + { + .compatible = "cavium,octeon-7130-usb-uctl", + }, + { + .compatible = "hisilicon,hi3670-dwc3", + }, + { + .compatible = "intel,keembay-dwc3", + }, + { + .compatible = "rockchip,rk3399-dwc3", + .data = &dwc3_of_simple_data_rk3399, + }, + { + .compatible = "sprd,sc9860-dwc3", + }, { /* Sentinel */ } }; MODULE_DEVICE_TABLE(of, of_dwc3_simple_match); From patchwork Sat Feb 26 18:41:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Geis X-Patchwork-Id: 546394 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38778C433EF for ; Sat, 26 Feb 2022 18:42:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232746AbiBZSm6 (ORCPT ); Sat, 26 Feb 2022 13:42:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232802AbiBZSmn (ORCPT ); Sat, 26 Feb 2022 13:42:43 -0500 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05DA727EDF3; Sat, 26 Feb 2022 10:42:03 -0800 (PST) Received: by mail-qt1-x831.google.com with SMTP id w1so5529616qtj.2; Sat, 26 Feb 2022 10:42:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4ghDZEj/NkkDjCwPou92KJHqMKUcvVac9Orj9JeFveY=; b=CoJLuQ9QXYuue/UED91igxeadvZxn8t8dCGl24Y8qKc1xDB7DdJb8fzg3tHjeKN3tY 1j45CS3BKCMyP5CV6I/i6NIWDwE80hMD1TBrR8McazxO2scH1C/mDJJCeykBQJFe3nEn YN2DvqbrT96NCR5sVWJiIxFSIU8K51lna4LokjrgziOATuHdtLpt9d3fUoFhjIw7JjMc YYwWJRnGiyHSS5pG8KLCk0Z6+/ozjutzRvEpYel3rSmJL16jipVF1oD/8OCtZlxWvJEE 6QLbqS0GwLIHqY3sxGVzoAXJuHR/oxwL0CtfiLq4MlLRjW+oZR9vhSFv7D9Edmveb1yZ j76Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4ghDZEj/NkkDjCwPou92KJHqMKUcvVac9Orj9JeFveY=; b=GMaSoMm6YzDxIJGoTvarFPuzI+aMNgKaKRynfIVqTvXOHBVp+sPOpg8XLb5wBU+NiG zRPiGN+MO1w83oAm0UJ6r8MEmfKyKZ+HWBszXB9wyhe13+xxfPfFzODeaOpSJIEnchVw Ln4eeolI1/hVPaVUMNFaFkxhayZWWy/20OqggPRsh0LjZYGiN+QIQDjI3feqFIEPInxn VMJ6Om2VL6xAl1G4IbClpZrFCAeE+sQDH5qkXDXJkv8L1E0qIcAjtbRYcDVOKSmuLYj8 KdLD69XkJUU0oUIsYKV7kLPSo1I1FYFh/lopjIYMt17ES1VtsfA3/lnGEO/Yzvtu5py/ GPdw== X-Gm-Message-State: AOAM53160ZQK6b18HAHcuQJiGQEBZXEpCW0NCz8PBcaCy/Srtt4qwmnV izxgqWU/KIHfLywGmm61/Ys= X-Google-Smtp-Source: ABdhPJzEwVSZFWS6p9V5PNcImVSS6RAQMFHr+8F7FqII+D+lzaGNJjf4jqQ550d71lqAgdgdn161ow== X-Received: by 2002:ac8:5f46:0:b0:2de:783:5bea with SMTP id y6-20020ac85f46000000b002de07835beamr11367722qta.486.1645900922144; Sat, 26 Feb 2022 10:42:02 -0800 (PST) Received: from master-x64.sparksnet ([2601:153:980:85b1::10]) by smtp.gmail.com with ESMTPSA id p68-20020a378d47000000b006491d2d1450sm2891983qkd.10.2022.02.26.10.42.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 10:42:01 -0800 (PST) From: Peter Geis To: Felipe Balbi , Greg Kroah-Hartman Cc: linux-rockchip@lists.infradead.org, heiko@sntech.de, michael.riesch@wolfvision.net, Peter Geis , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 08/11] usb: dwc3: add rk3568 dwc3 support Date: Sat, 26 Feb 2022 13:41:44 -0500 Message-Id: <20220226184147.769964-9-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220226184147.769964-1-pgwipeout@gmail.com> References: <20220226184147.769964-1-pgwipeout@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The rk3568 dwc3 controller is backwards compatible with the rk3399 dwc3 controller. Add support for it to the dwc3-of-simple driver. Signed-off-by: Peter Geis --- drivers/usb/dwc3/dwc3-of-simple.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc3/dwc3-of-simple.c b/drivers/usb/dwc3/dwc3-of-simple.c index 57ba9427ad74..d9d1c5bfac3f 100644 --- a/drivers/usb/dwc3/dwc3-of-simple.c +++ b/drivers/usb/dwc3/dwc3-of-simple.c @@ -195,6 +195,10 @@ static const struct of_device_id of_dwc3_simple_match[] = { .compatible = "rockchip,rk3399-dwc3", .data = &dwc3_of_simple_data_rk3399, }, + { + .compatible = "rockchip,rk3568-dwc3", + .data = &dwc3_of_simple_data_rk3399, + }, { .compatible = "sprd,sc9860-dwc3", },