devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>,
	Vinod Koul <vkoul@kernel.org>,
	Kishon Vijay Abraham I <kishon@ti.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
	linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 5/5] dt-bindings: phy: uniphier: Clean up clocks, resets, and their names using compatible string
Date: Wed, 30 Mar 2022 19:40:33 +0200	[thread overview]
Message-ID: <a784ed61-965a-5c68-c2dd-3340cf18c7b5@linaro.org> (raw)
In-Reply-To: <1648637715-19262-6-git-send-email-hayashi.kunihiko@socionext.com>

On 30/03/2022 12:55, Kunihiko Hayashi wrote:
> Instead of "oneOf:" choices, use "allOf:" and "if:" to define clocks,
> clock-names, resets, and reset-names that can be taken by the compatible
> string.
> 
> The order of clock-names and reset-names doesn't change here.
> 
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> ---
>  .../phy/socionext,uniphier-ahci-phy.yaml      | 90 +++++++++++++-----
>  .../phy/socionext,uniphier-pcie-phy.yaml      | 47 ++++++---
>  .../phy/socionext,uniphier-usb3hs-phy.yaml    | 93 ++++++++++++++----
>  .../phy/socionext,uniphier-usb3ss-phy.yaml    | 95 +++++++++++++++----
>  4 files changed, 251 insertions(+), 74 deletions(-)
> 

(...)

> diff --git a/Documentation/devicetree/bindings/phy/socionext,uniphier-usb3hs-phy.yaml b/Documentation/devicetree/bindings/phy/socionext,uniphier-usb3hs-phy.yaml
> index 1bbd164f2527..21e4414eea60 100644
> --- a/Documentation/devicetree/bindings/phy/socionext,uniphier-usb3hs-phy.yaml
> +++ b/Documentation/devicetree/bindings/phy/socionext,uniphier-usb3hs-phy.yaml
> @@ -34,30 +34,12 @@ properties:
>      minItems: 2
>      maxItems: 3
>  
> -  clock-names:
> -    oneOf:
> -      - items:               # for Pro5
> -          - const: gio
> -          - const: link
> -      - items:               # for PXs3 with phy-ext
> -          - const: link
> -          - const: phy
> -          - const: phy-ext
> -      - items:               # for others
> -          - const: link
> -          - const: phy
> +  clock-names: true
>  
>    resets:
>      maxItems: 2
>  
> -  reset-names:
> -    oneOf:
> -      - items:               # for Pro5
> -          - const: gio
> -          - const: link
> -      - items:               # for others
> -          - const: link
> -          - const: phy
> +  reset-names: true
>  
>    vbus-supply:
>      description: A phandle to the regulator for USB VBUS
> @@ -80,6 +62,77 @@ properties:
>        required for each port, if any one is omitted, the trimming data
>        of the port will not be set at all.
>  
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: socionext,uniphier-pro5-usb3-hsphy
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 2
> +          maxItems: 2
> +        clock-names:
> +          items:
> +            - const: gio
> +            - const: link
> +        resets:
> +          minItems: 2
> +          maxItems: 2
> +        reset-names:
> +          items:
> +            - const: gio
> +            - const: link
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - socionext,uniphier-pxs2-usb3-hsphy
> +              - socionext,uniphier-ld20-usb3-hsphy
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 2
> +          maxItems: 2
> +        clock-names:
> +          items:
> +            - const: link
> +            - const: phy
> +        resets:
> +          minItems: 2
> +          maxItems: 2
> +        reset-names:
> +          items:
> +            - const: link
> +            - const: phy
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - socionext,uniphier-pxs3-usb3-hsphy
> +              - socionext,uniphier-nx1-usb3-hsphy
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 2

Why minItems:2? Is the last phy-ext clock optional?

> +          maxItems: 3
> +        clock-names:
> +          minItems: 2
> +          items:
> +            - const: link
> +            - const: phy
> +            - const: phy-ext
> +        resets:
> +          minItems: 2
> +          maxItems: 2
> +        reset-names:
> +          items:
> +            - const: link
> +            - const: phy
> +
>  required:
>    - compatible
>    - reg
> diff --git a/Documentation/devicetree/bindings/phy/socionext,uniphier-usb3ss-phy.yaml b/Documentation/devicetree/bindings/phy/socionext,uniphier-usb3ss-phy.yaml
> index 06c957d52d23..4c26d2d2303d 100644
> --- a/Documentation/devicetree/bindings/phy/socionext,uniphier-usb3ss-phy.yaml
> +++ b/Documentation/devicetree/bindings/phy/socionext,uniphier-usb3ss-phy.yaml
> @@ -35,34 +35,89 @@ properties:
>      minItems: 2
>      maxItems: 3
>  
> -  clock-names:
> -    oneOf:
> -      - items:             # for Pro4, Pro5
> -          - const: gio
> -          - const: link
> -      - items:             # for PXs3 with phy-ext
> -          - const: link
> -          - const: phy
> -          - const: phy-ext
> -      - items:             # for others
> -          - const: link
> -          - const: phy
> +  clock-names: true
>  
>    resets:
>      maxItems: 2
>  
> -  reset-names:
> -    oneOf:
> -      - items:              # for Pro4,Pro5
> -          - const: gio
> -          - const: link
> -      - items:              # for others
> -          - const: link
> -          - const: phy
> +  reset-names: true
>  
>    vbus-supply:
>      description: A phandle to the regulator for USB VBUS, only for USB host
>  
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - socionext,uniphier-pro4-usb3-ssphy
> +              - socionext,uniphier-pro5-usb3-ssphy
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 2
> +          maxItems: 2
> +        clock-names:
> +          items:
> +            - const: gio
> +            - const: link
> +        resets:
> +          minItems: 2
> +          maxItems: 2
> +        reset-names:
> +          items:
> +            - const: gio
> +            - const: link
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - socionext,uniphier-pxs2-usb3-ssphy
> +              - socionext,uniphier-ld20-usb3-ssphy
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 2
> +          maxItems: 2
> +        clock-names:
> +          items:
> +            - const: link
> +            - const: phy
> +        resets:
> +          minItems: 2
> +          maxItems: 2
> +        reset-names:
> +          items:
> +            - const: link
> +            - const: phy
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - socionext,uniphier-pxs3-usb3-ssphy
> +              - socionext,uniphier-nx1-usb3-ssphy
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 2

Same question as above.

> +          maxItems: 3
> +        clock-names:
> +          minItems: 2
> +          items:
> +            - const: link
> +            - const: phy
> +            - const: phy-ext
> +        resets:
> +          minItems: 2
> +          maxItems: 2
> +        reset-names:
> +          items:
> +            - const: link
> +            - const: phy
> +
>  required:
>    - compatible
>    - reg


Best regards,
Krzysztof

  reply	other threads:[~2022-03-30 17:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30 10:55 [PATCH v3 0/5] dt-bindings: phy: Fix uniphier descriptions Kunihiko Hayashi
2022-03-30 10:55 ` [PATCH v3 1/5] dt-bindings: phy: uniphier-usb2: Add vbus-supply Kunihiko Hayashi
2022-03-30 10:55 ` [PATCH v3 2/5] dt-bindings: phy: uniphier-usb3ss: Treat vbus-supply as optional Kunihiko Hayashi
2022-03-30 10:55 ` [PATCH v3 3/5] dt-bindings: phy: uniphier-ahci: Fix missing reset-names Kunihiko Hayashi
2022-03-30 10:55 ` [PATCH v3 4/5] dt-bindings: phy: uniphier-usb3hs: Fix incorrect clock-names and reset-names Kunihiko Hayashi
2022-03-30 10:55 ` [PATCH v3 5/5] dt-bindings: phy: uniphier: Clean up clocks, resets, and their names using compatible string Kunihiko Hayashi
2022-03-30 17:40   ` Krzysztof Kozlowski [this message]
2022-03-31  0:50     ` Kunihiko Hayashi
2022-03-31  5:53       ` Krzysztof Kozlowski
2022-04-13  6:42 ` [PATCH v3 0/5] dt-bindings: phy: Fix uniphier descriptions Vinod Koul

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=a784ed61-965a-5c68-c2dd-3340cf18c7b5@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=kishon@ti.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=mhiramat@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=vkoul@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).