From patchwork Thu Aug 12 20:41:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Geis X-Patchwork-Id: 12434203 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65780C4338F for ; Thu, 12 Aug 2021 20:42:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2C023610A8 for ; Thu, 12 Aug 2021 20:42:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2C023610A8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0WQIFFnwuX3Y47SZ/BD/b02nOd7HN9IlehT0xMuuEkE=; b=gKVaz/pfDU16uC ErOeC/9pj8OYKo39mwFALFq2GIchXABzu63XegHoVqBva426V/749WxxflnBnTkCMxgAlDUGznZ/6 vCyXOMU0evBI95qpUrdZSvb4Bre16lLO36suADazvJ5iSV0bPDkDEPj28Y42P5YpWJ8gs29RnC/wx NBJIxNXAV8LO3kqDNfhwakpU4jQcvrDH9disursVWq1zMHD7IpRi475S7gIZF9V+LBC8VU6KZiVxb /OCCFevdHFtm4JQk71fGxwX9YG2XMDetf0EyfRB7c42HlKsa+FCamWq2slltqNrEn78LAkFcIKjsf 8b5QAj6oXcixdvSb6qng==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEHWn-00BBVE-OX; Thu, 12 Aug 2021 20:42:13 +0000 Received: from mail-qv1-xf2e.google.com ([2607:f8b0:4864:20::f2e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEHWY-00BBOG-Sk; Thu, 12 Aug 2021 20:42:00 +0000 Received: by mail-qv1-xf2e.google.com with SMTP id dt3so2087796qvb.6; Thu, 12 Aug 2021 13:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hx5BuYzZPlLV9cghut3Gli/VGI9yvAZxeJLB5iai7aI=; b=Uo0SaS5+c2j3JVzxT/dk+lYUMvJcuYKusi9DYRPX72lmSMv5ww48jGaJBKViR4IXFq 3SY2rQa+xWUpvn6pkxidJGv1rKSPIbooq+NkaSp2tQtOYNS9WeZ7XBtq+VJ3ytjAIsA+ tQc3WGZHG7tAlt3fmXtlkdqgIks6tSwU/7V4IOcp2juhPsBXYO3X151vhLwOBPMqIaC/ IhjCAm6ITN4avuSXbr2r3hbF5EmXkmYtFvQwVLIJ4CH1CvhZ0Bq1VMyUVOgOfqNFoDCq 8HRM5TVIk4dlTfP6udGt0jHNCu3Qbt1zmjOIH5kVxWIcIXV+82NHcyUT82+Q3I2iESuc dg7w== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=hx5BuYzZPlLV9cghut3Gli/VGI9yvAZxeJLB5iai7aI=; b=Q9BosO8iEMVWbUA5iYh4A50YYeyzzmlcU4CIPOe2mpu7ojsIgKALPRh0rvKjcQQ+R7 AB6gDa6Rd58Mrn98FH506iQbe7EPJ6+auBEyAd6kpZ4yAUZ0bwokfqWTZT0ZJbMH4ILd 3wpeJB7g+qOZDh7d0rr3F1/9I6Sa81qqOXqWjJnCt+ZVaE2nHnH2QtXDa48XC6NVmr5g pnf1R2rk6/ERlQ+4/PI6KhNGlz6G2Ts7sob8o7wJs3kOD1ht+VGK4UAIg0F29luKa+Oe iaEWUWlBcqTAupZERH1UiCqooCpCMzERe2DIep62PzzEYAvr7CIs7Q6H/7C0f11NwZ7F pEUQ== X-Gm-Message-State: AOAM532CspiZC5Y8tG4HkXConFDtXqOPLD5u+X40rvoKHcUnJ7jqhl7D 2eDT2UeHVdk6IgnDwmmdzfY= X-Google-Smtp-Source: ABdhPJzjHPWchl6zyo/ohEEqq2f1YdiTc1K38TF7iQgvhO/0YWaAWT/TrAAEri29ZU6KZ0Hve9zsLg== X-Received: by 2002:a0c:fdcc:: with SMTP id g12mr5953858qvs.54.1628800917825; Thu, 12 Aug 2021 13:41:57 -0700 (PDT) Received: from master-laptop.sparksnet ([2601:153:980:85b1:e89f:d077:9161:1bd7]) by smtp.gmail.com with ESMTPSA id m16sm1940361qki.19.2021.08.12.13.41.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Aug 2021 13:41:57 -0700 (PDT) From: Peter Geis To: Rob Herring , Heiko Stuebner Cc: Peter Geis , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/8] dt-bindings: soc: rockchip: add rk3568-usb2phy-grf Date: Thu, 12 Aug 2021 16:41:09 -0400 Message-Id: <20210812204116.2303617-2-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210812204116.2303617-1-pgwipeout@gmail.com> References: <20210812204116.2303617-1-pgwipeout@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210812_134158_973452_1312FE5C X-CRM114-Status: GOOD ( 10.55 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Add the documentation for the rk3568-usb2phy-grf node, which is separate from the usb2phy node on this chip. Signed-off-by: Peter Geis Acked-by: Rob Herring --- Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml index fa010df51a5c..78ff91db0f06 100644 --- a/Documentation/devicetree/bindings/soc/rockchip/grf.yaml +++ b/Documentation/devicetree/bindings/soc/rockchip/grf.yaml @@ -15,6 +15,7 @@ properties: - items: - enum: - rockchip,rk3288-sgrf + - rockchip,rk3568-usb2phy-grf - rockchip,rv1108-usbgrf - const: syscon - items: From patchwork Thu Aug 12 20:41:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Geis X-Patchwork-Id: 12434207 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D1D3C432BE for ; Thu, 12 Aug 2021 20:42:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 27E80610A3 for ; Thu, 12 Aug 2021 20:42:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 27E80610A3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KxRErpWpVSAksEb3wvaLtE7fl3uw5p35r7I3QVOwoGk=; b=ZpCCNpEkdeG4bp N2FyAPs38zAG9SyD5Ih8J9laGuTxNBblZZd46uQe7v3Lz987n9jHU9qM2cpWEWSdZ0Ub5f+yM5hMR rM1ZMbvKBepflVwr7++LWtnPTi2X/Zr8LUE6fdra+DPG8lptXY4vsWiohH6msOHRz116JxWmJvENy PvEKXsmmNbpjo9uerdZ0YZjsi+yecuyXrmeEdzAb/9vPh1dUnkv7cxbLwOITcQCUd7UmIDElit7h1 /3WYiZmxSLk1yQywAf88AVg/thUbK8Q8XPOPDKeLXeSwT8RFKa7YPDUjoiBeJMJ2j0exrtMgWjDId hRDNWMmU4nvEozZFoGdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEHXM-00BBmG-Uw; Thu, 12 Aug 2021 20:42:48 +0000 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEHWa-00BBOm-70; Thu, 12 Aug 2021 20:42:01 +0000 Received: by mail-qk1-x72a.google.com with SMTP id f23so8203230qkk.13; Thu, 12 Aug 2021 13:41:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ochq/82t5xUPXvIID1znrVTmhLe5E8Izsp9c+gWvjrs=; b=Ed+L/+HybSvG4ub6uDGYR4D3031+XqS2vV/V6Zxga1iPxvcAIKPkTXPVoHkCVCs+Jc OKUpjvQMuusgI+rqnw2LTK+aJ2VxMT5xjukAFHS3q+mwW19KSl6HlxU63WGj3x3RBAvr MOxZmmj52Fo0YcckO8dSOhTrhBgiP/5R1ePBp9JKzIxrBtfztUWJVSOBO1JfHLFdW7Ba hspMqOkcp9js009uvTsU7HDcdWMpXA0UoLF0DX8sgc+tZBK0fMs8MFs+UTAtwUJOk+IX WwjfNLmZKGHiCxD4PV3ngGlugVyUsslMv0PxzSi4LsJAmzoGCndHxLA6WC6pg748Bk/W oy/w== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ochq/82t5xUPXvIID1znrVTmhLe5E8Izsp9c+gWvjrs=; b=i9UcV4/NQ6+0JllXiP0fcNPkeK89OCMF0Q4zvL2z3F5m4W3vFkkrU79FIvJUrSkTY7 9NUX87ZEKh75WLuUxJdpf+HMX/afxzblNB5GuCOY16Ko03R6TRUdDvV/xrnMClA+/PEz PfLwF0oTYmuaQyI1mBsynTHNatg33UPQDBhAa5LyArc/KhDuH5B+qVwd6oc3KyOualw8 MMPN7TBBu7yrYBBBE1ziVJh/zRoul0yKiDrNgughMiDt1h9cdA31c+KggKwbFfzHAP7c AQhS8rdrpIcvpVBzywVHlHrN7sj9JHpC5dqGrAYPQXEQiv7cIurYb1xWkRVqmJeQwbvY Ltgg== X-Gm-Message-State: AOAM5314e/5u8Lb8+vPLHrbHi7r28w+UuhJLS4oKolZB6KetbA6GyXcE vpu7Mfl9t8DE402hVwvfT74= X-Google-Smtp-Source: ABdhPJxc8txTOhaH5bN7e5C0ZZdy7/xbhS9z9tOTuYM+5y6GbHfXe3ZldmfmU/BYBbYY0BHqOmGbkQ== X-Received: by 2002:a37:43ca:: with SMTP id q193mr6552744qka.459.1628800919041; Thu, 12 Aug 2021 13:41:59 -0700 (PDT) Received: from master-laptop.sparksnet ([2601:153:980:85b1:e89f:d077:9161:1bd7]) by smtp.gmail.com with ESMTPSA id m16sm1940361qki.19.2021.08.12.13.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Aug 2021 13:41:58 -0700 (PDT) From: Peter Geis To: Kishon Vijay Abraham I , Vinod Koul , Rob Herring , Heiko Stuebner Cc: Peter Geis , linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/8] dt-bindings: phy: phy-rockchip-inno-usb2: add rk3568 documentation Date: Thu, 12 Aug 2021 16:41:10 -0400 Message-Id: <20210812204116.2303617-3-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210812204116.2303617-1-pgwipeout@gmail.com> References: <20210812204116.2303617-1-pgwipeout@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210812_134200_300382_86591A3B X-CRM114-Status: GOOD ( 11.18 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The rk3568 usb2phy node is a standalone node with a single muxed interrupt. Add documentation for it to phy-rockchip-inno-usb2. Signed-off-by: Peter Geis --- .../bindings/phy/phy-rockchip-inno-usb2.yaml | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml index 5bebd86bf8b6..d2a749c3f9a3 100644 --- a/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-inno-usb2.yaml @@ -18,6 +18,7 @@ properties: - rockchip,rk3328-usb2phy - rockchip,rk3366-usb2phy - rockchip,rk3399-usb2phy + - rockchip,rk3568-usb2phy - rockchip,rv1108-usb2phy reg: @@ -50,6 +51,9 @@ properties: description: Phandle to the extcon device providing the cable state for the otg phy. + interrupts: + description: Muxed interrupt for both ports + rockchip,usbgrf: $ref: /schemas/types.yaml#/definitions/phandle description: @@ -78,8 +82,6 @@ properties: required: - "#phy-cells" - - interrupts - - interrupt-names otg-port: type: object @@ -109,8 +111,6 @@ properties: required: - "#phy-cells" - - interrupts - - interrupt-names required: - compatible @@ -120,6 +120,29 @@ required: - host-port - otg-port +allOf: + - if: + properties: + compatible: + contains: + const: rockchip,rk3568-usb2phy + then: + properties: + interrupts: + maxItems: 1 + required: + - interrupts + else: + properties: + host-port: + required: + - interrupts + - interrupt-names + otg-port: + required: + - interrupts + - interrupt-names + additionalProperties: false examples: From patchwork Thu Aug 12 20:41:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Geis X-Patchwork-Id: 12434209 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F9DFC432BE for ; Thu, 12 Aug 2021 20:43:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 66C50610CC for ; Thu, 12 Aug 2021 20:43:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 66C50610CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4jtQq9IlMBC1gYIjIeCYdITCc7AigiI328qIQRHh9J4=; b=QxIrtd22IMNQaL zhGE3hmosUp9EBCjzAzQPhh0knky3h3uqHL5R/g+uRSKTjACEx6kF2YkwAtVz2DLaNbq+scd+lg+I o+6nudCNyXrLE52M5AXeSYEi77BYzixlE5DSAfRDI9VVtui0tC51RDmA8p9xnSIAoxaNqV4tjbvT0 Gs7XJuI+G9uijeMfxMj7KPdjNu37rw6HYgaie5MnzKa+manNqicPvX4fOOPQ6vwLvcgyVM/Oc4FLC AY/0Ho59jTIRX6CqktrG0wV9Kc54wFeI+Tlm9MaFCTl+Vo7RQ73xxBqeo6n33OyYhBrUSGsHY7ltu Q3BPmcRYKxd2BiHSiasA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEHXh-00BBxh-E7; Thu, 12 Aug 2021 20:43:09 +0000 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEHWb-00BBP9-2n; Thu, 12 Aug 2021 20:42:02 +0000 Received: by mail-qk1-x734.google.com with SMTP id y130so8265002qkb.6; Thu, 12 Aug 2021 13:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ggW256M3SIcZiGvGqGuspKz5dguh2TkojKgtWRP6iJo=; b=t1W1hIvV0te5vPrxMds68WtR52qT21pqllsiWQ4EdrsevpXRuUZnxXIl5qHRbeUKud 9PN6GoVqsYPuDsx7pi32SNuSqOfURq9S31XUJV/AlJd0iywelRrQmbl/OkkSbSIU9aj1 Mtb23C5te0dfzD8gkBPfn7Zn7O1BmMZZ2Vj2ptM9z69YebxBooi4wimZ4liyXX2ddbch OrYgutQBIxSZfehRX8I8oI6UUch0Re8p5DMgGbrbTH6AehG0dHunC65FbcJV2TSgrxQc RbHAseLHF2JwHcI2FEDLV18o9MijWzchENcsVLda2q16CcVzVCETsEAeHlmbl+LQ+vxn Es2A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ggW256M3SIcZiGvGqGuspKz5dguh2TkojKgtWRP6iJo=; b=Mv5lmooHzVmusl0cSE8DG/HPU2sCb97MgRPMj19ik00U3dMyXeA2sEsGAYmhekzIxY JHBZPnRqay585gY/d2sjH2RgfLF9nol7VC1pfkN/+HqR9VCZrcvqdQqBDrhphc200G0B Zix2TQTyz4BphUcPNPJ34kdx2s8Tp9s9JeYvrPhIg5xlywQ+azIPrOp9G8nStqbw1G8Y jLRmDnFEV2iKVkWnotlpaDgho2hHZTp/RzZ2Uw388bo2JQpeZEh+2ob1A/OYo7SLxhmO 8tI76o9OBQ9eimt9pjNSu6ww6t2FCm0hPQVaZHBvFPIapWsw0HQbbVO1rXVI+9mqie+r qY/A== X-Gm-Message-State: AOAM532RFUlMhZ0OixsZxtMdx8X4yySraRCShr0xlRQBHka5kWfCaIpW wu9NspyP1Wo9fNdOK1iqmGk= X-Google-Smtp-Source: ABdhPJwz50s1sUzGtczLj6lnVE9J9Egy2qsDbNPpOk2wPPVMdrvu2dFxJKuLLxvmd8wuc8hmQwDo8Q== X-Received: by 2002:a37:9643:: with SMTP id y64mr6224821qkd.213.1628800920037; Thu, 12 Aug 2021 13:42:00 -0700 (PDT) Received: from master-laptop.sparksnet ([2601:153:980:85b1:e89f:d077:9161:1bd7]) by smtp.gmail.com with ESMTPSA id m16sm1940361qki.19.2021.08.12.13.41.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Aug 2021 13:41:59 -0700 (PDT) From: Peter Geis To: Kishon Vijay Abraham I , Vinod Koul , Heiko Stuebner Cc: Peter Geis , linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/8] phy: phy-rockchip-inno-usb2: support #address_cells = 2 Date: Thu, 12 Aug 2021 16:41:11 -0400 Message-Id: <20210812204116.2303617-4-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210812204116.2303617-1-pgwipeout@gmail.com> References: <20210812204116.2303617-1-pgwipeout@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210812_134201_169002_1258E73F X-CRM114-Status: GOOD ( 14.41 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org New Rockchip devices have the usb phy nodes as standalone devices. These nodes have register nodes with #address_cells = 2, but only use 32 bit addresses. Adjust the driver to check if the returned address is "0", and adjust the index in that case. Signed-off-by: Peter Geis --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index beacac1dd253..5d2916143df7 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1098,12 +1098,21 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) rphy->usbgrf = NULL; } - if (of_property_read_u32(np, "reg", ®)) { + if (of_property_read_u32_index(np, "reg", 0, ®)) { dev_err(dev, "the reg property is not assigned in %pOFn node\n", np); return -EINVAL; } + /* support address_cells=2 */ + if (reg == 0) { + if (of_property_read_u32_index(np, "reg", 1, ®)) { + dev_err(dev, "the reg property is not assigned in %pOFn node\n", + np); + return -EINVAL; + } + } + rphy->dev = dev; phy_cfgs = match->data; rphy->chg_state = USB_CHG_STATE_UNDEFINED; From patchwork Thu Aug 12 20:41:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Geis X-Patchwork-Id: 12434211 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B05AEC4320A for ; Thu, 12 Aug 2021 20:43:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7A921610CC for ; Thu, 12 Aug 2021 20:43:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7A921610CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/C71Kc4e5Arg2agMre/YatC3tVJEALM7xJnZYx6s3Ik=; b=Rgy05DrAiExZzE VsWpt1wPlvKrg5fIw5z389mUHLjyXIXe/ztnN+fdfxTBAgfux539wrHe9+jcwFyh26JIZYOl247AI A+IBFp0ADdj0KVckg5prHlBwYg1SeQXjcJ8Q18QVEm2lXw1rPLxFb6N/3Lqzu0le8vnoR0V/RWV6u Y5YNTNtxbEzOoJZgZnxHbV0jsHGN/UZqaa5mI2W9ZEuME+5tji8eP8vBUeNcAIXF8FeUB+gsvK5Ug jC3DzTdq+Qp4zkwTam1BQt0DeuhU4GK8A/Mv/MJbWPsz4g4Yqe31Vihithh2ext1Nk/aTYfjCCoR7 8/xbE908m/XYRSRSbWtw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEHYB-00BCFJ-6b; Thu, 12 Aug 2021 20:43:39 +0000 Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEHWc-00BBPt-1v; Thu, 12 Aug 2021 20:42:03 +0000 Received: by mail-qt1-x834.google.com with SMTP id d2so6397082qto.6; Thu, 12 Aug 2021 13:42:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yXImnqZERav+3w/cyHb8wggYxQXzQW+9n8PpB8P0B2M=; b=usm5jESwVuEx39403DEzOX/iOpRPGkXcTdPc6I/xDG/6cl72ZcYCdVnAoCHJUeyZ9/ KD5H3a0mCF5PjztxPo+5cr6SHbpbiJPCCEptDNN/2/bkj/O5kkopxXhmWAyjqLumLWO7 aBfLXfcVC3Iv2KZtneyMTow7xHrRF7uuAUkxYwj6T5rTu4p3JBhjzsxPogYFZYD2KIkp h7VKKq6nD43UXSmTVJfcHKt2LDJqfSIFIWtIoVqIyOtOYWweeB75a+LG0eSsvl4JqSgi dBx1CjNXqcBlGLgxRS/cObY47JiCHWKWbyaSmXh0DoktqUH1u8G0p1YV0EV9yIgXAMpE L9Eg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=yXImnqZERav+3w/cyHb8wggYxQXzQW+9n8PpB8P0B2M=; b=Ctt2LkbC1CVFA5kJZvxRemUgvshUdpUVWSfmOHPmZtMO+wxdj4GWC6S0uzxhakyuBZ yRd4twIaKUndzpbJ9P28BFx4S7QaF7v+9vgt+yuohykgma8GVhwxHc7GkcYbaaI6xJrU tacfpwJXQ8CyP/Nb9XhtecKU2RRu6kXaUq0WNlqVQsfS63epik32avP1ZQowjImL6Cr3 WjodvluQ3udEiJtJb54SJrCsEHncapA1r6+P9oQMKcOc8A+AeMPhSnmAfj6NNBVGFZ/2 yLSKW08UU/8vzDwD+aj9Q+RN7OfHG4SH5EK8FkzcKBkLU25Ht3kEBh1yMl4KiqsynG/X NjxQ== X-Gm-Message-State: AOAM532D5fd9wqGkfMsQH3z/tPF8RfmIjL6F9GPyS9hx6DFJLud3yWiK NBIOZwV04NgENERpVY7LlPM= X-Google-Smtp-Source: ABdhPJy2RX7/mb2/P2Gi72QdHX2DsNgx/ybOEpWl/TEzJP8z0OZU2joHZRJ1zmu0jAe+6w9/N6s6dg== X-Received: by 2002:a05:622a:2c8:: with SMTP id a8mr5634300qtx.137.1628800921025; Thu, 12 Aug 2021 13:42:01 -0700 (PDT) Received: from master-laptop.sparksnet ([2601:153:980:85b1:e89f:d077:9161:1bd7]) by smtp.gmail.com with ESMTPSA id m16sm1940361qki.19.2021.08.12.13.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Aug 2021 13:42:00 -0700 (PDT) From: Peter Geis To: Kishon Vijay Abraham I , Vinod Koul , Heiko Stuebner Cc: Peter Geis , linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/8] phy: phy-rockchip-inno-usb2: support standalone phy nodes Date: Thu, 12 Aug 2021 16:41:12 -0400 Message-Id: <20210812204116.2303617-5-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210812204116.2303617-1-pgwipeout@gmail.com> References: <20210812204116.2303617-1-pgwipeout@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210812_134202_145077_1A1D4436 X-CRM114-Status: GOOD ( 13.29 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org New Rockchip devices have the usb2 phy devices as standalone nodes instead of children of the grf node. Allow the driver to find the grf node from a phandle. Signed-off-by: Peter Geis --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 5d2916143df7..84a0c1d697da 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1081,12 +1081,19 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) return -EINVAL; } - if (!dev->parent || !dev->parent->of_node) - return -EINVAL; + if (!dev->parent || !dev->parent->of_node) { + rphy->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,usbgrf"); + if (IS_ERR(rphy->grf)) { + dev_err(dev, "failed to locate usbgrf\n"); + return PTR_ERR(rphy->grf); + } + } - rphy->grf = syscon_node_to_regmap(dev->parent->of_node); - if (IS_ERR(rphy->grf)) - return PTR_ERR(rphy->grf); + else { + rphy->grf = syscon_node_to_regmap(dev->parent->of_node); + if (IS_ERR(rphy->grf)) + return PTR_ERR(rphy->grf); + } if (of_device_is_compatible(np, "rockchip,rv1108-usb2phy")) { rphy->usbgrf = From patchwork Thu Aug 12 20:41:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Geis X-Patchwork-Id: 12434213 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36DBCC432BE for ; Thu, 12 Aug 2021 20:44:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E120A610A3 for ; Thu, 12 Aug 2021 20:44:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E120A610A3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8z03N2O2Z9Htfu10dgwLb6fWm/q7vUgcaZHZShP8buY=; b=F4391C6xdIzcmA F0MSaNv5L2ljlxlz4ZvIUpS/XcdbTxwd7kJmRt65/D3FrqiYEHzmuybpNW87rKdnvhALy5q69f+iA vqJmDnXfHfJrUyVUIITVxknh6YoVp6rAF+MleRgS9iUq3yjGSEpPRRBDMHEfdDsKm5plXmLMw8BrB FScGsMJfhKR/QezHmKw/IsX3omG9pMrvkCvO/hkYXMZDCHnuLGsEs2TzbDyQO1nV3gwc5PRnAsSnc S4PmxcrHRzoAZwPlVFHHSvSs+/yaXQEqDhcae7DselIdzsf3m4ysjkyj61DPQToSeBDyzX9Wexgpc 0Ugox6QAjKBr9TR+/mRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEHYu-00BCfK-B0; Thu, 12 Aug 2021 20:44:24 +0000 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEHWc-00BBQS-VJ; Thu, 12 Aug 2021 20:42:04 +0000 Received: by mail-qk1-x734.google.com with SMTP id t3so8235447qkg.11; Thu, 12 Aug 2021 13:42:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jV3+d13+BlvVKdHvamJ73f10IOo4fLZB7GTSxjSftek=; b=Zuzv/I+FVw2M1t/wdbOUlEGYA5wI6WSjciqkWH6PkNENhgzU7aEEOSpytnvm6JeFx2 4yfRx0/OqCAaXHSirS/WBw8P3LYKXW73J3xBwgI4bZkRcPMLQJwZ9jpmlMAm0lQW++II 9t7Q/GGv2IqZpo3msgGdg8gQ0vQSxckuX2fY4Alo+u4JiWe+OWkD161oAC9q9L0m4Wdn r4cXp1qL9SFiEg80fluK6LUxXsfpHX635NZSep6qMh9mBf1YdnsZx00VuOk0w0ojM6RE 7WZQXXLie1tVGh5AAk6FYKjo62SGBTwgVqDANoDVRgLgnqHaF/Ys04FYF1hqj4wj7Kp/ tp6Q== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=jV3+d13+BlvVKdHvamJ73f10IOo4fLZB7GTSxjSftek=; b=YyeuW0RIxo1P3uR4eTwOOeg2JD7muI7W+Hn8/XXzVub9f5+lXuEIv68/OUAAye1fS4 EaFg4AE3QIQ3nIHEw9qNOGvwwgfXJgn4PZfxgJK0aDESswZt6hwaCPJsrnP7ZKUl6JBe Dx4W7x0Yc8VDNagswGuGJHImyrQOFQEkM8MbnUblGFkmSDDQNJZ1UUcCUQl31qY9KlHr fHde1otztfd3qgXtbS36Qsr8NBmwnjWsfmlD4Mr+dQAhOvvCCJGDFYMMgRsW1uHXD6+C pueqNze2q7aX6EwJnVrRaX/E/RFPTpz/XVVOYsuq8A4V8e/JOki+6EaQLhRNsVV4iUxN Yj1Q== X-Gm-Message-State: AOAM533oDGEBsz+Qu4T1tb1aqI2Qx1hB+YRr2KSm3kxNOad6XSDBKPQ9 oosaSHJ24CmXh2pmAToebuw= X-Google-Smtp-Source: ABdhPJyrnT6PORGjrTDgySqbzkzSUbFYzqIA1bWHZIgwb7kGDQIv/+5gNYYb0UkJSgl3ItgM3Weaiw== X-Received: by 2002:a05:620a:22b0:: with SMTP id p16mr6668847qkh.346.1628800922084; Thu, 12 Aug 2021 13:42:02 -0700 (PDT) Received: from master-laptop.sparksnet ([2601:153:980:85b1:e89f:d077:9161:1bd7]) by smtp.gmail.com with ESMTPSA id m16sm1940361qki.19.2021.08.12.13.42.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Aug 2021 13:42:01 -0700 (PDT) From: Peter Geis To: Kishon Vijay Abraham I , Vinod Koul , Heiko Stuebner Cc: Peter Geis , linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/8] phy: phy-rockchip-inno-usb2: support muxed interrupts Date: Thu, 12 Aug 2021 16:41:13 -0400 Message-Id: <20210812204116.2303617-6-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210812204116.2303617-1-pgwipeout@gmail.com> References: <20210812204116.2303617-1-pgwipeout@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210812_134203_084074_0C2032B9 X-CRM114-Status: GOOD ( 21.34 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The rk3568 usb2phy has a single muxed interrupt that handles all interrupts. Allow the driver to plug in only a single interrupt as necessary. Signed-off-by: Peter Geis --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 168 +++++++++++++----- 1 file changed, 119 insertions(+), 49 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 84a0c1d697da..fdeb2e7c937a 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -204,6 +204,7 @@ struct rockchip_usb2phy_port { * @dcd_retries: The retry count used to track Data contact * detection process. * @edev: extcon device for notification registration + * @irq: muxed interrupt for single irq configuration * @phy_cfg: phy register configuration, assigned by driver data. * @ports: phy port instance. */ @@ -218,6 +219,7 @@ struct rockchip_usb2phy { enum power_supply_type chg_type; u8 dcd_retries; struct extcon_dev *edev; + int irq; const struct rockchip_usb2phy_cfg *phy_cfg; struct rockchip_usb2phy_port ports[USB2PHY_NUM_PORTS]; }; @@ -934,6 +936,102 @@ static irqreturn_t rockchip_usb2phy_otg_mux_irq(int irq, void *data) return IRQ_NONE; } +static irqreturn_t rockchip_usb2phy_irq(int irq, void *data) +{ + struct rockchip_usb2phy *rphy = data; + struct rockchip_usb2phy_port *rport; + irqreturn_t ret = IRQ_NONE; + unsigned int index; + + for (index = 0; index < rphy->phy_cfg->num_ports; index++) { + rport = &rphy->ports[index]; + if (!rport->phy) + continue; + + /* Handle linestate irq for both otg port and host port */ + ret = rockchip_usb2phy_linestate_irq(irq, rport); + } + + return ret; +} + +static int rockchip_usb2phy_port_irq_init(struct rockchip_usb2phy *rphy, + struct rockchip_usb2phy_port *rport, + struct device_node *child_np) +{ + int ret; + + /* + * If the usb2 phy used combined irq for otg and host port, + * don't need to init otg and host port irq separately. + */ + if (rphy->irq > 0) + return 0; + + switch (rport->port_id) { + case USB2PHY_PORT_HOST: + rport->ls_irq = of_irq_get_byname(child_np, "linestate"); + if (rport->ls_irq < 0) { + dev_err(rphy->dev, "no linestate irq provided\n"); + return rport->ls_irq; + } + + ret = devm_request_threaded_irq(rphy->dev, rport->ls_irq, NULL, + rockchip_usb2phy_linestate_irq, + IRQF_ONESHOT, + "rockchip_usb2phy", rport); + if (ret) { + dev_err(rphy->dev, "failed to request linestate irq handle\n"); + return ret; + } + break; + case USB2PHY_PORT_OTG: + /* + * Some SoCs use one interrupt with otg-id/otg-bvalid/linestate + * interrupts muxed together, so probe the otg-mux interrupt first, + * if not found, then look for the regular interrupts one by one. + */ + rport->otg_mux_irq = of_irq_get_byname(child_np, "otg-mux"); + if (rport->otg_mux_irq > 0) { + ret = devm_request_threaded_irq(rphy->dev, rport->otg_mux_irq, + NULL, + rockchip_usb2phy_otg_mux_irq, + IRQF_ONESHOT, + "rockchip_usb2phy_otg", + rport); + if (ret) { + dev_err(rphy->dev, + "failed to request otg-mux irq handle\n"); + return ret; + } + } else { + rport->bvalid_irq = of_irq_get_byname(child_np, "otg-bvalid"); + if (rport->bvalid_irq < 0) { + dev_err(rphy->dev, "no vbus valid irq provided\n"); + ret = rport->bvalid_irq; + return ret; + } + + ret = devm_request_threaded_irq(rphy->dev, rport->bvalid_irq, + NULL, + rockchip_usb2phy_bvalid_irq, + IRQF_ONESHOT, + "rockchip_usb2phy_bvalid", + rport); + if (ret) { + dev_err(rphy->dev, + "failed to request otg-bvalid irq handle\n"); + return ret; + } + } + break; + default: + return -EINVAL; + } + + return 0; +} + static int rockchip_usb2phy_host_port_init(struct rockchip_usb2phy *rphy, struct rockchip_usb2phy_port *rport, struct device_node *child_np) @@ -947,18 +1045,9 @@ static int rockchip_usb2phy_host_port_init(struct rockchip_usb2phy *rphy, mutex_init(&rport->mutex); INIT_DELAYED_WORK(&rport->sm_work, rockchip_usb2phy_sm_work); - rport->ls_irq = of_irq_get_byname(child_np, "linestate"); - if (rport->ls_irq < 0) { - dev_err(rphy->dev, "no linestate irq provided\n"); - return rport->ls_irq; - } - - ret = devm_request_threaded_irq(rphy->dev, rport->ls_irq, NULL, - rockchip_usb2phy_linestate_irq, - IRQF_ONESHOT, - "rockchip_usb2phy", rport); + ret = rockchip_usb2phy_port_irq_init(rphy, rport, child_np); if (ret) { - dev_err(rphy->dev, "failed to request linestate irq handle\n"); + dev_err(rphy->dev, "failed to setup host irq\n"); return ret; } @@ -1007,44 +1096,10 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy, INIT_DELAYED_WORK(&rport->chg_work, rockchip_chg_detect_work); INIT_DELAYED_WORK(&rport->otg_sm_work, rockchip_usb2phy_otg_sm_work); - /* - * Some SoCs use one interrupt with otg-id/otg-bvalid/linestate - * interrupts muxed together, so probe the otg-mux interrupt first, - * if not found, then look for the regular interrupts one by one. - */ - rport->otg_mux_irq = of_irq_get_byname(child_np, "otg-mux"); - if (rport->otg_mux_irq > 0) { - ret = devm_request_threaded_irq(rphy->dev, rport->otg_mux_irq, - NULL, - rockchip_usb2phy_otg_mux_irq, - IRQF_ONESHOT, - "rockchip_usb2phy_otg", - rport); - if (ret) { - dev_err(rphy->dev, - "failed to request otg-mux irq handle\n"); - goto out; - } - } else { - rport->bvalid_irq = of_irq_get_byname(child_np, "otg-bvalid"); - if (rport->bvalid_irq < 0) { - dev_err(rphy->dev, "no vbus valid irq provided\n"); - ret = rport->bvalid_irq; - goto out; - } - - ret = devm_request_threaded_irq(rphy->dev, rport->bvalid_irq, - NULL, - rockchip_usb2phy_bvalid_irq, - IRQF_ONESHOT, - "rockchip_usb2phy_bvalid", - rport); - if (ret) { - dev_err(rphy->dev, - "failed to request otg-bvalid irq handle\n"); - goto out; - } - } + ret = rockchip_usb2phy_port_irq_init(rphy, rport, child_np); + if (ret) { + dev_err(rphy->dev, "failed to init irq for host port\n"); + goto out; if (!IS_ERR(rphy->edev)) { rport->event_nb.notifier_call = rockchip_otg_event; @@ -1124,6 +1179,7 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) phy_cfgs = match->data; rphy->chg_state = USB_CHG_STATE_UNDEFINED; rphy->chg_type = POWER_SUPPLY_TYPE_UNKNOWN; + rphy->irq = platform_get_irq(pdev, 0); platform_set_drvdata(pdev, rphy); ret = rockchip_usb2phy_extcon_register(rphy); @@ -1201,6 +1257,20 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) } provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); + + if (rphy->irq > 0) { + ret = devm_request_threaded_irq(rphy->dev, rphy->irq, NULL, + rockchip_usb2phy_irq, + IRQF_ONESHOT, + "rockchip_usb2phy", + rphy); + if (ret) { + dev_err(rphy->dev, + "failed to request usb2phy irq handle\n"); + goto put_child; + } + } + return PTR_ERR_OR_ZERO(provider); put_child: From patchwork Thu Aug 12 20:41:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Geis X-Patchwork-Id: 12434249 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6A38C4338F for ; Thu, 12 Aug 2021 20:45:26 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 623A7610A3 for ; Thu, 12 Aug 2021 20:45:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 623A7610A3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kQWuB5rWwCYzE/lvGHL5jlEhegxC+2Bnhxi1v5F4Fd0=; b=ILzCP21UZ4uhmb QR+n7/TyR0Xro0upi+yhpk/T4VljUgvI2i1HMKNQ5RUDvyNCsPifqP+qVnHBQyMJl10sRqMSfNpdP ZqVyNp1MYWFb8sVAZOKU4EA7SLT/kHFDADRdfD2TMLJ59SiWPrBtpk5r/UDvKDG+EVizkK8e862Ic rql1MKg5oWb7t+D8sSm0iCwceHSAmx4wI/fXO99m0pRkS1a4Reuwu00ufF6wdRLxHZBOxRS+6gs5l ZIcCdloAPohj+X2k1hkhpw6A0gnIJpDiZqmC0/tfRkV904tO3xFbuvBpsnkPoR/97FfFk8KTnKA5K xY2P+zaBUBDpBmV5OTJA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEHZp-00BD6R-ND; Thu, 12 Aug 2021 20:45:21 +0000 Received: from mail-qv1-xf36.google.com ([2607:f8b0:4864:20::f36]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEHWe-00BBRG-7n; Thu, 12 Aug 2021 20:42:05 +0000 Received: by mail-qv1-xf36.google.com with SMTP id c14so28297qvs.9; Thu, 12 Aug 2021 13:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4fH6A/BcmiXnSJNIz36CupSiUjhhUBPUWUzzeHlruOE=; b=egHFOLfly8AjKOqcXJyLVExDLf6LQcj/wgdtZZlG5HWIU+cPfiscKiz0rCyST76G8o R29ekx00ati+bx0XNynb2U9MyzPCgFER6DrNzBCe6sx/4JmE0BzGTabFbGP5POS1kmdG sRFtNYWNtS2yP9Q9bMekpEjPMEb7VsysanYbWDUQE5LjXew+VClPpizjFVE20Zn+q7OL ygoF7ioTB1CcezHpNHEQqB6ZU17m5K6EEtO2sIp0+RarAbhJRdF7B3hYIIQiPlvi8Uqn AjREhqExwBJMw02IxVR3Ewz6TBNy/Jf6zIZ2I4/gPIZjqaU/21pyGuV5gjL4WQ82k1YA ge/A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=4fH6A/BcmiXnSJNIz36CupSiUjhhUBPUWUzzeHlruOE=; b=AmQLMRC5go/w2pvOeG7wVLbtw/MuHNTcK62V5GY83qh+OR3YUSvjc1D+DqnsqHxSaI PXluVkZ6l4yYbzUuMK8R9t1tg94ujewbxgs2VDZj6vja6NdckpJwjKpJjMs4sHFbT5dS QBTpsE83SodSom9bB+Mtoa48LjUy8iaKLwObOzW4DPnrb16QWCQiDMaRqf4qbJ36+3/P YvUTfFvLfXAtwpU/hb1QItOtD8PCKz0FLG8lUaVV3Zz3a7ZrQk1HXr8POc8UJ20UwQBu ZmHLUWNDUERkMWT9cTSyflOiCX0DCemB5MmDNsbEvI9cQjd2DWeOnTpgOP78OD9kFcdT 6eBQ== X-Gm-Message-State: AOAM532g8rlmzrUJoa35ugU1gPR24YV756i18ecQsjqYAkzpg2PhlCft cP0cLxm68UjZloBzRqkqDmw= X-Google-Smtp-Source: ABdhPJwO8BKYR3rqA3vonlPaweauwBXBAV9qhXKsuNnD9drM/Byn6GLIlelcDUcBbLDmR3/VIErhxg== X-Received: by 2002:a05:6214:dce:: with SMTP id 14mr5852702qvt.34.1628800923135; Thu, 12 Aug 2021 13:42:03 -0700 (PDT) Received: from master-laptop.sparksnet ([2601:153:980:85b1:e89f:d077:9161:1bd7]) by smtp.gmail.com with ESMTPSA id m16sm1940361qki.19.2021.08.12.13.42.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Aug 2021 13:42:02 -0700 (PDT) From: Peter Geis To: Kishon Vijay Abraham I , Vinod Koul , Heiko Stuebner Cc: Peter Geis , linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 6/8] phy: phy-rockchip-inno-usb2: add rk3568 support Date: Thu, 12 Aug 2021 16:41:14 -0400 Message-Id: <20210812204116.2303617-7-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210812204116.2303617-1-pgwipeout@gmail.com> References: <20210812204116.2303617-1-pgwipeout@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210812_134204_331268_C92262C8 X-CRM114-Status: GOOD ( 13.85 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The rk3568 usb2phy is a standalone device with a single muxed interrupt. Add support for the registers to the usb2phy driver. Signed-off-by: Peter Geis --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index fdeb2e7c937a..74420c439a07 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1100,6 +1100,7 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy, if (ret) { dev_err(rphy->dev, "failed to init irq for host port\n"); goto out; + } if (!IS_ERR(rphy->edev)) { rport->event_nb.notifier_call = rockchip_otg_event; @@ -1509,6 +1510,69 @@ static const struct rockchip_usb2phy_cfg rk3399_phy_cfgs[] = { { /* sentinel */ } }; +static const struct rockchip_usb2phy_cfg rk3568_phy_cfgs[] = { + { + .reg = 0xfe8a0000, + .num_ports = 2, + .clkout_ctl = { 0x0008, 4, 4, 1, 0 }, + .port_cfgs = { + [USB2PHY_PORT_OTG] = { + .phy_sus = { 0x0000, 8, 0, 0, 0x1d1 }, + .bvalid_det_en = { 0x0080, 2, 2, 0, 1 }, + .bvalid_det_st = { 0x0084, 2, 2, 0, 1 }, + .bvalid_det_clr = { 0x0088, 2, 2, 0, 1 }, + .utmi_avalid = { 0x00c0, 10, 10, 0, 1 }, + .utmi_bvalid = { 0x00c0, 9, 9, 0, 1 }, + }, + [USB2PHY_PORT_HOST] = { + /* Select suspend control from controller */ + .phy_sus = { 0x0004, 8, 0, 0x1d2, 0x1d2 }, + .ls_det_en = { 0x0080, 1, 1, 0, 1 }, + .ls_det_st = { 0x0084, 1, 1, 0, 1 }, + .ls_det_clr = { 0x0088, 1, 1, 0, 1 }, + .utmi_ls = { 0x00c0, 17, 16, 0, 1 }, + .utmi_hstdet = { 0x00c0, 19, 19, 0, 1 } + } + }, + .chg_det = { + .opmode = { 0x0000, 3, 0, 5, 1 }, + .cp_det = { 0x00c0, 24, 24, 0, 1 }, + .dcp_det = { 0x00c0, 23, 23, 0, 1 }, + .dp_det = { 0x00c0, 25, 25, 0, 1 }, + .idm_sink_en = { 0x0008, 8, 8, 0, 1 }, + .idp_sink_en = { 0x0008, 7, 7, 0, 1 }, + .idp_src_en = { 0x0008, 9, 9, 0, 1 }, + .rdm_pdwn_en = { 0x0008, 10, 10, 0, 1 }, + .vdm_src_en = { 0x0008, 12, 12, 0, 1 }, + .vdp_src_en = { 0x0008, 11, 11, 0, 1 }, + }, + }, + { + .reg = 0xfe8b0000, + .num_ports = 2, + .clkout_ctl = { 0x0008, 4, 4, 1, 0 }, + .port_cfgs = { + [USB2PHY_PORT_OTG] = { + .phy_sus = { 0x0000, 8, 0, 0x1d2, 0x1d1 }, + .ls_det_en = { 0x0080, 0, 0, 0, 1 }, + .ls_det_st = { 0x0084, 0, 0, 0, 1 }, + .ls_det_clr = { 0x0088, 0, 0, 0, 1 }, + .utmi_ls = { 0x00c0, 5, 4, 0, 1 }, + .utmi_hstdet = { 0x00c0, 7, 7, 0, 1 } + }, + [USB2PHY_PORT_HOST] = { + .phy_sus = { 0x0004, 8, 0, 0x1d2, 0x1d1 }, + .ls_det_en = { 0x0080, 1, 1, 0, 1 }, + .ls_det_st = { 0x0084, 1, 1, 0, 1 }, + .ls_det_clr = { 0x0088, 1, 1, 0, 1 }, + .utmi_ls = { 0x00c0, 17, 16, 0, 1 }, + .utmi_hstdet = { 0x00c0, 19, 19, 0, 1 } + } + }, + }, + { /* sentinel */ } +}; + static const struct rockchip_usb2phy_cfg rv1108_phy_cfgs[] = { { .reg = 0x100, @@ -1558,6 +1622,7 @@ static const struct of_device_id rockchip_usb2phy_dt_match[] = { { .compatible = "rockchip,rk3328-usb2phy", .data = &rk3328_phy_cfgs }, { .compatible = "rockchip,rk3366-usb2phy", .data = &rk3366_phy_cfgs }, { .compatible = "rockchip,rk3399-usb2phy", .data = &rk3399_phy_cfgs }, + { .compatible = "rockchip,rk3568-usb2phy", .data = &rk3568_phy_cfgs }, { .compatible = "rockchip,rv1108-usb2phy", .data = &rv1108_phy_cfgs }, {} }; From patchwork Thu Aug 12 20:41:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Geis X-Patchwork-Id: 12434251 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F340BC4338F for ; Thu, 12 Aug 2021 20:46:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B12E960560 for ; Thu, 12 Aug 2021 20:46:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B12E960560 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oQqEQU8rRGBG1Zl6+bBIXvS2sDkx8N0EiZpWTgrwxe4=; b=z0E1G83T8y+/9S W8IEc39nzOf9M13Ee9vC1zLu3zkusAUCWnXl/HAnCTgOlctH0mBSjViSqyo8OAT/+8WT5bg9P+uIt WCFYeJkOP9N8ZvKvbB9vkrXdZGbuB2A6pvvCWRZtSFG0Dr2J3jXNmvvMMDgw0KoMwxQTlyiVVRarV U22MhKtxUAOQAKageH1nlf6OLBwaBLXiyxKD6zIqAdDm7A5+kHFvBMLdFoHJpOE6fboCWYHyMfNB9 b6z80CUgKxzSN8umNLbV6i3XKhkM+hqykceB6LneBqAPELsrJRtFUnUGKmiWakfusLJnu0QW6ygw8 HhcoGvyT4wYk1zt/UNpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEHaS-00BDNw-Ql; Thu, 12 Aug 2021 20:46:00 +0000 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEHWf-00BBRn-86; Thu, 12 Aug 2021 20:42:06 +0000 Received: by mail-qk1-x72b.google.com with SMTP id t68so8252652qkf.8; Thu, 12 Aug 2021 13:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iWmyzD0AHOmumLrqKa3ZHpzPnn/EcIn8wTUKFzr+kYQ=; b=hmVe7sT1hGvRwzQ/slSq+rQUvVQrRh1nihHPENrDIwE45CYMPD1Z/x4jTcP/THIFWH L7dvuCIKD6w0WovygtCTVvp9YRhyNeh7Y2h1/qCUaf+lEhfhO1BIZVJstUNTgzsSXTjN M78TsYn3IbNYZYNOCoXzs2OCAEAI12RYEl3+NPbER6ZEyHLk5gZlX8OnVpHLMaiLkOEP 18ywaxXNt7T0LZ6g8naFFBHJJwc3lJuQMzGEndkIwptE9RHU7M0ubYe7o9Leol5I/7Mp DK9kKQ3xw+v4Qs3GvVaEwUYraILJ60aZvNV0Qphx7TLCaAv+IKfTyA4T3lmEMHFwF9UE Kt2Q== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=iWmyzD0AHOmumLrqKa3ZHpzPnn/EcIn8wTUKFzr+kYQ=; b=tOKr0z//9lz0hI549IoXSf5Y3d8qtpGlcXctT1t1UB9Z1eayudI33smO9Z70+74g9l 75YEM4wpiGnTbfU5JjSOfpJecCH/Z0Az1LDFF//45cwkBjWf4600U7Ir8tKcckEWBkrQ YTYfMWUz4QrMmW6mkUQhWWtB5wZMbXjKj7vKhMF+jyaEqZj/vgCjhIBdlBkH5hPsaBSI lwg33L3gJxJ/EH3AxACk624Ft+szWfasqNmJ4Qsr+ApLYFXeughLVlL0hRrPjPlRHXKw B6/IIh/r5hNMZ931mh8tHa/TewfcPp2UjikzoHwhfjcqprma8Zt3s9jf61nqEW876fOg 6zYw== X-Gm-Message-State: AOAM533XLG4lsQvVHObnns4NIWtKVZf64lgYYj4oQdZLVGDv6g1b1O5E /md1rgMsoDn/36TdKI4vY4E= X-Google-Smtp-Source: ABdhPJy4HK8JMBANtT1Uwyh3IIemb3X75giy3d/8yXVQoIEBVbULOvqq2B9tZfz3t2WBRgS8QeVx9Q== X-Received: by 2002:a05:620a:5b7:: with SMTP id q23mr6568553qkq.386.1628800924115; Thu, 12 Aug 2021 13:42:04 -0700 (PDT) Received: from master-laptop.sparksnet ([2601:153:980:85b1:e89f:d077:9161:1bd7]) by smtp.gmail.com with ESMTPSA id m16sm1940361qki.19.2021.08.12.13.42.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Aug 2021 13:42:03 -0700 (PDT) From: Peter Geis To: Rob Herring , Heiko Stuebner Cc: Peter Geis , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 7/8] arm64: dts: rockchip: add usb2 nodes to rk3568 device tree Date: Thu, 12 Aug 2021 16:41:15 -0400 Message-Id: <20210812204116.2303617-8-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210812204116.2303617-1-pgwipeout@gmail.com> References: <20210812204116.2303617-1-pgwipeout@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210812_134205_362962_65F57E28 X-CRM114-Status: GOOD ( 11.70 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Add the requisite nodes to the rk3568 device tree to enable the usb2 device controllers. Includes the usb2phy nodes, usb2phy grf nodes, and usb2 controller nodes. Signed-off-by: Peter Geis --- arch/arm64/boot/dts/rockchip/rk356x.dtsi | 98 ++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk356x.dtsi b/arch/arm64/boot/dts/rockchip/rk356x.dtsi index 322971318d5a..2abd9241c91f 100644 --- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi @@ -200,6 +200,50 @@ gic: interrupt-controller@fd400000 { msi-controller; }; + usb_host0_ehci: usb@fd800000 { + compatible = "generic-ehci"; + reg = <0x0 0xfd800000 0x0 0x40000>; + interrupts = ; + clocks = <&cru HCLK_USB2HOST0>, <&cru HCLK_USB2HOST0_ARB>, + <&cru PCLK_USB>; + phys = <&u2phy1_otg>; + phy-names = "usb"; + status = "disabled"; + }; + + usb_host0_ohci: usb@fd840000 { + compatible = "generic-ohci"; + reg = <0x0 0xfd840000 0x0 0x40000>; + interrupts = ; + clocks = <&cru HCLK_USB2HOST0>, <&cru HCLK_USB2HOST0_ARB>, + <&cru PCLK_USB>; + phys = <&u2phy1_otg>; + phy-names = "usb"; + status = "disabled"; + }; + + usb_host1_ehci: usb@fd880000 { + compatible = "generic-ehci"; + reg = <0x0 0xfd880000 0x0 0x40000>; + interrupts = ; + clocks = <&cru HCLK_USB2HOST1>, <&cru HCLK_USB2HOST1_ARB>, + <&cru PCLK_USB>; + phys = <&u2phy1_host>; + phy-names = "usb"; + status = "disabled"; + }; + + usb_host1_ohci: usb@fd8c0000 { + compatible = "generic-ohci"; + reg = <0x0 0xfd8c0000 0x0 0x40000>; + interrupts = ; + clocks = <&cru HCLK_USB2HOST1>, <&cru HCLK_USB2HOST1_ARB>, + <&cru PCLK_USB>; + phys = <&u2phy1_host>; + phy-names = "usb"; + status = "disabled"; + }; + pmugrf: syscon@fdc20000 { compatible = "rockchip,rk3568-pmugrf", "syscon", "simple-mfd"; reg = <0x0 0xfdc20000 0x0 0x10000>; @@ -210,6 +254,16 @@ grf: syscon@fdc60000 { reg = <0x0 0xfdc60000 0x0 0x10000>; }; + usb2phy0_grf: syscon@fdca0000 { + compatible = "rockchip,rk3568-usb2phy-grf", "syscon"; + reg = <0x0 0xfdca0000 0x0 0x8000>; + }; + + usb2phy1_grf: syscon@fdca8000 { + compatible = "rockchip,rk3568-usb2phy-grf", "syscon"; + reg = <0x0 0xfdca8000 0x0 0x8000>; + }; + pmucru: clock-controller@fdd00000 { compatible = "rockchip,rk3568-pmucru"; reg = <0x0 0xfdd00000 0x0 0x1000>; @@ -738,6 +792,50 @@ saradc: saradc@fe720000 { status = "disabled"; }; + usb2phy0: usb2-phy@fe8a0000 { + compatible = "rockchip,rk3568-usb2phy"; + reg = <0x0 0xfe8a0000 0x0 0x10000>; + clocks = <&pmucru CLK_USBPHY0_REF>; + clock-names = "phyclk"; + clock-output-names = "clk_usbphy0_480m"; + interrupts = ; + rockchip,usbgrf = <&usb2phy0_grf>; + #clock-cells = <0>; + status = "disabled"; + + u2phy0_host: host-port { + #phy-cells = <0>; + status = "disabled"; + }; + + u2phy0_otg: otg-port { + #phy-cells = <0>; + status = "disabled"; + }; + }; + + usb2phy1: usb2-phy@fe8b0000 { + compatible = "rockchip,rk3568-usb2phy"; + reg = <0x0 0xfe8b0000 0x0 0x10000>; + clocks = <&pmucru CLK_USBPHY1_REF>; + clock-names = "phyclk"; + clock-output-names = "clk_usbphy1_480m"; + interrupts = ; + rockchip,usbgrf = <&usb2phy1_grf>; + #clock-cells = <0>; + status = "disabled"; + + u2phy1_host: host-port { + #phy-cells = <0>; + status = "disabled"; + }; + + u2phy1_otg: otg-port { + #phy-cells = <0>; + status = "disabled"; + }; + }; + pinctrl: pinctrl { compatible = "rockchip,rk3568-pinctrl"; rockchip,grf = <&grf>; From patchwork Thu Aug 12 20:41:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Geis X-Patchwork-Id: 12434253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87078C4338F for ; Thu, 12 Aug 2021 20:46:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3A4266103E for ; Thu, 12 Aug 2021 20:46:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3A4266103E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1Te7s78S6NBSrpUJXlAqw5Yu20mPJtToi1PYpz4Pzc8=; b=YiZCLRTFovh4j7 lHE+IUz+3EJ4M6m+oYV6jiKYMsb938JtjUTUJdGIHUldUUJkFmBWo+r2psiLBXW28JCcj6Aw6KWWc BiJt3P2IN3uFqtY3j43QmC5cBSp2WB4o9Acs6IuuB9O2PbMNCN/fLb6vcmQkMKgwzLMjKkse8LIav DXLUt6Fm0B9Iz19703vWTjBFuyruVBi1fYAgpOx9kAlRnHWt4IpbQAx7JCrb15ejHMAsgTyh/+o0A NphCZ/jZHXnsRId038uaVgWaylnT/x9lTBuNXEWg6HHHJzhlkpRD7bYi/YRTei3AYtqvfkYFVexoz O9qsFjIVMsRE4mHuxH+w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEHbD-00BDik-B4; Thu, 12 Aug 2021 20:46:47 +0000 Received: from mail-qk1-x72c.google.com ([2607:f8b0:4864:20::72c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEHWg-00BBST-9G; Thu, 12 Aug 2021 20:42:07 +0000 Received: by mail-qk1-x72c.google.com with SMTP id c130so8236747qkg.7; Thu, 12 Aug 2021 13:42:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0vSamTyccptzOdkOr+v7GJn23T5SHRt0Wd7iQnG52jY=; b=WsddWCX2bH0za7uq6RXsMB/yT5Y5kXw5Dfi4StrzwM6j9+0IbgfdtWevLRetgVsmcq FY9rZ8rN7XopwA3C2iMrRvd2jmPgW4oMLutiEKRAntdFlcfMA/c1lxG04WyoA7LKTg7l JydE/tfQVnOAaC6f5uAKubOjH/kQYZUOHPgmanqwU0A/VBdRoloHkxJhutB6Npl+6/79 zkQVpKT/QllZZzFCvA2S+DG2b/klg3GgsSxrvHQf6pd6lrqIGEQeer1L0sikZv4Fba/l enEfwf/qF4NpYUxz2D0hDf3N7elMXpKuKG3D1Jw24k7VBZsX24xzKjbg49QUNj4IQBEH jzfQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=0vSamTyccptzOdkOr+v7GJn23T5SHRt0Wd7iQnG52jY=; b=LbxiHnjFqGa+Lvppex6OKdjdGdf4kaDJypjOwE0YSyOTVzWHUFTeJyuTZhaX9Ye/Zd btamJcYFPcLZJiHg5w7J1/zr8TXxMxnyttqRLOy2siY3PYctLTvboxwoIwvii8haVSiP 9nTJ6T/RYpxxij8477WMu7kkd+ehCHP4JED9EklLNp3UoLEGPwQeQv80dXzDj50c2vl5 UALxE4iKOlc+6Ut5ztDWUcIfg1KYzwrSu8KBcHHnxOuwhJ8jX6af2E4d953FJjO4aSo4 R6hFHFwKBIGMZ0DP7kcAcJhfdAENdTK9kRVIs7DUI4QECRZal+4DJf/OZ2gFztqZKh3z ekzA== X-Gm-Message-State: AOAM532V2Jmd4Whbbj3QACAFG6D/lJv385WOppyQ5wzpRq6UQRjptWVO xToio6oxD4UCscHlLUtn8xg= X-Google-Smtp-Source: ABdhPJw/1/MKI/+YdMlNsbB9IH09a4UY8r9lfrOqTmOPC3J4ZFt6cYVEJKpp1D5Peg1nmERqRT4y+g== X-Received: by 2002:a05:620a:cea:: with SMTP id c10mr6698474qkj.238.1628800925058; Thu, 12 Aug 2021 13:42:05 -0700 (PDT) Received: from master-laptop.sparksnet ([2601:153:980:85b1:e89f:d077:9161:1bd7]) by smtp.gmail.com with ESMTPSA id m16sm1940361qki.19.2021.08.12.13.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Aug 2021 13:42:04 -0700 (PDT) From: Peter Geis To: Rob Herring , Heiko Stuebner Cc: Peter Geis , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 8/8] arm64: dts: rockchip: add Quartz64-A usb2 support Date: Thu, 12 Aug 2021 16:41:16 -0400 Message-Id: <20210812204116.2303617-9-pgwipeout@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210812204116.2303617-1-pgwipeout@gmail.com> References: <20210812204116.2303617-1-pgwipeout@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210812_134206_384457_00D49D7D X-CRM114-Status: GOOD ( 12.91 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Add the nodes and regulators to enable usb2 support on the Quartz64 Model A. Signed-off-by: Peter Geis --- .../boot/dts/rockchip/rk3566-quartz64-a.dts | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts b/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts index a3cdb6c2bec6..53ea5c13076b 100644 --- a/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts +++ b/arch/arm64/boot/dts/rockchip/rk3566-quartz64-a.dts @@ -75,6 +75,22 @@ vcc5v0_usb: vcc5v0_usb { vin-supply = <&vcc12v_dcin>; }; + /* all four ports are controlled by one gpio + * the host ports are sourced from vcc5v0_usb + * the otg port is sourced from vcc5v0_midu + */ + vcc5v0_usb20_host: vcc5v0_usb20_host { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_usb20_host"; + enable-active-high; + gpio = <&gpio4 RK_PB5 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&vcc5v0_usb20_host_en>; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc5v0_usb>; + }; + vcc3v3_sd: vcc3v3_sd { compatible = "regulator-fixed"; enable-active-low; @@ -367,6 +383,12 @@ pmic_int_l: pmic-int-l { }; }; + usb2 { + vcc5v0_usb20_host_en: vcc5v0-usb20-host-en { + rockchip,pins = <4 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + vcc_sd { vcc_sd_h: vcc-sd-h { rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>; @@ -424,3 +446,33 @@ bluetooth { &uart2 { status = "okay"; }; + +&u2phy1_host { + phy-supply = <&vcc5v0_usb20_host>; + status = "okay"; +}; + +&u2phy1_otg { + phy-supply = <&vcc5v0_usb20_host>; + status = "okay"; +}; + +&usb2phy1 { + status = "okay"; +}; + +&usb_host0_ehci { + status = "okay"; +}; + +&usb_host0_ohci { + status = "okay"; +}; + +&usb_host1_ehci { + status = "okay"; +}; + +&usb_host1_ohci { + status = "okay"; +};