mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	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 v2 5/5] dt-bindings: phy: uniphier: Clean up clock-names and reset-names using compatible string
Date: Wed, 30 Mar 2022 19:24:08 +0900	[thread overview]
Message-ID: <7f1c3ded-5405-44d8-c5c2-8f7d7a42b1fc@socionext.com> (raw)
In-Reply-To: <65d1eebd-f460-4073-4dc1-b1de62aa2ee4@linaro.org>

Hi Krzysztof,

On 2022/03/30 18:45, Krzysztof Kozlowski wrote:
> On 30/03/2022 11:16, Kunihiko Hayashi wrote:
>> Hi Krzysztof,
>>
>> On 2022/03/30 17:13, Krzysztof Kozlowski wrote:
>>> On 30/03/2022 07:20, Kunihiko Hayashi wrote:
>>>> Instead of "oneOf:" choices, use "allOf:" and "if:" to define
>>>> clock-names
>>>> 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      | 73 ++++++++++++------
>>>>    .../phy/socionext,uniphier-pcie-phy.yaml      | 37 ++++++---
>>>>    .../phy/socionext,uniphier-usb3hs-phy.yaml    | 75 +++++++++++++-----
>>>>    .../phy/socionext,uniphier-usb3ss-phy.yaml    | 77 ++++++++++++++-----
>>>>    4 files changed, 188 insertions(+), 74 deletions(-)
>>>>
>>>> diff --git
>>>> a/Documentation/devicetree/bindings/phy/socionext,uniphier-ahci-phy.yaml
>>>> b/Documentation/devicetree/bindings/phy/socionext,uniphier-ahci-phy.yaml
>>>> index 14f7579e7daa..61d9306e1852 100644
>>>> ---
>>>> a/Documentation/devicetree/bindings/phy/socionext,uniphier-ahci-phy.yaml
>>>> +++
>>>> b/Documentation/devicetree/bindings/phy/socionext,uniphier-ahci-phy.yaml
>>>> @@ -30,33 +30,62 @@ properties:
>>>>        minItems: 1
>>>>        maxItems: 2
>>>>
>>>> -  clock-names:
>>>> -    oneOf:
>>>> -      - items:          # for PXs2
>>>> -          - const: link
>>>> -      - items:          # for Pro4
>>>> -          - const: link
>>>> -          - const: gio
>>>> -      - items:          # for others
>>>> -          - const: link
>>>> -          - const: phy
>>>> +  clock-names: true
>>>>
>>>>      resets:
>>>>        minItems: 2
>>>>        maxItems: 6
>>>>
>>>> -  reset-names:
>>>> -    oneOf:
>>>> -      - items:          # for Pro4
>>>> -          - const: link
>>>> -          - const: gio
>>>> -          - const: phy
>>>> -          - const: pm
>>>> -          - const: tx
>>>> -          - const: rx
>>>> -      - items:          # for others
>>>> -          - const: link
>>>> -          - const: phy
>>>> +  reset-names: true
>>>> +
>>>> +allOf:
>>>> +  - if:
>>>> +      properties:
>>>> +        compatible:
>>>> +          contains:
>>>> +            const: socionext,uniphier-pro4-ahci-phy
>>>> +    then:
>>>> +      properties:
>>>> +        clock-names:
>>>> +          items:
>>>> +            - const: link
>>>> +            - const: gio
>>>> +        reset-names:
>>>> +          items:
>>>> +            - const: link
>>>> +            - const: gio
>>>> +            - const: phy
>>>> +            - const: pm
>>>> +            - const: tx
>>>> +            - const: rx
>>>
>>> Constrain also everywhere clocks and resets, so here should be:
>>>     resets:
>>>       minItems: 6
>>>       maxItems: 6
>>
>> If I put the constraint here, it would conflict with the original one.
>> Should I also replace the original resets
>>
>>       resets:
>>         minItems: 2
>>         maxItems: 6
>>
>> with "resets: true"?
> 
> It should not conflict. Check the bindings for Samsung Exynos clock I
> sent you last time. In the main "properties" you put the widest
> constraints, like you have now (2-6). Then for each compatible you
> narrow it (2-2, 6-6).
> 
> You can later test it by adding/removing clocks to check if constraints
> are properly working.

I understand. The main "properties" should be the widest constraints,
and I checked that Exynos clock is set to the widest (1-10).
I'll add the constraints.

Thank you,

---
Best Regards
Kunihiko Hayashi

      reply	other threads:[~2022-03-30 10:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30  5:20 [PATCH v2 0/5] dt-bindings: phy: Fix uniphier descriptions Kunihiko Hayashi
2022-03-30  5:20 ` [PATCH v2 1/5] dt-bindings: phy: uniphier-usb2: Add vbus-supply Kunihiko Hayashi
2022-03-30  5:20 ` [PATCH v2 2/5] dt-bindings: phy: uniphier-usb3ss: Treat vbus-supply as optional Kunihiko Hayashi
2022-03-30  5:20 ` [PATCH v2 3/5] dt-bindings: phy: uniphier-ahci: Fix missing reset-names Kunihiko Hayashi
2022-03-30  8:08   ` Krzysztof Kozlowski
2022-03-30  5:20 ` [PATCH v2 4/5] dt-bindings: phy: uniphier-usb3hs: Fix incorrect clock-names and reset-names Kunihiko Hayashi
2022-03-30  8:10   ` Krzysztof Kozlowski
2022-03-30  5:20 ` [PATCH v2 5/5] dt-bindings: phy: uniphier: Clean up clock-names and reset-names using compatible string Kunihiko Hayashi
2022-03-30  8:13   ` Krzysztof Kozlowski
2022-03-30  9:16     ` Kunihiko Hayashi
2022-03-30  9:45       ` Krzysztof Kozlowski
2022-03-30 10:24         ` Kunihiko Hayashi [this message]

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=7f1c3ded-5405-44d8-c5c2-8f7d7a42b1fc@socionext.com \
    --to=hayashi.kunihiko@socionext.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kishon@ti.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzysztof.kozlowski@linaro.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

all inboxes | Powered by JetHome®