All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Jan Dakinevich <jan.dakinevich@salutedevices.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Jiucheng Xu <jiucheng.xu@amlogic.com>,
	linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC PATCH v3 4/6] dt-bindings: clock: meson: document A1 SoC audio clock controller driver
Date: Fri, 19 Apr 2024 16:09:49 -0500	[thread overview]
Message-ID: <20240419210949.GA3979121-robh@kernel.org> (raw)
In-Reply-To: <20240419125812.983409-5-jan.dakinevich@salutedevices.com>

On Fri, Apr 19, 2024 at 03:58:10PM +0300, Jan Dakinevich wrote:
> Add device tree bindings for A1 SoC audio clock and reset controllers.
> 
> Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
> ---
> 
> This controller has 6 mandatory and up to 20 optional clocks. To describe
> this, I use 'additionalItems'. It produces correct processed-schema.json:
> 
>   "clock-names": {
>       "maxItems": 26,
>       "items": [
>           {
>               "const": "pclk"
>           },
>           {
>               "const": "dds_in"
>           },
>           {
>               "const": "fclk_div2"
>           },
>           {
>               "const": "fclk_div3"
>           },
>           {
>               "const": "hifi_pll"
>           },
>           {
>               "const": "xtal"
>           }
>       ],
>       "additionalItems": {
>           "oneOf": [
>               {
>                   "pattern": "^slv_sclk[0-9]$"
>               },
>               {
>                   "pattern": "^slv_lrclk[0-9]$"
>               }
>           ]
>       },
>       "type": "array",
>       "minItems": 6
>   },
> 
> and it behaves as expected. However, the checking is followed by
> complaints like this:
> 
>   Documentation/devicetree/bindings/clock/amlogic,a1-audio-clkc.yaml: properties:clock-names:additionalItems: {'oneOf': [{'pattern': '^slv_sclk[0-9]$'}, {'pattern': '^slv_lrclk[0-9]$'}]} is not of type 'boolean'
> 
> And indeed, 'additionalItems' has boolean type in meta-schema. So, how to
> do it right?

The meta-schemas are written both to prevent nonsense that json-schema 
allows by default (e.g additionalitems (wrong case)) and constraints to 
follow the patterns we expect. I'm happy to loosen the latter case if 
there's really a need. 

Generally, most bindings shouldn't be using 'additionalItems' at all as 
all entries should be defined, but there's a few exceptions. Here, the 
only reasoning I see is 26 entries is a lot to write out, but that 
wouldn't really justify it. As Krzysztof pointed out, you either have 
the clocks in the h/w or you don't, so saying they are variable is 
suspect.

Rob

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: Jan Dakinevich <jan.dakinevich@salutedevices.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Jiucheng Xu <jiucheng.xu@amlogic.com>,
	linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC PATCH v3 4/6] dt-bindings: clock: meson: document A1 SoC audio clock controller driver
Date: Fri, 19 Apr 2024 16:09:49 -0500	[thread overview]
Message-ID: <20240419210949.GA3979121-robh@kernel.org> (raw)
In-Reply-To: <20240419125812.983409-5-jan.dakinevich@salutedevices.com>

On Fri, Apr 19, 2024 at 03:58:10PM +0300, Jan Dakinevich wrote:
> Add device tree bindings for A1 SoC audio clock and reset controllers.
> 
> Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
> ---
> 
> This controller has 6 mandatory and up to 20 optional clocks. To describe
> this, I use 'additionalItems'. It produces correct processed-schema.json:
> 
>   "clock-names": {
>       "maxItems": 26,
>       "items": [
>           {
>               "const": "pclk"
>           },
>           {
>               "const": "dds_in"
>           },
>           {
>               "const": "fclk_div2"
>           },
>           {
>               "const": "fclk_div3"
>           },
>           {
>               "const": "hifi_pll"
>           },
>           {
>               "const": "xtal"
>           }
>       ],
>       "additionalItems": {
>           "oneOf": [
>               {
>                   "pattern": "^slv_sclk[0-9]$"
>               },
>               {
>                   "pattern": "^slv_lrclk[0-9]$"
>               }
>           ]
>       },
>       "type": "array",
>       "minItems": 6
>   },
> 
> and it behaves as expected. However, the checking is followed by
> complaints like this:
> 
>   Documentation/devicetree/bindings/clock/amlogic,a1-audio-clkc.yaml: properties:clock-names:additionalItems: {'oneOf': [{'pattern': '^slv_sclk[0-9]$'}, {'pattern': '^slv_lrclk[0-9]$'}]} is not of type 'boolean'
> 
> And indeed, 'additionalItems' has boolean type in meta-schema. So, how to
> do it right?

The meta-schemas are written both to prevent nonsense that json-schema 
allows by default (e.g additionalitems (wrong case)) and constraints to 
follow the patterns we expect. I'm happy to loosen the latter case if 
there's really a need. 

Generally, most bindings shouldn't be using 'additionalItems' at all as 
all entries should be defined, but there's a few exceptions. Here, the 
only reasoning I see is 26 entries is a lot to write out, but that 
wouldn't really justify it. As Krzysztof pointed out, you either have 
the clocks in the h/w or you don't, so saying they are variable is 
suspect.

Rob

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: Jan Dakinevich <jan.dakinevich@salutedevices.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Jiucheng Xu <jiucheng.xu@amlogic.com>,
	linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC PATCH v3 4/6] dt-bindings: clock: meson: document A1 SoC audio clock controller driver
Date: Fri, 19 Apr 2024 16:09:49 -0500	[thread overview]
Message-ID: <20240419210949.GA3979121-robh@kernel.org> (raw)
In-Reply-To: <20240419125812.983409-5-jan.dakinevich@salutedevices.com>

On Fri, Apr 19, 2024 at 03:58:10PM +0300, Jan Dakinevich wrote:
> Add device tree bindings for A1 SoC audio clock and reset controllers.
> 
> Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
> ---
> 
> This controller has 6 mandatory and up to 20 optional clocks. To describe
> this, I use 'additionalItems'. It produces correct processed-schema.json:
> 
>   "clock-names": {
>       "maxItems": 26,
>       "items": [
>           {
>               "const": "pclk"
>           },
>           {
>               "const": "dds_in"
>           },
>           {
>               "const": "fclk_div2"
>           },
>           {
>               "const": "fclk_div3"
>           },
>           {
>               "const": "hifi_pll"
>           },
>           {
>               "const": "xtal"
>           }
>       ],
>       "additionalItems": {
>           "oneOf": [
>               {
>                   "pattern": "^slv_sclk[0-9]$"
>               },
>               {
>                   "pattern": "^slv_lrclk[0-9]$"
>               }
>           ]
>       },
>       "type": "array",
>       "minItems": 6
>   },
> 
> and it behaves as expected. However, the checking is followed by
> complaints like this:
> 
>   Documentation/devicetree/bindings/clock/amlogic,a1-audio-clkc.yaml: properties:clock-names:additionalItems: {'oneOf': [{'pattern': '^slv_sclk[0-9]$'}, {'pattern': '^slv_lrclk[0-9]$'}]} is not of type 'boolean'
> 
> And indeed, 'additionalItems' has boolean type in meta-schema. So, how to
> do it right?

The meta-schemas are written both to prevent nonsense that json-schema 
allows by default (e.g additionalitems (wrong case)) and constraints to 
follow the patterns we expect. I'm happy to loosen the latter case if 
there's really a need. 

Generally, most bindings shouldn't be using 'additionalItems' at all as 
all entries should be defined, but there's a few exceptions. Here, the 
only reasoning I see is 26 entries is a lot to write out, but that 
wouldn't really justify it. As Krzysztof pointed out, you either have 
the clocks in the h/w or you don't, so saying they are variable is 
suspect.

Rob

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2024-04-19 21:10 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19 12:58 [RFC PATCH v3 0/6] Add A1 Soc audio clock controller driver Jan Dakinevich
2024-04-19 12:58 ` Jan Dakinevich
2024-04-19 12:58 ` Jan Dakinevich
2024-04-19 12:58 ` [RFC PATCH v3 1/6] reset: reset-meson-audio: introduce separate driver Jan Dakinevich
2024-04-19 12:58   ` Jan Dakinevich
2024-04-19 12:58   ` Jan Dakinevich
2024-04-22  7:46   ` Jerome Brunet
2024-04-22  7:46     ` Jerome Brunet
2024-04-22  7:46     ` Jerome Brunet
2024-05-14 18:33     ` Jan Dakinevich
2024-05-14 18:33       ` Jan Dakinevich
2024-05-14 18:33       ` Jan Dakinevich
2024-04-19 12:58 ` [RFC PATCH v3 2/6] clk: meson: axg: share the set of audio helper macro Jan Dakinevich
2024-04-19 12:58   ` Jan Dakinevich
2024-04-19 12:58   ` Jan Dakinevich
2024-04-19 12:58 ` [RFC PATCH v3 3/6] clk: meson: axg: introduce AUD_MUX_TABLE() " Jan Dakinevich
2024-04-19 12:58   ` Jan Dakinevich
2024-04-19 12:58   ` Jan Dakinevich
2024-04-22  8:09   ` Jerome Brunet
2024-04-22  8:09     ` Jerome Brunet
2024-04-22  8:09     ` Jerome Brunet
2024-04-19 12:58 ` [RFC PATCH v3 4/6] dt-bindings: clock: meson: document A1 SoC audio clock controller driver Jan Dakinevich
2024-04-19 12:58   ` Jan Dakinevich
2024-04-19 12:58   ` Jan Dakinevich
2024-04-19 14:06   ` Krzysztof Kozlowski
2024-04-19 14:06     ` Krzysztof Kozlowski
2024-04-19 14:06     ` Krzysztof Kozlowski
2024-04-20 14:48     ` Jan Dakinevich
2024-04-20 14:48       ` Jan Dakinevich
2024-04-20 14:48       ` Jan Dakinevich
2024-04-21 14:02       ` Krzysztof Kozlowski
2024-04-21 14:02         ` Krzysztof Kozlowski
2024-04-21 14:02         ` Krzysztof Kozlowski
2024-04-21 15:35         ` Jan Dakinevich
2024-04-21 15:35           ` Jan Dakinevich
2024-04-21 15:35           ` Jan Dakinevich
2024-04-21 18:17           ` Krzysztof Kozlowski
2024-04-21 18:17             ` Krzysztof Kozlowski
2024-04-21 18:17             ` Krzysztof Kozlowski
2024-04-22  7:43       ` Jerome Brunet
2024-04-22  7:43         ` Jerome Brunet
2024-04-22  7:43         ` Jerome Brunet
2024-04-19 16:44   ` Rob Herring
2024-04-19 16:44     ` Rob Herring
2024-04-19 16:44     ` Rob Herring
2024-04-19 21:09   ` Rob Herring [this message]
2024-04-19 21:09     ` Rob Herring
2024-04-19 21:09     ` Rob Herring
2024-04-20 16:15     ` Jan Dakinevich
2024-04-20 16:15       ` Jan Dakinevich
2024-04-20 16:15       ` Jan Dakinevich
2024-04-21 18:14       ` Krzysztof Kozlowski
2024-04-21 18:14         ` Krzysztof Kozlowski
2024-04-21 18:14         ` Krzysztof Kozlowski
2024-04-21 21:03         ` Jan Dakinevich
2024-04-21 21:03           ` Jan Dakinevich
2024-04-21 21:03           ` Jan Dakinevich
2024-04-22  7:16         ` Jerome Brunet
2024-04-22  7:16           ` Jerome Brunet
2024-04-22  7:16           ` Jerome Brunet
2024-04-22  7:57           ` Jerome Brunet
2024-04-22  7:57             ` Jerome Brunet
2024-04-22  7:57             ` Jerome Brunet
2024-04-22 14:31             ` Jan Dakinevich
2024-04-22 14:31               ` Jan Dakinevich
2024-04-22 14:31               ` Jan Dakinevich
2024-04-22 15:38               ` Jerome Brunet
2024-04-22 15:38                 ` Jerome Brunet
2024-04-22 15:38                 ` Jerome Brunet
2024-04-22 15:43               ` Jan Dakinevich
2024-04-22 15:43                 ` Jan Dakinevich
2024-04-22 15:43                 ` Jan Dakinevich
2024-04-22  7:40   ` Jerome Brunet
2024-04-22  7:40     ` Jerome Brunet
2024-04-22  7:40     ` Jerome Brunet
2024-04-19 12:58 ` [RFC PATCH v3 5/6] clk: meson: a1: add the " Jan Dakinevich
2024-04-19 12:58   ` Jan Dakinevich
2024-04-19 12:58   ` Jan Dakinevich
2024-04-22  7:53   ` Jerome Brunet
2024-04-22  7:53     ` Jerome Brunet
2024-04-22  7:53     ` Jerome Brunet
2024-04-22 13:49     ` Jan Dakinevich
2024-04-22 13:49       ` Jan Dakinevich
2024-04-22 13:49       ` Jan Dakinevich
2024-04-19 12:58 ` [RFC PATCH v3 6/6] arm64: dts: meson: a1: add the audio clock controller Jan Dakinevich
2024-04-19 12:58   ` Jan Dakinevich
2024-04-19 12:58   ` Jan Dakinevich

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=20240419210949.GA3979121-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jan.dakinevich@salutedevices.com \
    --cc=jbrunet@baylibre.com \
    --cc=jiucheng.xu@amlogic.com \
    --cc=khilman@baylibre.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mturquette@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=p.zabel@pengutronix.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.