public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Claudiu Beznea <claudiu.beznea@microchip.com>,
	mturquette@baylibre.com, sboyd@kernel.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, nicolas.ferre@microchip.com,
	alexandre.belloni@bootlin.com
Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/5] dt-bindings: clocks: at91sam9x5-sckc: convert to yaml
Date: Thu, 4 May 2023 14:50:46 +0200	[thread overview]
Message-ID: <7f9f991a-fa56-2f65-293b-bd0ec5d07c40@linaro.org> (raw)
In-Reply-To: <20230504060729.689579-6-claudiu.beznea@microchip.com>

On 04/05/2023 08:07, Claudiu Beznea wrote:
> Convert Atmel slow clock controller documentation to yaml.
> 
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> ---
>  .../devicetree/bindings/clock/at91-clock.txt  | 30 -------
>  .../bindings/clock/atmel,at91sam9x5-sckc.yaml | 84 +++++++++++++++++++
>  2 files changed, 84 insertions(+), 30 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/clock/at91-clock.txt
>  create mode 100644 Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml
> 
> diff --git a/Documentation/devicetree/bindings/clock/at91-clock.txt b/Documentation/devicetree/bindings/clock/at91-clock.txt
> deleted file mode 100644
> index 57394785d3b0..000000000000
> --- a/Documentation/devicetree/bindings/clock/at91-clock.txt
> +++ /dev/null
> @@ -1,30 +0,0 @@
> -Device Tree Clock bindings for arch-at91
> -
> -This binding uses the common clock binding[1].
> -
> -[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
> -
> -Slow Clock controller:
> -
> -Required properties:
> -- compatible : shall be one of the following:
> -	"atmel,at91sam9x5-sckc",
> -	"atmel,sama5d3-sckc",
> -	"atmel,sama5d4-sckc" or
> -	"microchip,sam9x60-sckc":
> -		at91 SCKC (Slow Clock Controller)
> -- #clock-cells : shall be 1 for "microchip,sam9x60-sckc" otherwise shall be 0.
> -- clocks : shall be the input parent clock phandle for the clock.
> -
> -Optional properties:
> -- atmel,osc-bypass : boolean property. Set this when a clock signal is directly
> -  provided on XIN.
> -
> -For example:
> -	sckc@fffffe50 {
> -		compatible = "atmel,at91sam9x5-sckc";
> -		reg = <0xfffffe50 0x4>;
> -		clocks = <&slow_xtal>;
> -		#clock-cells = <0>;
> -	};
> -
> diff --git a/Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml b/Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml
> new file mode 100644
> index 000000000000..62660c823ea1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/atmel,at91sam9x5-sckc.yaml
> @@ -0,0 +1,84 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/clock/atmel,at91sam9x5-sckc.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"

Drop quotes.

> +
> +title: Atmel Slow Clock Controller (SCKC)
> +
> +maintainers:
> +  - Claudiu Beznea <claudiu.beznea@microchip.com>
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - items:

Drop items here.

> +          - enum:
> +              - atmel,at91sam9x5-sckc
> +              - atmel,sama5d4-sckc
> +              - atmel,sama5d3-sckc

Keep order by name, so 5d3 and then 5d4.

> +              - microchip,sam9x60-sckc
> +      - items:
> +          - const: microchip,sama7g5-sckc
> +          - const: microchip,sam9x60-sckc
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  "#clock-cells":
> +    enum: [0, 1]
> +
> +  atmel,osc-bypass:
> +    type: boolean
> +    description: set when a clock signal is directly provided on XIN
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false

put it after allOf, just like previous patch.

> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - microchip,sam9x60-sckc
> +              - microchip,sama7g5-sckc

Drop this one. It's not needed.

> +    then:
> +      properties:
> +        "#clock-cells":
> +          const: 1
> +      required:
> +        - "#clock-cells"
> +        - clocks

Move these to top-level.

> +    else:
> +      properties:
> +        "#clock-cells":
> +          const: 0
> +      if:
> +        properties:
> +          compatible:
> +            contains:
> +              enum:
> +                - atmel,sama5d4-sckc
> +                - atmel,sama5d3-sckc
> +      then:
> +        required:
> +          - "#clock-cells"
> +          - clocks

and drop these required... but this is if-within-else. Very confusing.
Which case you want to handle that way? So other compatibles do not need
clock cells or clocks?


Best regards,
Krzysztof


  reply	other threads:[~2023-05-04 12:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-04  6:07 [PATCH 0/5] dt-bindings: clocks: at91: convert to yaml Claudiu Beznea
2023-05-04  6:07 ` [PATCH 1/5] ARM: dts: at91: use clock-controller name for PMC nodes Claudiu Beznea
2023-05-04  6:07 ` [PATCH 2/5] dt-bindings: clocks: atmel,at91rm9200-pmc: convert to yaml Claudiu Beznea
2023-05-04 12:47   ` Krzysztof Kozlowski
2023-05-05 12:46     ` Claudiu.Beznea
2023-05-05 14:07       ` Krzysztof Kozlowski
2023-05-04  6:07 ` [PATCH 3/5] ARM: dts: at91: at91sam9n12: witch sckc to new clock bindings Claudiu Beznea
2023-05-04  6:07 ` [PATCH 4/5] ARM: dts: at91: use clock-controller name for sckc nodes Claudiu Beznea
2023-05-04  6:07 ` [PATCH 5/5] dt-bindings: clocks: at91sam9x5-sckc: convert to yaml Claudiu Beznea
2023-05-04 12:50   ` Krzysztof Kozlowski [this message]
2023-05-05 12:51     ` Claudiu.Beznea

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=7f9f991a-fa56-2f65-293b-bd0ec5d07c40@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@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