[PATCH v2 00/10] ASoC: dt-bindings: audio-graph-port related update
Hi ASoC ML, DT ML Cc Geert
These v2 patches fixups audio-graph-port, and its related DT schema. Audio-Graph-Card and Simple-Audio-Card are similar Card and are sharing same utils. Thus we can also sharing same schema.
This patch-set fixup some Renesas's "make dtbs_check".
v1 -> v2 - remove patch for Nvidia - tidyup ti,pcm3168a schema - maintainers - ports - explain more on git-log
Link: https://lore.kernel.org/r/87v8mepyoy.wl-kuninori.morimoto.gx@renesas.com
Geert Uytterhoeven (1): ASoC: dt-bindings: ti,pcm3168a: Convert to json-schema
Kuninori Morimoto (9): ASoC: dt-bindings: audio-graph-port: use definitions for port/endpoint ASoC: dt-bindings: audio-graph-port: add definitions/ports ASoC: dt-bindings: audio-graph-port: add missing mclk-fs ASoC: dt-bindings: audio-graph-port: add clocks on endpoint ASoC: dt-bindings: audio-graph-port: remove prefix ASoC: dt-bindings: ak4613: enable Of-graph (Audio-Graph-Card) style ASoC: dt-bindings: renesas,rsnd: add missing playback/capture ASoC: dt-bindings: renesas,rsnd: #sound-dai-cells is not mandatory ASoC: dt-bindings: simple-card: add missing #address-cells/#size-cells
.../devicetree/bindings/sound/ak4613.yaml | 7 ++ .../bindings/sound/audio-graph-port.yaml | 65 +++++++---- .../bindings/sound/renesas,rsnd.yaml | 27 ++++- .../bindings/sound/simple-card.yaml | 4 + .../devicetree/bindings/sound/ti,pcm3168a.txt | 56 --------- .../bindings/sound/ti,pcm3168a.yaml | 107 ++++++++++++++++++ 6 files changed, 184 insertions(+), 82 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/ti,pcm3168a.txt create mode 100644 Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Audio Graph base driver might need to add its own properties. In such case, having definitions for port/endpoint is easy to handle it. This patch adds definitions for port/endpoint.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- .../bindings/sound/audio-graph-port.yaml | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml index f5b8b6d13077c..fa66b73abcaf2 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml @@ -11,25 +11,22 @@ maintainers:
select: false
-allOf: - - $ref: /schemas/graph.yaml#/$defs/port-base - -properties: - prefix: - description: "device name prefix" - $ref: /schemas/types.yaml#/definitions/string - convert-rate: - $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate" - convert-channels: - $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels" - convert-sample-format: - $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-format" +definitions: + port-base: + $ref: /schemas/graph.yaml#/$defs/port-base + properties: + prefix: + description: "device name prefix" + $ref: /schemas/types.yaml#/definitions/string + convert-rate: + $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate" + convert-channels: + $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels" + convert-sample-format: + $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-format"
-patternProperties: - "^endpoint(@[0-9a-f]+)?": + endpoint-base: $ref: /schemas/graph.yaml#/$defs/endpoint-base - unevaluatedProperties: false - properties: mclk-fs: description: | @@ -100,4 +97,12 @@ patternProperties: minimum: 1 maximum: 64
+allOf: + - $ref: "#/definitions/port-base" + +patternProperties: + "^endpoint(@[0-9a-f]+)?": + $ref: "#/definitions/endpoint-base" + unevaluatedProperties: false + additionalProperties: true
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Audio Graph user needs "ports" not only "port". This patch adds standard "ports" as definitions to use it easily.
If user needs standard "ports", it can use
ports: $ref: audio-graph-port.yaml#/definitions/ports
If user want to use custom ports, it can re-use audio-graph-port.yaml#/definitions/port-base" audio-graph-port.yaml#/definitions/endpoint-base"
https://lore.kernel.org/r/87sfhipynv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- .../devicetree/bindings/sound/audio-graph-port.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml index fa66b73abcaf2..6fcf7f567424d 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml @@ -97,6 +97,18 @@ definitions: minimum: 1 maximum: 64
+ ports: + $ref: "#/definitions/port-base" + unevaluatedProperties: false + patternProperties: + "^port(@[0-9a-f]+)?$": + $ref: "#/definitions/port-base" + unevaluatedProperties: false + patternProperties: + "^endpoint(@[0-9a-f]+)?": + $ref: "#/definitions/endpoint-base" + unevaluatedProperties: false + allOf: - $ref: "#/definitions/port-base"
On Wed, Jan 11, 2023 at 01:09:52AM +0000, Kuninori Morimoto wrote:
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Audio Graph user needs "ports" not only "port". This patch adds standard "ports" as definitions to use it easily.
If user needs standard "ports", it can use
ports: $ref: audio-graph-port.yaml#/definitions/ports
If user want to use custom ports, it can re-use audio-graph-port.yaml#/definitions/port-base" audio-graph-port.yaml#/definitions/endpoint-base"
https://lore.kernel.org/r/87sfhipynv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
.../devicetree/bindings/sound/audio-graph-port.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml index fa66b73abcaf2..6fcf7f567424d 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml @@ -97,6 +97,18 @@ definitions: minimum: 1 maximum: 64
- ports:
- $ref: "#/definitions/port-base"
This applies to 'port' nodes, but this is the 'ports' node.
For example, this schema says you can have endpoint nodes directly under 'ports' which is not valid.
But why do you need this? The graph.yaml schema should be sufficient because you aren't adding custom properties in 'ports'. BTW, the preference is to only add properties in 'endpoint' nodes.
- unevaluatedProperties: false
- patternProperties:
"^port(@[0-9a-f]+)?$":
$ref: "#/definitions/port-base"
unevaluatedProperties: false
If 'ports' schema is applied to a DT, then its 'port' node(s) cannot have any additional properties. That defeats the point of patch 1.
You cannot have 2 schemas with child nodes and be able to extend the properties on the child nodes. The 2 child node schemas can't 'see' each other in that case. In these cases, the base child node schema has to be referenced directly by the extended child node schema.
patternProperties:
"^endpoint(@[0-9a-f]+)?":
$ref: "#/definitions/endpoint-base"
unevaluatedProperties: false
The same thing applies here.
Rob
Hi Rob
Thank for your feedback.
- ports:
- $ref: "#/definitions/port-base"
This applies to 'port' nodes, but this is the 'ports' node.
For example, this schema says you can have endpoint nodes directly under 'ports' which is not valid.
It is a little bit confusable, but "port-base" doesn't include "endpoint" (A). It is the reason why audio-graph-port.yaml has patternProperties for endpoint (B), if my understand was correct. And user use audio-graph-port.yaml for "port" (C) Thus, above doesn't indicate that "ports" can use direct "endpoint".
--- audio-graph-port.yaml --- ^ port-base: | $ref: /schemas/graph.yaml#/$defs/port-base | properties: | convert-rate: | $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate" (A) convert-channels: | $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels" | convert-sample-format: | $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-format" | mclk-fs: v $ref: "simple-card.yaml#/definitions/mclk-fs"
endpoint-base: ...
allOf: (B) - $ref: "#/definitions/port-base" /* this doesn't include "endpoint" */
patternProperties: (B) "^endpoint(@[0-9a-f]+)?": $ref: "#/definitions/endpoint-base" /* "endpoint" is defined here */ unevaluatedProperties: false -----------------------------
--- port user ---- port: (C) $ref: audio-graph-port.yaml# ------------------
But why do you need this? The graph.yaml schema should be sufficient
Sometimes Audio Graph Card/Card2 want to use "ports" not only "port". People can use "audio-graph-card.yaml" as "port" today (C). So we want to use similar style for *normal* "ports. "ports" is defined under "definitions" (D), so there is no effect for normal "port" user, I think.
--- port user ---- port: (C) $ref: audio-graph-port.yaml# ------------------ --- ports user --- ports: (D) $ref: audio-graph-port.yaml#/definitions/ports ------------------
As I mentioned on git-log, *normal* ports user can use (D) style. *custom* ports user can reuse "port-base" and "endpoint-base". see below.
---- git log --------------------------------------- If user needs standard "ports", it can use
ports: $ref: audio-graph-port.yaml#/definitions/ports
If user want to use custom ports, it can re-use audio-graph-port.yaml#/definitions/port-base" audio-graph-port.yaml#/definitions/endpoint-base" ----------------------------------------------------
because you aren't adding custom properties in 'ports'.
(snip)
If 'ports' schema is applied to a DT, then its 'port' node(s) cannot have any additional properties. That defeats the point of patch 1.
Renesas Sound want to have custom "port", but sometimes it want to use "ports" too. [08/10] patch customs both "ports" and "port".
Thank you for your help !!
Best regards --- Kuninori Morimoto
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
audio-graph-port is missing "mclk-fs" on ports/port, it is used not only endpoint. It is already defined on simple-card. This patch fixup it. Without this patch, we will get below warning.
${LINUX}/arch/arm64/boot/dts/renesas/r8a77951-ulcb-kf.dtb: audio-codec@44: ports: 'mclk-fs' does not match any of the regexes: '^port@[0-9a-f]+$', 'pinctrl-[0-9]+' From schema: ${LINUX}/Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- .../devicetree/bindings/sound/audio-graph-port.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml index 6fcf7f567424d..036682e55b2dd 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml @@ -24,16 +24,14 @@ definitions: $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels" convert-sample-format: $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-format" + mclk-fs: + $ref: "simple-card.yaml#/definitions/mclk-fs"
endpoint-base: $ref: /schemas/graph.yaml#/$defs/endpoint-base properties: mclk-fs: - description: | - Multiplication factor between stream rate and codec mclk. - When defined, mclk-fs property defined in dai-link sub nodes are - ignored. - $ref: /schemas/types.yaml#/definitions/uint32 + $ref: "simple-card.yaml#/definitions/mclk-fs" frame-inversion: description: dai-link uses frame clock inversion $ref: /schemas/types.yaml#/definitions/flag
On Wed, Jan 11, 2023 at 01:10:29AM +0000, Kuninori Morimoto wrote:
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
audio-graph-port is missing "mclk-fs" on ports/port, it is used not only endpoint. It is already defined on simple-card. This patch fixup it. Without this patch, we will get below warning.
${LINUX}/arch/arm64/boot/dts/renesas/r8a77951-ulcb-kf.dtb: audio-codec@44: ports: 'mclk-fs' does not match any of the regexes: '^port@[0-9a-f]+$', 'pinctrl-[0-9]+' From schema: ${LINUX}/Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml
IMO, the warning is correct. 'ports' should not be anything but a container of 'port' nodes. If something applies to all ports, then it should probably be in the device node (or implicit).
Rob
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Audio Graph endpoint is possible to have clocks, and system-clock-xxx, but these are missing on audio-graph-port.yaml. These have been already defined on simple-card.yaml.
This patch re-use these. We will get below warning without this patch.
${LINUX}/arch/arm64/boot/dts/renesas/r8a77950-ulcb-kf.dtb: audio-codec@44: ports:port@0:endpoint: Unevaluated properties are not allowed ('clocks' was unexpected) From schema: ${LINUX}/Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml
Link: https://lore.kernel.org/r/87pmcmpyml.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- .../devicetree/bindings/sound/audio-graph-port.yaml | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml index 036682e55b2dd..edd6cc37118ee 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml @@ -48,6 +48,15 @@ definitions: oneOf: - $ref: /schemas/types.yaml#/definitions/flag - $ref: /schemas/types.yaml#/definitions/phandle + clocks: + description: Indicates system clock + $ref: /schemas/types.yaml#/definitions/phandle + system-clock-frequency: + $ref: "simple-card.yaml#/definitions/system-clock-frequency" + system-clock-direction-out: + $ref: "simple-card.yaml#/definitions/system-clock-direction-out" + system-clock-fixed: + $ref: "simple-card.yaml#/definitions/system-clock-fixed"
dai-format: description: audio format.
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Audio Graph port doesn't use prefix. This patch removes it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- Documentation/devicetree/bindings/sound/audio-graph-port.yaml | 3 --- 1 file changed, 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml index edd6cc37118ee..6b4e02a0695ad 100644 --- a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml +++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml @@ -15,9 +15,6 @@ definitions: port-base: $ref: /schemas/graph.yaml#/$defs/port-base properties: - prefix: - description: "device name prefix" - $ref: /schemas/types.yaml#/definitions/string convert-rate: $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate" convert-channels:
On Wed, 11 Jan 2023 01:11:08 +0000, Kuninori Morimoto wrote:
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Audio Graph port doesn't use prefix. This patch removes it.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Documentation/devicetree/bindings/sound/audio-graph-port.yaml | 3 --- 1 file changed, 3 deletions(-)
Acked-by: Rob Herring robh@kernel.org
From: Geert Uytterhoeven geert+renesas@glider.be
Convert the Texas Instruments PCM3168A Audio Codec Device Tree binding documentation to json-schema.
Add missing properties. Drop unneeded pinctrl properties from example.
Link: https://lore.kernel.org/r/cover.1669980383.git.geert+renesas@glider.be Link: https://lore.kernel.org/r/87mt7qpylw.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven geert+renesas@glider.be Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- .../devicetree/bindings/sound/ti,pcm3168a.txt | 56 --------- .../bindings/sound/ti,pcm3168a.yaml | 107 ++++++++++++++++++ 2 files changed, 107 insertions(+), 56 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/ti,pcm3168a.txt create mode 100644 Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml
diff --git a/Documentation/devicetree/bindings/sound/ti,pcm3168a.txt b/Documentation/devicetree/bindings/sound/ti,pcm3168a.txt deleted file mode 100644 index a02ecaab51832..0000000000000 --- a/Documentation/devicetree/bindings/sound/ti,pcm3168a.txt +++ /dev/null @@ -1,56 +0,0 @@ -Texas Instruments pcm3168a DT bindings - -This driver supports both SPI and I2C bus access for this codec - -Required properties: - - - compatible: "ti,pcm3168a" - - - clocks : Contains an entry for each entry in clock-names - - - clock-names : Includes the following entries: - "scki" The system clock - - - VDD1-supply : Digital power supply regulator 1 (+3.3V) - - - VDD2-supply : Digital power supply regulator 2 (+3.3V) - - - VCCAD1-supply : ADC power supply regulator 1 (+5V) - - - VCCAD2-supply : ADC power supply regulator 2 (+5V) - - - VCCDA1-supply : DAC power supply regulator 1 (+5V) - - - VCCDA2-supply : DAC power supply regulator 2 (+5V) - -For required properties on SPI/I2C, consult SPI/I2C device tree documentation - -Optional properties: - - - reset-gpios : Optional reset gpio line connected to RST pin of the codec. - The RST line is low active: - RST = low: device power-down - RST = high: device is enabled - -Examples: - -i2c0: i2c0@0 { - - ... - - pcm3168a: audio-codec@44 { - compatible = "ti,pcm3168a"; - reg = <0x44>; - reset-gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; - clocks = <&clk_core CLK_AUDIO>; - clock-names = "scki"; - VDD1-supply = <&supply3v3>; - VDD2-supply = <&supply3v3>; - VCCAD1-supply = <&supply5v0>; - VCCAD2-supply = <&supply5v0>; - VCCDA1-supply = <&supply5v0>; - VCCDA2-supply = <&supply5v0>; - pinctrl-names = "default"; - pinctrl-0 = <&dac_clk_pin>; - }; -}; diff --git a/Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml b/Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml new file mode 100644 index 0000000000000..b6a4360ab845d --- /dev/null +++ b/Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml @@ -0,0 +1,107 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/ti,pcm3168a.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Texas Instruments PCM3168A Audio Codec + +maintainers: + - Damien Horsley Damien.Horsley@imgtec.com + - Geert Uytterhoeven geert+renesas@glider.be + - Kuninori Morimoto kuninori.morimoto.gx@renesas.com + +description: + The Texas Instruments PCM3168A is a 24-bit Multi-channel Audio CODEC with + 96/192kHz sampling rate, supporting both SPI and I2C bus access. + +properties: + compatible: + const: ti,pcm3168a + + reg: + maxItems: 1 + + clocks: + items: + - description: System clock input + + clock-names: + items: + - const: scki + + reset-gpios: + items: + - description: | + GPIO line connected to the active-low RST pin of the codec. + RST = low: device power-down + RST = high: device is enabled + + "#sound-dai-cells": + enum: [0, 1] + + VDD1-supply: + description: Digital power supply regulator 1 (+3.3V) + + VDD2-supply: + description: Digital power supply regulator 2 (+3.3V) + + VCCAD1-supply: + description: ADC power supply regulator 1 (+5V) + + VCCAD2-supply: + description: ADC power supply regulator 2 (+5V) + + VCCDA1-supply: + description: DAC power supply regulator 1 (+5V) + + VCCDA2-supply: + description: DAC power supply regulator 2 (+5V) + + ports: + $ref: audio-graph-port.yaml#/definitions/port-base + properties: + port@0: + $ref: audio-graph-port.yaml# + description: Audio input port. + + port@1: + $ref: audio-graph-port.yaml# + description: Audio output port. + +required: + - compatible + - reg + - clocks + - clock-names + - VDD1-supply + - VDD2-supply + - VCCAD1-supply + - VCCAD2-supply + - VCCDA1-supply + - VCCDA2-supply + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + pcm3168a: audio-codec@44 { + compatible = "ti,pcm3168a"; + reg = <0x44>; + reset-gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; + clocks = <&clk_core 42>; + clock-names = "scki"; + VDD1-supply = <&supply3v3>; + VDD2-supply = <&supply3v3>; + VCCAD1-supply = <&supply5v0>; + VCCAD2-supply = <&supply5v0>; + VCCDA1-supply = <&supply5v0>; + VCCDA2-supply = <&supply5v0>; + }; + };
On Wed, 11 Jan 2023 01:11:35 +0000, Kuninori Morimoto wrote:
From: Geert Uytterhoeven geert+renesas@glider.be
Convert the Texas Instruments PCM3168A Audio Codec Device Tree binding documentation to json-schema.
Add missing properties. Drop unneeded pinctrl properties from example.
Link: https://lore.kernel.org/r/cover.1669980383.git.geert+renesas@glider.be Link: https://lore.kernel.org/r/87mt7qpylw.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven geert+renesas@glider.be Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
.../devicetree/bindings/sound/ti,pcm3168a.txt | 56 --------- .../bindings/sound/ti,pcm3168a.yaml | 107 ++++++++++++++++++ 2 files changed, 107 insertions(+), 56 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/ti,pcm3168a.txt create mode 100644 Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml
Reviewed-by: Rob Herring robh@kernel.org
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
ak4613 is possible to use Of-graph (Audio-Graph-Card) style, but we need to indicate it. Otherwise we will get below warning. This patch add it.
${LINUX}/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dtb: codec@10: 'port' does not match any of the regexes: '^asahi-kasei,in[1-2]-single-end$', '^asahi-kasei,out[1-6]-single-end$', 'pinctrl-[0-9]+' From schema: ${LINUX}/Documentation/devicetree/bindings/sound/ak4613.yaml
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- Documentation/devicetree/bindings/sound/ak4613.yaml | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/ak4613.yaml b/Documentation/devicetree/bindings/sound/ak4613.yaml index 010574645e6ae..75e13414d6eb1 100644 --- a/Documentation/devicetree/bindings/sound/ak4613.yaml +++ b/Documentation/devicetree/bindings/sound/ak4613.yaml @@ -25,6 +25,13 @@ properties: "#sound-dai-cells": const: 0
+ ports: + $ref: audio-graph-port.yaml#/definitions/ports + + port: + $ref: audio-graph-port.yaml# + unevaluatedProperties: false + patternProperties: "^asahi-kasei,in[1-2]-single-end$": description: Input Pin 1 - 2.
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
renesas,rsnd.yaml is possible to use ports/port/endpoint if it is using Audio Graph Card/Card2 for sound. The schema is defined under audio-graph-port.yaml.
rsnd driver needs "playback/capture" property under endpoint, but it is not defined in audio-graph-port.yaml. This patch adds missing "playback/capture" properties under endpoint.
Without this patch, we will get below warning
${LINUX}/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dtb: sound@ec500000: ports:port@0:endpoint: Unevaluated properties are not allowed ('playback', 'capture' were unexpected) From schema: ${LINUX}/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- .../bindings/sound/renesas,rsnd.yaml | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml index cb90463c72973..6ea8dd74932c2 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml @@ -113,15 +113,34 @@ properties: - pattern: '^clk_(a|b|c|i)$'
ports: - $ref: /schemas/graph.yaml#/properties/ports + $ref: audio-graph-port.yaml#/definitions/port-base + unevaluatedProperties: false patternProperties: '^port(@[0-9a-f]+)?$': - $ref: audio-graph-port.yaml# + $ref: audio-graph-port.yaml#/definitions/port-base unevaluatedProperties: false + patternProperties: + "^endpoint(@[0-9a-f]+)?": + $ref: audio-graph-port.yaml#/definitions/endpoint-base + properties: + playback: + $ref: /schemas/types.yaml#/definitions/phandle-array + capture: + $ref: /schemas/types.yaml#/definitions/phandle-array + unevaluatedProperties: false
port: - $ref: audio-graph-port.yaml# + $ref: audio-graph-port.yaml#/definitions/port-base unevaluatedProperties: false + patternProperties: + "^endpoint(@[0-9a-f]+)?": + $ref: audio-graph-port.yaml#/definitions/endpoint-base + properties: + playback: + $ref: /schemas/types.yaml#/definitions/phandle-array + capture: + $ref: /schemas/types.yaml#/definitions/phandle-array + unevaluatedProperties: false
rcar_sound,dvc: description: DVC subnode.
On Wed, 11 Jan 2023 01:12:18 +0000, Kuninori Morimoto wrote:
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
renesas,rsnd.yaml is possible to use ports/port/endpoint if it is using Audio Graph Card/Card2 for sound. The schema is defined under audio-graph-port.yaml.
rsnd driver needs "playback/capture" property under endpoint, but it is not defined in audio-graph-port.yaml. This patch adds missing "playback/capture" properties under endpoint.
Without this patch, we will get below warning
${LINUX}/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dtb: sound@ec500000: ports:port@0:endpoint: Unevaluated properties are not allowed ('playback', 'capture' were unexpected) From schema: ${LINUX}/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
.../bindings/sound/renesas,rsnd.yaml | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-)
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/renesas,rsnd.example.dtb: sound@ec500000: Unevaluated properties are not allowed ('rcar_sound,src' was unexpected) From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/87r0w1ho26.wl...
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Hi Rob Cc Mark
Thank you for your report
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/renesas,rsnd.example.dtb: sound@ec500000: Unevaluated properties are not allowed ('rcar_sound,src' was unexpected) From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
This error is not generated by this patch, but already exist and not yet solved. We need +1 patch to solve it. I will post the patch and connect to this patch-set.
Thank you for your help !!
Best regards --- Kuninori Morimoto
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Current renesas,rsnd is requesting #sound-dai-cells, but it is needed in case of it is using "simple-card", but not needed in case of "audio-graph". We will get below warning without this patch. This patch fiup it.
${LINUX}/arch/arm64/boot/dts/renesas/r8a77950-salvator-x.dtb: sound@ec500000: '#sound-dai-cells' is a required property From schema: ${LINUX}/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- Documentation/devicetree/bindings/sound/renesas,rsnd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml index 6ea8dd74932c2..bd3a98efab5a5 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml @@ -68,6 +68,7 @@ properties: description: | it must be 0 if your system is using single DAI it must be 1 if your system is using multi DAIs + This is used on simple-audio-card enum: [0, 1]
"#clock-cells": @@ -290,7 +291,6 @@ required: - reg-names - clocks - clock-names - - "#sound-dai-cells"
allOf: - $ref: dai-common.yaml#
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
In case of using MIXer with Simple Audio Card, it needs below DT.
simple-audio-card,dai-link@1 { cpu@0 { ... }; cpu@1 { ... }; ... };
This case, it requires "reg = <xxx>" which needs #address-cells/#size-cells, but simple-audio-card.yaml is missing these. This patch adds it.
Without this patch, we will get below warning.
${LINUX}/arch/arm64/boot/dts/renesas/r8a77950-ulcb.dtb: sound: simple-audio-card,dai-link@0: '#address-cells', '#size-cells' do not match any of the regexes: '^codec(@[0-9a-f]+)?', '^cpu(@[0-9a-f]+)?', 'pinctrl-[0-9]+' From schema: ${LINUX}/Documentation/devicetree/bindings/sound/simple-card.yaml
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- Documentation/devicetree/bindings/sound/simple-card.yaml | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/simple-card.yaml b/Documentation/devicetree/bindings/sound/simple-card.yaml index 08743741b09eb..a69af0bfd371f 100644 --- a/Documentation/devicetree/bindings/sound/simple-card.yaml +++ b/Documentation/devicetree/bindings/sound/simple-card.yaml @@ -215,6 +215,10 @@ patternProperties: reg: maxItems: 1
+ "#address-cells": + const: 1 + "#size-cells": + const: 0 # common properties frame-master: $ref: "#/definitions/frame-master"
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Some SRC is not implemented on some SoC, thus interrupts/dmas/dma-names are not mandatory. This patch solve it. Without this patch we will get below error when 'make DT_CHECKER_FLAGS=-m dt_binding_check'.
dtschema/dtc warnings/errors: ${LINUX}/Documentation/devicetree/bindings/sound/renesas,rsnd.example.dtb: \ sound@ec500000: Unevaluated properties are not allowed ('rcar_sound,src' was unexpected) From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
Link: https://lore.kernel.org/r/167344317928.394453.14105689826645262807.robh@kern... Reported-by: Rob Herring robh@kernel.org Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- Documentation/devicetree/bindings/sound/renesas,rsnd.yaml | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml index bd3a98efab5a5..e01ec01792908 100644 --- a/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +++ b/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml @@ -198,10 +198,6 @@ properties: enum: - tx - rx - required: - - interrupts - - dmas - - dma-names additionalProperties: false
rcar_sound,ssiu:
On Thu, 12 Jan 2023 01:01:45 +0000, Kuninori Morimoto wrote:
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Some SRC is not implemented on some SoC, thus interrupts/dmas/dma-names are not mandatory. This patch solve it. Without this patch we will get below error when 'make DT_CHECKER_FLAGS=-m dt_binding_check'.
dtschema/dtc warnings/errors: ${LINUX}/Documentation/devicetree/bindings/sound/renesas,rsnd.example.dtb: \ sound@ec500000: Unevaluated properties are not allowed ('rcar_sound,src' was unexpected) From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
Link: https://lore.kernel.org/r/167344317928.394453.14105689826645262807.robh@kern... Reported-by: Rob Herring robh@kernel.org Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml | 4 ---- 1 file changed, 4 deletions(-)
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/renesas,rsnd.example.dtb: sound@ec500000: Unevaluated properties are not allowed ('port' was unexpected) From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/878ri84lc6.wl...
The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:
pip3 install dtschema --upgrade
Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
Hi Mark, Rob
Some SRC is not implemented on some SoC, thus interrupts/dmas/dma-names are not mandatory. This patch solve it. Without this patch we will get below error when 'make DT_CHECKER_FLAGS=-m dt_binding_check'.
dtschema/dtc warnings/errors: ${LINUX}/Documentation/devicetree/bindings/sound/renesas,rsnd.example.dtb: \ sound@ec500000: Unevaluated properties are not allowed ('rcar_sound,src' was unexpected) From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
Link: https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kerne... Reported-by: Rob Herring robh@kernel.org Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
Documentation/devicetree/bindings/sound/renesas,rsnd.yaml | 4 ---- 1 file changed, 4 deletions(-)
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/renesas,rsnd.example.dtb: sound@ec500000: Unevaluated properties are not allowed ('port' was unexpected) From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/sound/renesas,rsnd.yaml
Current upstream has 2 errors on renesas,rsnd.yaml, and my posted patches solve these one-by-one. All errors should be gone if you added all patches.
Thank you for your help !!
Best regards --- Kuninori Morimoto
participants (2)
-
Kuninori Morimoto
-
Rob Herring