From mboxrd@z Thu Jan 1 00:00:00 1970 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 A6FE4C83F18 for ; Tue, 29 Aug 2023 16:17:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236476AbjH2QRO (ORCPT ); Tue, 29 Aug 2023 12:17:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229908AbjH2QQp (ORCPT ); Tue, 29 Aug 2023 12:16:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B596D1AD; Tue, 29 Aug 2023 09:16:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5373661CE1; Tue, 29 Aug 2023 16:16:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FE50C433C7; Tue, 29 Aug 2023 16:16:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693325801; bh=qAojA2STHyfw0Fv9cHDM+ZJ3rFLmT5D9fyY8FeUxJ08=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=I1no0gQjl1B6jZ4lW88cFiYSW4ij6Dfpt7EoNo/2wnPIFmGfD7Dr4i7QabpuL5JE2 HK1QMHfJCe+tR/aNwLCvlUj/EW4+ogvseulBGIKJx0sycNBoonYXNDZBkNA6RfVL68 DwvcokkvKG2Wqbq1Z5gtW+MhfRRJ7GPM5wdiSe+2ufbebdJ4u7nXGR4GyYrEogNpTD UKNaRsuiUZBTSoqupAKGxoYn0i0pa0A8nMPOWP9IJV9sm3hXTKqA2lTx2zH7l8wStP PSjO670jTsszBrqiVS46aerX+RK1umsfFU/KZOms/RaGw1OSbenZbboetJ4lF1WvKh dtuoBI/xAo4jw== Received: (nullmailer pid 2279862 invoked by uid 1000); Tue, 29 Aug 2023 16:16:38 -0000 Date: Tue, 29 Aug 2023 11:16:38 -0500 From: Rob Herring To: Praveenkumar I Cc: robert.marko@sartura.hr, luka.perkov@sartura.hr, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, vkoul@kernel.org, kishon@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, gregkh@linuxfoundation.org, catalin.marinas@arm.com, will@kernel.org, p.zabel@pengutronix.de, arnd@arndb.de, geert+renesas@glider.be, nfraprado@collabora.com, rafal@milecki.pl, peng.fan@nxp.com, quic_wcheng@quicinc.com, linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, quic_varada@quicinc.com Subject: Re: [PATCH 4/9] dt-bindings: phy: qcom,uniphy: Add ipq5332 USB3 SS UNIPHY Message-ID: <20230829161638.GA2274047-robh@kernel.org> References: <20230829135818.2219438-1-quic_ipkumar@quicinc.com> <20230829135818.2219438-5-quic_ipkumar@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230829135818.2219438-5-quic_ipkumar@quicinc.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Tue, Aug 29, 2023 at 07:28:13PM +0530, Praveenkumar I wrote: > Add ipq5332 USB3 SS UNIPHY support. > > Signed-off-by: Praveenkumar I > --- > .../devicetree/bindings/phy/qcom,uniphy.yaml | 117 +++++++++++++++++- > 1 file changed, 114 insertions(+), 3 deletions(-) > > diff --git a/Documentation/devicetree/bindings/phy/qcom,uniphy.yaml b/Documentation/devicetree/bindings/phy/qcom,uniphy.yaml > index cbe2cc820009..17ba661b3d9b 100644 > --- a/Documentation/devicetree/bindings/phy/qcom,uniphy.yaml > +++ b/Documentation/devicetree/bindings/phy/qcom,uniphy.yaml > @@ -19,21 +19,53 @@ properties: > enum: > - qcom,usb-ss-ipq4019-phy > - qcom,usb-hs-ipq4019-phy > + - qcom,ipq5332-usb-ssphy > > reg: > maxItems: 1 > > + reg-names: > + items: > + - const: phy_base > + > + clocks: > + maxItems: 3 > + > + clock-names: > + maxItems: 3 > + > + "#clock-cells": > + const: 0 > + > resets: > + minItems: 1 > maxItems: 2 > > reset-names: > - items: > - - const: por_rst > - - const: srif_rst No need to remove this and duplicate the names multiple times. Just add 'minItems: 1' here and then the if/then schemas only need either minItems or maxItems. > + minItems: 1 > + maxItems: 2 > + > + clock-output-names: > + maxItems: 1 > > "#phy-cells": > const: 0 > > + qcom,phy-mux-sel: > + $ref: /schemas/types.yaml#/definitions/phandle-array > + description: > + PHY Mux Selection for used to select which interface is going to use the > + combo PHY. > + items: > + - items: > + - description: phandle to TCSR syscon region > + - description: offset to the PHY Mux selection register > + - description: value to write on the PHY Mux selection register > + > + vdd-supply: > + description: > + Phandle to 5V regulator supply to PHY digital circuit. > + > required: > - compatible > - reg > @@ -41,6 +73,68 @@ required: > - reset-names > - "#phy-cells" > > +allOf: > + - if: > + properties: > + compatible: > + contains: > + enum: > + - qcom,ipq5332-usb-ssphy > + then: > + properties: > + clocks: > + maxItems: 3 > + clock-names: > + items: > + - const: pipe > + - const: phy_cfg_ahb > + - const: phy_ahb How do the other variants work without any clocks? Magic? Define the names in the top level and then just set the number of items or disallow the property in the if/then schemas. > + > + "#clock-cells": > + const: 0 > + > + clock-output-names: > + maxItems: 1 > + > + resets: > + maxItems: 1 > + reset-names: > + items: > + - const: por_rst > + > + vdda-supply: > + description: > + Phandle to 5V regulator supply to PHY digital circuit. > + > + - if: > + properties: > + compatible: > + contains: > + enum: > + - qcom,usb-ss-ipq4019-phy > + then: > + properties: > + resets: > + maxItems: 1 > + reset-names: > + items: > + - const: por_rst > + > + - if: > + properties: > + compatible: > + contains: > + enum: > + - qcom,usb-hs-ipq4019-phy > + then: > + properties: > + resets: > + maxItems: 2 > + reset-names: > + items: > + - const: por_rst > + - const: srif_rst > + > additionalProperties: false > > examples: > @@ -55,3 +149,20 @@ examples: > <&gcc USB2_HSPHY_S_ARES>; > reset-names = "por_rst", "srif_rst"; > }; > + > + - | > + #include > + > + ssuniphy@4b0000 { > + #phy-cells = <0>; > + #clock-cells = <0>; > + compatible = "qcom,ipq5332-usb-ssphy"; > + reg = <0x4b0000 0x800>; > + clocks = <&gcc GCC_USB0_PIPE_CLK>, > + <&gcc GCC_USB0_PHY_CFG_AHB_CLK>, > + <&gcc GCC_PCIE3X1_PHY_AHB_CLK>; > + clock-names = "pipe", "phy_cfg_ahb", "phy_ahb"; > + > + resets = <&gcc GCC_USB0_PHY_BCR>; > + reset-names = "por_rst"; > + }; > -- > 2.34.1 >