Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp679338lqt; Fri, 19 Apr 2024 07:27:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUfBPCGVpWlR3+IbkGkLce6r1MAbio9bsi3+A4X3M/RQadn5bygdUAhSSXm575sAUmmSuZINOzwXY3eim/ee7hilgTrj87p1uCkec2R3Q== X-Google-Smtp-Source: AGHT+IGQC08geP9XUJlKWAc6y3QbX3UM+8m9p8VObFiudyalOUk1djGHq1pGkW1GqX/cBl5C+kko X-Received: by 2002:a17:907:7819:b0:a55:9105:e7a6 with SMTP id la25-20020a170907781900b00a559105e7a6mr299282ejc.31.1713536836136; Fri, 19 Apr 2024 07:27:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713536836; cv=pass; d=google.com; s=arc-20160816; b=P3qtoJNDRxjzsuU/0KFUJJcZUx6mVpDGG6iAWeZLr8WfD1zuInKORV70Z7h+10JwJ2 JmR1JhrwVNr5Af6MF+zuTBNb3U+L/RRCWjCLem+JX4tWaOj3KXznUPltL+2Olk6tmy4v RUSaJkbbCSjW2t/AEhLHiWLAbcSeNci2wlwTwG7ojOm6axDL+3fTMVwXo+rKqGI0Ac76 HziLnMONTwmKqVKLGS0v8BiCWVnRDTun/jg+bxf/BGyT/eXuMdJg5/FAM55rE0lSWXW6 hBSh46FQFVT1qrFPVH1DktPL6u4vdNL+zoMoo7ao7ScbCs1JPYAgsyXb/9sn04T6DqVJ uvtA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=0k6v+gWL3AzmpFZ50KMdFMeKdW7eo6ZqeGsPumfO8s0=; fh=FeOwP1duDFt9BuMaZUehMqUcGCUd+LYKvvclTkqyM/A=; b=rhHgl+eWcARyXNlISvaIZBddfbhbpoKjALBOVC0kkREskuMHDsmo6b/WbLHJZavUxV xAX7i9YmUFd7IgQEQdV8wVqvgXvNG+H2ci6exOSytxCdLVuC5oT3xhn3nfse7v6LnS/a zyLr+HeEWFUqmyg2fJ6fn4IrevSPxTJAQbgS0CTRA5XIubtarL0KS/z0QgG//viFvz8S wYgML5MHEsifjtiBx1/+GmsMQQbcGBDPvVQcWU9TpK6XM2UnAqO2fJ4nkMl7EfGqyV8o 85Xg38aFfzPMHn3iSHAH/W9/MRb7pqARcZq1PNU9a4BcC2XzsRqTI+sKuLipqYaFFQNI 0fNQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="qk/D/+mu"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151583-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151583-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n13-20020a1709062bcd00b00a520eb29a92si2292421ejg.438.2024.04.19.07.27.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 07:27:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151583-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="qk/D/+mu"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151583-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151583-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D640A1F241D2 for ; Fri, 19 Apr 2024 14:27:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A03312E1D0; Fri, 19 Apr 2024 14:27:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qk/D/+mu" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FD857BAF7; Fri, 19 Apr 2024 14:27:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713536826; cv=none; b=RdSwS+EUNhXX6XUmjCDyHBVz3L+a92MAj+iaL5L9CZQWgvv6a1Eys+PPM4gZ306+AVDZmRv+sI5S5id508nVDRyn6V2odSqkFezDODDFYtrAX1xNETulUXNA507+S2ukI23HQ3lydXot7Trx4E9YqnSg9sTkOgl9auYdEGx2+Zg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713536826; c=relaxed/simple; bh=LIZ2ooYsvWJUe0Wpz+3YNSl3PEnltQyTG5qEOSFGmXk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rHEGzfNCE2VNuF4x8AE9mn1CXthf6GWpZarvOUehaATLCgiSLuFnrPqNuuTnSIMHMd3XYp7xgxLoBN3h5uU24vqqsFdYFUxv1982uqIB9wLtRU79pteVy7u3MAXkA7qvsji+XI9Xl3PnLoRuFdnzVTiLHVKgRGVZDbMOna61gDE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qk/D/+mu; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FE37C072AA; Fri, 19 Apr 2024 14:27:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713536826; bh=LIZ2ooYsvWJUe0Wpz+3YNSl3PEnltQyTG5qEOSFGmXk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qk/D/+muf+di1gTdiGkl9RX59eTAIPKi/X4wFxyAAJLB4Ru+ZGaGdCvE4WSjhERbn lDsBW4dOO8a2ClDwRQtf2zOTybfG+aE4+Xenb6tHxeEDjB5mHYr8Alb6BHwiuhEoRg 7R49/mWs0c6KvHLBbUjbKCwc5kpLILbiyHZGvNkaR/hsQezmnFTNtL06vAU5RsjbFM X9SNuQMOiGnBErf20eaAM/jIWzBBlBb34BC97qizzwhHVC+sfKumxbeDS5kUUvIzJ0 owxzUMW6Jts137vJuNOH2RgyOSvQcftHP1eD4OYjtnjoZ3b0AaG9ztC5skFqP7Z+WL cJTywwqn3hdDg== Date: Fri, 19 Apr 2024 15:26:53 +0100 From: Conor Dooley To: Inochi Amaoto Cc: Vinod Koul , Kishon Vijay Abraham I , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen Wang , Paul Walmsley , Palmer Dabbelt , Albert Ou , Jisheng Zhang , Liu Gui , Jingbao Qiu , dlan@gentoo.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH 1/2] dt-bindings: phy: Add Sophgo CV1800 USB phy Message-ID: <20240419-harmful-neutron-d0db367cf659@spud> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wzFy3jBeV9w7Nqxx" Content-Disposition: inline In-Reply-To: --wzFy3jBeV9w7Nqxx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 12, 2024 at 03:22:24PM +0800, Inochi Amaoto wrote: > The USB phy of Sophgo CV18XX series SoC needs to sense a pin called > "VBUS_DET" to get the right operation mode. If this pin is not > connected, it only supports setting the mode manually. >=20 > Add USB phy bindings for Sophgo CV18XX/SG200X series SoC. >=20 > Signed-off-by: Inochi Amaoto > --- > .../bindings/phy/sophgo,cv1800-usb-phy.yaml | 90 +++++++++++++++++++ > 1 file changed, 90 insertions(+) > create mode 100644 Documentation/devicetree/bindings/phy/sophgo,cv1800-u= sb-phy.yaml >=20 > diff --git a/Documentation/devicetree/bindings/phy/sophgo,cv1800-usb-phy.= yaml b/Documentation/devicetree/bindings/phy/sophgo,cv1800-usb-phy.yaml > new file mode 100644 > index 000000000000..cb394ac5d8c4 > --- /dev/null > +++ b/Documentation/devicetree/bindings/phy/sophgo,cv1800-usb-phy.yaml > @@ -0,0 +1,90 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/phy/sophgo,cv1800-usb-phy.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Sophgo CV18XX/SG200X USB 2.0 PHY > + > +maintainers: > + - Inochi Amaoto > + > +properties: > + compatible: > + const: sophgo,cv1800-usb-phy > + > + reg: > + maxItems: 1 > + > + "#phy-cells": > + const: 0 > + > + clocks: > + items: > + - description: PHY clock > + - description: PHY app clock > + - description: PHY stb clock > + - description: PHY lpm clock > + > + clock-names: > + items: > + - const: phy > + - const: app > + - const: stb > + - const: lpm > + > + dr_mode: > + description: PHY device mode when initing. "initing" isn't a word, "initialising" is the correct word. Or "initializing" if you speak American. But if it is just the value during initialisation, why do we need to know - we can just overwrite it in software, right? Are you sure that this is limited to initialisation? I would have thought that it describes the configuration that the board is in, and is a fixed property of the system? > + enum: [host, peripheral, otg] Rob, I know this is a phy rather than a controller, so referencing usb-drd.yaml doesn't really make sense, but there are several PHYs using dr_mode so it feels like there should be something to reference here rather than defining the property anew. > + > + vbus_det-gpios: > + description: GPIO to the USB OTG VBUS detect pin. This should not be > + defined if vbus_det gpio and switch gpio are connected. I don't understand the second sentence here. > + maxItems: 1 > + > + sophgo,switch-gpios: > + description: GPIO for the phy to control connected switch. > + maxItems: 2 You've got two items here, they should be described. /But/ the property above says "switch gpio", which is singular. Which is it? Cheers, Conor. > + > +required: > + - compatible > + - "#phy-cells" > + - clocks > + - clock-names > + - dr_mode > + > +allOf: > + - if: > + properties: > + dr_mode: > + const: otg > + then: > + required: > + - vbus_det-gpios > + > +additionalProperties: false > + > +examples: > + - | > + phy@48 { > + compatible =3D "sophgo,cv1800-usb-phy"; > + reg =3D <0x48 0x4>; > + #phy-cells =3D <0>; > + clocks =3D <&clk 92>, <&clk 93>, > + <&clk 94>, <&clk 95>; > + clock-names =3D "phy", "app", "stb", "lpm"; > + dr_mode =3D "host"; > + }; > + - | > + #include > + > + phy@54 { > + compatible =3D "sophgo,cv1800-usb-phy"; > + reg =3D <0x54 0x4>; > + #phy-cells =3D <0>; > + clocks =3D <&clk 92>, <&clk 93>, > + <&clk 94>, <&clk 95>; > + clock-names =3D "phy", "app", "stb", "lpm"; > + dr_mode =3D "otg"; > + vbus_det-gpios =3D <&portb 6 GPIO_ACTIVE_HIGH>; > + }; > -- > 2.44.0 >=20 --wzFy3jBeV9w7Nqxx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZiJ/LQAKCRB4tDGHoIJi 0vrCAP9R3ajhruwWEa6524OScv46PoGRGBZEDXLB11mYIt7yrQD+M6fgMybbX45+ WHmD18Svh+jDgv07w0Lt0Pf9l3RCUAE= =Cu/R -----END PGP SIGNATURE----- --wzFy3jBeV9w7Nqxx--