devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Praveenkumar I <quic_ipkumar@quicinc.com>
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
Date: Tue, 29 Aug 2023 11:16:38 -0500	[thread overview]
Message-ID: <20230829161638.GA2274047-robh@kernel.org> (raw)
In-Reply-To: <20230829135818.2219438-5-quic_ipkumar@quicinc.com>

On Tue, Aug 29, 2023 at 07:28:13PM +0530, Praveenkumar I wrote:
> Add ipq5332 USB3 SS UNIPHY support.
> 
> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com>
> ---
>  .../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 <dt-bindings/clock/qcom,ipq5332-gcc.h>
> +
> +    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
> 

  parent reply	other threads:[~2023-08-29 16:17 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-29 13:58 [PATCH 0/9] Enable USB3 for IPQ5332 Praveenkumar I
2023-08-29 13:58 ` [PATCH 1/9] dt-bindings: phy: qcom,uniphy: Rename ipq4019 usb PHY to UNIPHY Praveenkumar I
2023-08-29 14:19   ` Dmitry Baryshkov
2023-08-31 11:53     ` Praveenkumar I
2023-08-31 12:17       ` Dmitry Baryshkov
2023-08-31 12:29         ` Praveenkumar I
2023-08-31 12:34           ` Dmitry Baryshkov
2023-08-31 12:50             ` Praveenkumar I
2023-08-29 16:53   ` Krzysztof Kozlowski
2023-08-29 13:58 ` [PATCH 2/9] phy: qcom: uniphy: Rename ipq4019 USB phy driver to UNIPHY driver Praveenkumar I
2023-08-29 16:55   ` Krzysztof Kozlowski
2023-08-31 13:08     ` Praveenkumar I
2023-08-29 13:58 ` [PATCH 3/9] phy: qcom: uniphy: Update UNIPHY driver to be a common driver Praveenkumar I
2023-08-29 14:37   ` Dmitry Baryshkov
2023-08-31 12:05     ` Praveenkumar I
2023-08-29 16:57   ` Krzysztof Kozlowski
2023-08-29 13:58 ` [PATCH 4/9] dt-bindings: phy: qcom,uniphy: Add ipq5332 USB3 SS UNIPHY Praveenkumar I
2023-08-29 14:16   ` Dmitry Baryshkov
2023-08-29 14:35   ` Rob Herring
2023-08-29 17:08     ` Krzysztof Kozlowski
2023-08-29 18:46       ` Dmitry Baryshkov
2023-08-29 16:16   ` Rob Herring [this message]
2023-08-29 16:59   ` Krzysztof Kozlowski
2023-08-29 13:58 ` [PATCH 5/9] dt-bindings: usb: dwc3: Update IPQ5332 compatible Praveenkumar I
2023-08-29 17:01   ` Krzysztof Kozlowski
2023-08-29 13:58 ` [PATCH 6/9] arm64: dts: qcom: ipq5332: Add USB3 related nodes Praveenkumar I
2023-08-29 14:46   ` Dmitry Baryshkov
2023-08-29 17:02   ` Krzysztof Kozlowski
2023-08-29 13:58 ` [PATCH 7/9] arm64: dts: qcom: ipq5332: Enable USB SS UNIPHY Praveenkumar I
2023-08-29 17:03   ` Krzysztof Kozlowski
2023-08-29 13:58 ` [PATCH 8/9] phy: qcom: uniphy: Add ipq5332 USB UNIPHY support Praveenkumar I
2023-08-29 14:45   ` Dmitry Baryshkov
     [not found]     ` <2ff8ef8e-c7d8-4a02-a764-ef2a3f83e87c@quicinc.com>
2023-08-31 12:21       ` Dmitry Baryshkov
2023-08-29 13:58 ` [PATCH 9/9] arm64: defconfig: Enable UNIPHY driver Praveenkumar I
2023-08-29 17:06   ` Krzysztof Kozlowski
2023-08-29 17:07 ` [PATCH 0/9] Enable USB3 for IPQ5332 Krzysztof Kozlowski
2023-08-31 12:14   ` Praveenkumar I
2023-08-31 12:15   ` Praveenkumar I

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230829161638.GA2274047-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=kishon@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=luka.perkov@sartura.hr \
    --cc=nfraprado@collabora.com \
    --cc=p.zabel@pengutronix.de \
    --cc=peng.fan@nxp.com \
    --cc=quic_ipkumar@quicinc.com \
    --cc=quic_varada@quicinc.com \
    --cc=quic_wcheng@quicinc.com \
    --cc=rafal@milecki.pl \
    --cc=robert.marko@sartura.hr \
    --cc=vkoul@kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).