[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240419210949.GA3979121-robh@kernel.org>
Date: Fri, 19 Apr 2024 16:09:49 -0500
From: Rob Herring <robh@...nel.org>
To: Jan Dakinevich <jan.dakinevich@...utedevices.com>
Cc: Neil Armstrong <neil.armstrong@...aro.org>,
Jerome Brunet <jbrunet@...libre.com>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Kevin Hilman <khilman@...libre.com>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
Philipp Zabel <p.zabel@...gutronix.de>,
Jiucheng Xu <jiucheng.xu@...ogic.com>,
linux-amlogic@...ts.infradead.org, linux-clk@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [RFC PATCH v3 4/6] dt-bindings: clock: meson: document A1 SoC
audio clock controller driver
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@...utedevices.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
Powered by blists - more mailing lists