Skip to contentSkip to conversation

ASoC: dt-bindings: meson: covert axg audio to schema

PATCH Superseded Jerome Brunet 3 participants 29 messages Feb 2, 2023 – Feb 3, 2023

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Jerome Brunet

author maintainer
#0 lore raw

cover ASoC: dt-bindings: meson: covert axg audio to schema

Convert AXG audio dt-binding documentation to schema

Jerome Brunet (9):
ASoC: dt-bindings: create component common schema
ASoC: dt-bindings: meson: fix gx-card codec node regex
ASoC: dt-bindings: meson: convert axg tdm interface to schema
ASoC: dt-bindings: meson: convert axg tdm formatters to schema
ASoC: dt-bindings: meson: convert axg pdm to schema
ASoC: dt-bindings: meson: convert axg fifo to schema
ASoC: dt-bindings: meson: convert axg spdif input to schema
ASoC: dt-bindings: meson: convert axg spdif output to schema
ASoC: dt-bindings: meson: convert axg sound card control to schema

 .../bindings/sound/amlogic,axg-fifo.txt       |  34 ----
 .../bindings/sound/amlogic,axg-fifo.yaml      | 116 +++++++++++
 .../bindings/sound/amlogic,axg-pdm.txt        |  29 ---
 .../bindings/sound/amlogic,axg-pdm.yaml       |  86 +++++++++
 .../bindings/sound/amlogic,axg-sound-card.txt | 124 ------------
 .../sound/amlogic,axg-sound-card.yaml         | 182 ++++++++++++++++++
 .../bindings/sound/amlogic,axg-spdifin.txt    |  27 ---
 .../bindings/sound/amlogic,axg-spdifin.yaml   |  90 +++++++++
 .../bindings/sound/amlogic,axg-spdifout.txt   |  25 ---
 .../bindings/sound/amlogic,axg-spdifout.yaml  |  83 ++++++++
 .../sound/amlogic,axg-tdm-formatters.txt      |  36 ----
 .../sound/amlogic,axg-tdm-formatters.yaml     |  90 +++++++++
 .../bindings/sound/amlogic,axg-tdm-iface.txt  |  22 ---
 .../bindings/sound/amlogic,axg-tdm-iface.yaml |  59 ++++++
 .../bindings/sound/amlogic,gx-sound-card.yaml |   2 +-
 .../bindings/sound/component-common.yaml      |  21 ++
 .../devicetree/bindings/sound/dai-common.yaml |  11 +-
 17 files changed, 731 insertions(+), 306 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/component-common.yaml
Signature · 7 lines
2.39.0


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
author maintainer
#1 lore raw

PATCH 1/9 ASoC: dt-bindings: create component common schema

All DAIs are component but not all components are DAI.
Move the component properties (sound-name-prefix ATM) to a separate schema file so it can be used by non-DAI components, such as auxiliary devices.

---
 .../bindings/sound/component-common.yaml      | 21 +++++++++++++++++++
 .../devicetree/bindings/sound/dai-common.yaml | 11 +++-------
 2 files changed, 24 insertions(+), 8 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/component-common.yaml
Documentation/devicetree/bindings/sound/component-common.yaml new file +21 -0
new file mode 100644
index 000000000000..37766c5f3974
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/component-common.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Audio Component Common Properties
+
+maintainers:
+  - Jerome Brunet <[email protected]>
+
+properties:
+  sound-name-prefix:
+    $ref: /schemas/types.yaml#/definitions/string
+    description: |
+      Card implementing the routing property define the connection between
+      audio components as list of string pair. Component using the same
+      sink/source names may use this property to prepend the name of their
+      sinks/sources with the provided string.
+
+additionalProperties: true
Documentation/devicetree/bindings/sound/dai-common.yaml +3 -8
index d858eea73ed7..1aed2f0f1775 100644
@@ -9,15 +9,10 @@ title: Digital Audio Interface Common Properties
 maintainers:
   - Jerome Brunet <[email protected]>
 
-properties:
-  sound-name-prefix:
-    $ref: /schemas/types.yaml#/definitions/string
-    description: |
-      Card implementing the routing property define the connection between
-      audio components as list of string pair. Component using the same
-      sink/source names may use this property to prepend the name of their
-      sinks/sources with the provided string.
+allOf:
+  - $ref: component-common.yaml#
 
+properties:
   '#sound-dai-cells': true
 
 additionalProperties: true
Signature · 7 lines
2.39.0


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Reviewed-by on v1 1/9
#2 lore raw

Re: [PATCH 1/9] ASoC: dt-bindings: create component common schema

Quoted 11 lines · Jerome Brunet

All DAIs are component but not all components are DAI.
Move the component properties (sound-name-prefix ATM) to a separate schema file so it can be used by non-DAI components, such as auxiliary devices.

Documentation/devicetree/bindings/sound/dai-common.yaml +0 -3
-properties:
-  sound-name-prefix:
-    $ref: /schemas/types.yaml#/definitions/string

Documentation/devicetree/bindings/sound/dai-common.yaml title: Digital Audio Interface Common Properties · line 16

Quoted 10 lines
Documentation/devicetree/bindings/sound/dai-common.yaml +3 -5
-    description: |
-      Card implementing the routing property define the connection between
-      audio components as list of string pair. Component using the same
-      sink/source names may use this property to prepend the name of their
-      sinks/sources with the provided string.
+allOf:
+  - $ref: component-common.yaml#
 
+properties:
   '#sound-dai-cells': true

Probably we should require sound-dai-cells at some point, but anyway:

Best regards,
Krzysztof

author maintainer
#3 lore raw

PATCH 2/9 ASoC: dt-bindings: meson: fix gx-card codec node regex

In reply to Jerome Brunet

'codec' is a valid node name when there is a single codec in the link. Fix the node regular expression to apply this.

Fixes fd00366b8e41 ("ASoC: meson: gx: add sound card dt-binding documentation")
---
 .../devicetree/bindings/sound/amlogic,gx-sound-card.yaml        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/sound/amlogic,gx-sound-card.yaml +1 -1
index 5b8d59245f82..b358fd601ed3 100644
@@ -62,7 +62,7 @@ patternProperties:
         description: phandle of the CPU DAI
 
     patternProperties:
-      "^codec-[0-9]+$":
+      "^codec(-[0-9]+)?$":
         type: object
         additionalProperties: false
         description: |-
Signature · 7 lines
2.39.0


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
Reviewed-by on v1 2/9
#4 lore raw

Re: [PATCH 2/9] ASoC: dt-bindings: meson: fix gx-card codec node regex

Quoted 6 lines · Jerome Brunet

'codec' is a valid node name when there is a single codec in the link. Fix the node regular expression to apply this.

Fixes fd00366b8e41 ("ASoC: meson: gx: add sound card dt-binding documentation")

---

Best regards,
Krzysztof

author maintainer
#5 lore raw

PATCH 3/9 ASoC: dt-bindings: meson: convert axg tdm interface to schema

In reply to Jerome Brunet

Convert the DT binding documentation for the Amlogic tdm interface to schema.

---
 .../bindings/sound/amlogic,axg-tdm-iface.txt  | 22 -------
 .../bindings/sound/amlogic,axg-tdm-iface.yaml | 59 +++++++++++++++++++
 2 files changed, 59 insertions(+), 22 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.txt deleted +0 -22
deleted file mode 100644
index cabfb26a5f22..000000000000
@@ -1,22 +0,0 @@
-* Amlogic Audio TDM Interfaces
-
-Required properties:
-- compatible: 'amlogic,axg-tdm-iface'
-- clocks: list of clock phandle, one for each entry clock-names.
-- clock-names: should contain the following:
-  * "sclk" : bit clock.
-  * "lrclk": sample clock
-  * "mclk" : master clock
-	     -> optional if the interface is in clock slave mode.
-- #sound-dai-cells: must be 0.
-
-Example of TDM_A on the A113 SoC:
-
-tdmif_a: audio-controller@0 {
-	compatible = "amlogic,axg-tdm-iface";
-	#sound-dai-cells = <0>;
-	clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK>,
-		 <&clkc_audio AUD_CLKID_MST_A_SCLK>,
-		 <&clkc_audio AUD_CLKID_MST_A_LRCLK>;
-	clock-names = "mclk", "sclk", "lrclk";
-};
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml new file +59 -0

59 lines not on this page · raw message

Signature · 7 lines
2.39.0


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
#6 lore raw

Re: [PATCH 3/9] ASoC: dt-bindings: meson: convert axg tdm interface to schema

Quoted 7 lines · Jerome Brunet

Convert the DT binding documentation for the Amlogic tdm interface to schema.

Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml new file +1 -0
+title: Amlogic Audio TDM Interfaces

Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml line 17

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml new file +10 -0
+
+maintainers:
+  - Jerome Brunet <[email protected]>
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  $nodename:
+    pattern: "^audio-controller-.*"

Such pattern is also not correct (see your patch #2), but so far we do not require node naming from individual schemas, so I propose just to drop it.

Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml line 20

Quoted 3 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml new file +3 -0
+
+  compatible:
+    items:

Drop items

Quoted 1 line

+ - const: 'amlogic,axg-tdm-iface'

Drop quotes

Quoted 21 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml new file +21 -0
+
+  "#sound-dai-cells":
+    const: 0
+
+  clocks:
+    minItems: 2
+    items:
+      - description: Bit clock
+      - description: Sample clock
+      - description: Master clock #optional
+
+  clock-names:
+    minItems: 2
+    items:
+      - const: sclk
+      - const: lrclk
+      - const: mclk
+
+required:
+  - compatible
+  - "#sound-dai-cells"

Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml line 52

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml new file +10 -0
+  - clocks
+  - clock-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/axg-audio-clkc.h>
+
+    tdmif_a: audio-controller-0 {

audio-controller (and drop the label)

Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml line 59

Quoted 7 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-iface.yaml new file +7 -0
+        compatible = "amlogic,axg-tdm-iface";
+        #sound-dai-cells = <0>;
+        clocks = <&clkc_audio AUD_CLKID_MST_A_SCLK>,
+                 <&clkc_audio AUD_CLKID_MST_A_LRCLK>,
+                 <&clkc_audio AUD_CLKID_MST_A_MCLK>;
+        clock-names = "sclk", "lrclk", "mclk";
+    };

Best regards,
Krzysztof

author maintainer
#7 lore raw

PATCH 4/9 ASoC: dt-bindings: meson: convert axg tdm formatters to schema

In reply to Jerome Brunet

Convert the DT binding documentation for the Amlogic tdm formatters to schema.

---
 .../sound/amlogic,axg-tdm-formatters.txt      | 36 --------
 .../sound/amlogic,axg-tdm-formatters.yaml     | 90 +++++++++++++++++++
 2 files changed, 90 insertions(+), 36 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.txt deleted +0 -36
deleted file mode 100644
index 5996c0cd89c2..000000000000
@@ -1,36 +0,0 @@
-* Amlogic Audio TDM formatters
-
-Required properties:
-- compatible: 'amlogic,axg-tdmin' or
-	      'amlogic,axg-tdmout' or
-	      'amlogic,g12a-tdmin' or
-	      'amlogic,g12a-tdmout' or
-	      'amlogic,sm1-tdmin' or
-	      'amlogic,sm1-tdmout
-- reg: physical base address of the controller and length of memory
-       mapped region.
-- clocks: list of clock phandle, one for each entry clock-names.
-- clock-names: should contain the following:
-  * "pclk"     : peripheral clock.
-  * "sclk"     : bit clock.
-  * "sclk_sel" : bit clock input multiplexer.
-  * "lrclk"    : sample clock
-  * "lrclk_sel": sample clock input multiplexer
-
-Optional property:
-- resets: phandle to the dedicated reset line of the tdm formatter.
-
-Example of TDMOUT_A on the S905X2 SoC:
-
-tdmout_a: audio-controller@500 {
-	compatible = "amlogic,axg-tdmout";
-	reg = <0x0 0x500 0x0 0x40>;
-	resets = <&clkc_audio AUD_RESET_TDMOUT_A>;
-	clocks = <&clkc_audio AUD_CLKID_TDMOUT_A>,
-		 <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK>,
-		 <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK_SEL>,
-		 <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>,
-		 <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>;
-	clock-names = "pclk", "sclk", "sclk_sel",
-		      "lrclk", "lrclk_sel";
-};
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml new file +90 -0

90 lines not on this page · raw message

Signature · 7 lines
2.39.0


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
#8 lore raw

Re: [PATCH 4/9] ASoC: dt-bindings: meson: convert axg tdm formatters to schema

Quoted 66 lines · Jerome Brunet

Convert the DT binding documentation for the Amlogic tdm formatters to schema.

---
 .../sound/amlogic,axg-tdm-formatters.txt      | 36 --------
 .../sound/amlogic,axg-tdm-formatters.yaml     | 90 +++++++++++++++++++
 2 files changed, 90 insertions(+), 36 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.txt deleted +0 -36
deleted file mode 100644
index 5996c0cd89c2..000000000000
@@ -1,36 +0,0 @@
-* Amlogic Audio TDM formatters
-
-Required properties:
-- compatible: 'amlogic,axg-tdmin' or
-	      'amlogic,axg-tdmout' or
-	      'amlogic,g12a-tdmin' or
-	      'amlogic,g12a-tdmout' or
-	      'amlogic,sm1-tdmin' or
-	      'amlogic,sm1-tdmout
-- reg: physical base address of the controller and length of memory
-       mapped region.
-- clocks: list of clock phandle, one for each entry clock-names.
-- clock-names: should contain the following:
-  * "pclk"     : peripheral clock.
-  * "sclk"     : bit clock.
-  * "sclk_sel" : bit clock input multiplexer.
-  * "lrclk"    : sample clock
-  * "lrclk_sel": sample clock input multiplexer
-
-Optional property:
-- resets: phandle to the dedicated reset line of the tdm formatter.
-
-Example of TDMOUT_A on the S905X2 SoC:
-
-tdmout_a: audio-controller@500 {
-	compatible = "amlogic,axg-tdmout";
-	reg = <0x0 0x500 0x0 0x40>;
-	resets = <&clkc_audio AUD_RESET_TDMOUT_A>;
-	clocks = <&clkc_audio AUD_CLKID_TDMOUT_A>,
-		 <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK>,
-		 <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK_SEL>,
-		 <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>,
-		 <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>;
-	clock-names = "pclk", "sclk", "sclk_sel",
-		      "lrclk", "lrclk_sel";
-};
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml new file +7 -0
new file mode 100644
index 000000000000..f618724411de
@@ -0,0 +1,90 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/amlogic,axg-tdm-formatters.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic Audio AXG TDM formatters

Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml line 17

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml new file +10 -0
+
+maintainers:
+  - Jerome Brunet <[email protected]>
+
+allOf:
+  - $ref: component-common.yaml#
+
+properties:
+  $nodename:
+    pattern: "^audio-controller@.*"

Drop.

Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml line 20

Quoted 3 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml new file +3 -0
+
+  compatible:
+    oneOf:

Drop oneOf.

Quoted 16 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml new file +16 -0
+      - enum:
+          - amlogic,g12a-tdmout
+          - amlogic,sm1-tdmout
+          - amlogic,axg-tdmout
+          - amlogic,g12a-tdmin
+          - amlogic,sm1-tdmin
+          - amlogic,axg-tdmin
+
+  clocks:
+    items:
+      - description: Peripheral clock
+      - description: Bit clock
+      - description: Bit clock input multiplexer
+      - description: Sample clock
+      - description: Sample clock input multiplexer
+

Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml line 46

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml new file +10 -0
+  clock-names:
+    items:
+      - const: pclk
+      - const: sclk
+      - const: sclk_sel
+      - const: lrclk
+      - const: lrclk_sel
+
+  reg:
+    maxItems: 1

Missing property resets

Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml line 54

Quoted 8 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml new file +8 -0
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+
+if:

Put it under allOf.

Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml line 65

Quoted 11 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml new file +11 -0
+  properties:
+    compatible:
+      contains:
+        enum:
+          - amlogic,g12a-tdmin
+          - amlogic,sm1-tdmin
+          - amlogic,g12a-tdmout
+          - amlogic,sm1-tdmout
+then:
+  properties:
+    resets:

Properties are defined in top-level. You can disallow it for other variants.

Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml line 70

Quoted 5 lines
Documentation/devicetree/bindings/sound/amlogic,axg-tdm-formatters.yaml new file +5 -0
+      items:
+        - description: Dedicated device reset line
+
+  required:
+    - resets

Best regards,
Krzysztof

author maintainer
#9 lore raw

PATCH 5/9 ASoC: dt-bindings: meson: convert axg pdm to schema

In reply to Jerome Brunet

Convert the DT binding documentation for the Amlogic axg PDM device to schema.

---
 .../bindings/sound/amlogic,axg-pdm.txt        | 29 -------
 .../bindings/sound/amlogic,axg-pdm.yaml       | 86 +++++++++++++++++++
 2 files changed, 86 insertions(+), 29 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt deleted +0 -29
deleted file mode 100644
index 716878107a24..000000000000
@@ -1,29 +0,0 @@
-* Amlogic Audio PDM input
-
-Required properties:
-- compatible: 'amlogic,axg-pdm' or
-	      'amlogic,g12a-pdm' or
-	      'amlogic,sm1-pdm'
-- reg: physical base address of the controller and length of memory
-       mapped region.
-- clocks: list of clock phandle, one for each entry clock-names.
-- clock-names: should contain the following:
-  * "pclk"   : peripheral clock.
-  * "dclk"   : pdm digital clock
-  * "sysclk" : dsp system clock
-- #sound-dai-cells: must be 0.
-
-Optional property:
-- resets: phandle to the dedicated reset line of the pdm input.
-
-Example of PDM on the A113 SoC:
-
-pdm: audio-controller@ff632000 {
-	compatible = "amlogic,axg-pdm";
-	reg = <0x0 0xff632000 0x0 0x34>;
-	#sound-dai-cells = <0>;
-	clocks = <&clkc_audio AUD_CLKID_PDM>,
-		 <&clkc_audio AUD_CLKID_PDM_DCLK>,
-		 <&clkc_audio AUD_CLKID_PDM_SYSCLK>;
-	clock-names = "pclk", "dclk", "sysclk";
-};
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml new file +86 -0

86 lines not on this page · raw message

Signature · 7 lines
2.39.0


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
#10 lore raw

Re: [PATCH 5/9] ASoC: dt-bindings: meson: convert axg pdm to schema

Quoted 59 lines · Jerome Brunet

Convert the DT binding documentation for the Amlogic axg PDM device to schema.

---
 .../bindings/sound/amlogic,axg-pdm.txt        | 29 -------
 .../bindings/sound/amlogic,axg-pdm.yaml       | 86 +++++++++++++++++++
 2 files changed, 86 insertions(+), 29 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt deleted +0 -29
deleted file mode 100644
index 716878107a24..000000000000
@@ -1,29 +0,0 @@
-* Amlogic Audio PDM input
-
-Required properties:
-- compatible: 'amlogic,axg-pdm' or
-	      'amlogic,g12a-pdm' or
-	      'amlogic,sm1-pdm'
-- reg: physical base address of the controller and length of memory
-       mapped region.
-- clocks: list of clock phandle, one for each entry clock-names.
-- clock-names: should contain the following:
-  * "pclk"   : peripheral clock.
-  * "dclk"   : pdm digital clock
-  * "sysclk" : dsp system clock
-- #sound-dai-cells: must be 0.
-
-Optional property:
-- resets: phandle to the dedicated reset line of the pdm input.
-
-Example of PDM on the A113 SoC:
-
-pdm: audio-controller@ff632000 {
-	compatible = "amlogic,axg-pdm";
-	reg = <0x0 0xff632000 0x0 0x34>;
-	#sound-dai-cells = <0>;
-	clocks = <&clkc_audio AUD_CLKID_PDM>,
-		 <&clkc_audio AUD_CLKID_PDM_DCLK>,
-		 <&clkc_audio AUD_CLKID_PDM_SYSCLK>;
-	clock-names = "pclk", "dclk", "sysclk";
-};
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml new file +7 -0
new file mode 100644
index 000000000000..d3da2f8ba7b1
@@ -0,0 +1,86 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/amlogic,axg-pdm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic Audio AXG PDM input

Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml line 17

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml new file +10 -0
+
+maintainers:
+  - Jerome Brunet <[email protected]>
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  $nodename:
+    pattern: "^audio-controller@.*"

Drop

Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml line 26

Quoted 9 lines
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml new file +9 -0
+
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - amlogic,g12a-pdm
+              - amlogic,sm1-pdm
+          - const:
+              amlogic,axg-pdm

One line.

Please use the same coding style as we have in other bindings or example-schema.

Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml line 27

Quoted 1 line
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml new file +1 -0
+      - items:

Drop items

Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml line 29

Quoted 2 lines
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml new file +2 -0
+          - const:
+              amlogic,axg-pdm

Keep in one line.

Quoted 17 lines
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml new file +17 -0
+
+  reg:
+    maxItems: 1
+
+  "#sound-dai-cells":
+    const: 0
+
+  clocks:
+    items:
+      - description: Peripheral clock
+      - description: PDM digital clock
+      - description: DSP system clock
+
+  clock-names:
+    items:
+      - const: pclk
+      - const: dclk

Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml line 56

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml new file +10 -0
+      - const: sysclk
+
+required:
+  - compatible
+  - reg
+  - "#sound-dai-cells"
+  - clocks
+  - clock-names
+
+if:

Keep in allOf here (need to move ref from top to here)

Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml line 67

Quoted 11 lines
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml new file +11 -0
+  properties:
+    compatible:
+      contains:
+        enum:
+          - amlogic,g12a-pdm
+          - amlogic,sm1-pdm
+then:
+  properties:
+    resets:
+      items:
+        - description: Dedicated device reset line

Define properties in top level properties.

Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml line 72

Quoted 5 lines
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml new file +5 -0
+
+  required:
+    - resets
+
+unevaluatedProperties: false

Best regards,
Krzysztof

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

author maintainer
#11 lore raw

Re: [PATCH 5/9] ASoC: dt-bindings: meson: convert axg pdm to schema

Quoted 1 line · Krzysztof Kozlowski

On 02/02/2023 19:36, Jerome Brunet wrote:

[...]

Quoted 11 lines

Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml line 56

Quoted 8 lines
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml new file +8 -0
+required:
+  - compatible
+  - reg
+  - "#sound-dai-cells"
+  - clocks
+  - clock-names
+
+if:

Keep in allOf here (need to move ref from top to here)

I'm not sure I get it. As it is, it seems to have the effect I had in mind while trying with dt_bindings_check.

What does it do when putting the conditional under the AllOf section ?

Quoted 14 lines

Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml line 67

Quoted 11 lines
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml new file +11 -0
+  properties:
+    compatible:
+      contains:
+        enum:
+          - amlogic,g12a-pdm
+          - amlogic,sm1-pdm
+then:
+  properties:
+    resets:
+      items:
+        - description: Dedicated device reset line

Define properties in top level properties.

Quoted 9 lines

Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml line 72

Quoted 5 lines
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml new file +5 -0
+
+  required:
+    - resets
+
+unevaluatedProperties: false

Best regards,
Krzysztof

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

#12 lore raw

Re: [PATCH 5/9] ASoC: dt-bindings: meson: convert axg pdm to schema

Quoted 19 lines · Jerome Brunet
Quoted 1 line · Krzysztof Kozlowski

On 02/02/2023 19:36, Jerome Brunet wrote:

[...]

Quoted 11 lines

Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml line 56

Quoted 8 lines
Documentation/devicetree/bindings/sound/amlogic,axg-pdm.yaml new file +8 -0
+required:
+  - compatible
+  - reg
+  - "#sound-dai-cells"
+  - clocks
+  - clock-names
+
+if:

Keep in allOf here (need to move ref from top to here)

Quoted 4 lines

I'm not sure I get it. As it is, it seems to have the effect I had in mind while trying with dt_bindings_check.

What does it do when putting the conditional under the AllOf section ?

It avoids any future re-indents if you need to add one more if clause.

Best regards,
Krzysztof

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

author maintainer
#13 lore raw

PATCH 6/9 ASoC: dt-bindings: meson: convert axg fifo to schema

In reply to Jerome Brunet

Convert the DT binding documentation for the Amlogic axg audio FIFOs to schema.

---
 .../bindings/sound/amlogic,axg-fifo.txt       |  34 -----
 .../bindings/sound/amlogic,axg-fifo.yaml      | 116 ++++++++++++++++++
 2 files changed, 116 insertions(+), 34 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt deleted +0 -34
deleted file mode 100644
index fa4545ed81ca..000000000000
@@ -1,34 +0,0 @@
-* Amlogic Audio FIFO controllers
-
-Required properties:
-- compatible: 'amlogic,axg-toddr' or
-	      'amlogic,axg-toddr' or
-	      'amlogic,g12a-frddr' or
-	      'amlogic,g12a-toddr' or
-	      'amlogic,sm1-frddr' or
-	      'amlogic,sm1-toddr'
-- reg: physical base address of the controller and length of memory
-       mapped region.
-- interrupts: interrupt specifier for the fifo.
-- clocks: phandle to the fifo peripheral clock provided by the audio
-	  clock controller.
-- resets: list of reset phandle, one for each entry reset-names.
-- reset-names: should contain the following:
-  * "arb" : memory ARB line (required)
-  * "rst" : dedicated device reset line (optional)
-- #sound-dai-cells: must be 0.
-- amlogic,fifo-depth: The size of the controller's fifo in bytes. This
-  		      is useful for determining certain configuration such
-		      as the flush threshold of the fifo
-
-Example of FRDDR A on the A113 SoC:
-
-frddr_a: audio-controller@1c0 {
-	compatible = "amlogic,axg-frddr";
-	reg = <0x0 0x1c0 0x0 0x1c>;
-	#sound-dai-cells = <0>;
-	interrupts = <GIC_SPI 88 IRQ_TYPE_EDGE_RISING>;
-	clocks = <&clkc_audio AUD_CLKID_FRDDR_A>;
-	resets = <&arb AXG_ARB_FRDDR_A>;
-	fifo-depth = <512>;
-};
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +116 -0

116 lines not on this page · raw message

Signature · 7 lines
2.39.0


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
#14 lore raw

Re: [PATCH 6/9] ASoC: dt-bindings: meson: convert axg fifo to schema

Quoted 84 lines · Jerome Brunet

Convert the DT binding documentation for the Amlogic axg audio FIFOs to schema.

---
 .../bindings/sound/amlogic,axg-fifo.txt       |  34 -----
 .../bindings/sound/amlogic,axg-fifo.yaml      | 116 ++++++++++++++++++
 2 files changed, 116 insertions(+), 34 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt deleted +0 -34
deleted file mode 100644
index fa4545ed81ca..000000000000
@@ -1,34 +0,0 @@
-* Amlogic Audio FIFO controllers
-
-Required properties:
-- compatible: 'amlogic,axg-toddr' or
-	      'amlogic,axg-toddr' or
-	      'amlogic,g12a-frddr' or
-	      'amlogic,g12a-toddr' or
-	      'amlogic,sm1-frddr' or
-	      'amlogic,sm1-toddr'
-- reg: physical base address of the controller and length of memory
-       mapped region.
-- interrupts: interrupt specifier for the fifo.
-- clocks: phandle to the fifo peripheral clock provided by the audio
-	  clock controller.
-- resets: list of reset phandle, one for each entry reset-names.
-- reset-names: should contain the following:
-  * "arb" : memory ARB line (required)
-  * "rst" : dedicated device reset line (optional)
-- #sound-dai-cells: must be 0.
-- amlogic,fifo-depth: The size of the controller's fifo in bytes. This
-  		      is useful for determining certain configuration such
-		      as the flush threshold of the fifo
-
-Example of FRDDR A on the A113 SoC:
-
-frddr_a: audio-controller@1c0 {
-	compatible = "amlogic,axg-frddr";
-	reg = <0x0 0x1c0 0x0 0x1c>;
-	#sound-dai-cells = <0>;
-	interrupts = <GIC_SPI 88 IRQ_TYPE_EDGE_RISING>;
-	clocks = <&clkc_audio AUD_CLKID_FRDDR_A>;
-	resets = <&arb AXG_ARB_FRDDR_A>;
-	fifo-depth = <512>;
-};
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +27 -0
new file mode 100644
index 000000000000..f6222ad08880
@@ -0,0 +1,116 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/amlogic,axg-fifo.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic AXG Audio FIFO controllers
+
+maintainers:
+  - Jerome Brunet <[email protected]>
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  $nodename:
+    pattern: "^audio-controller@.*"
+
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - amlogic,axg-toddr
+              - amlogic,axg-frddr
+      - items:
+          - enum:
+              - amlogic,g12a-toddr

Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml line 37

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +10 -0
+              - amlogic,sm1-toddr
+          - const:
+              amlogic,axg-toddr
+      - items:
+          - enum:
+              - amlogic,g12a-frddr
+              - amlogic,sm1-frddr
+          - const:
+              amlogic,axg-frddr
+

All usual comments apply.

Quoted 7 lines
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +7 -0
+  reg:
+    maxItems: 1
+
+  "#sound-dai-cells":
+    const: 0
+
+  clocks:

Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml line 54

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +10 -0
+    items:
+      - description: Peripheral clock
+
+  interrupts:
+    maxItems: 1
+
+  resets:
+    items:
+      - description: Memory ARB line
+      - description: Dedicated device reset line

This won't work without minItems and you should see errors on your DTS or in dt_binding_check

Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml line 56

Quoted 2 lines
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +2 -0
+
+  reset-names: true

minItems
maxItems

Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml line 62

Quoted 6 lines
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +6 -0
+
+  amlogic,fifo-depth:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Size of the controller's fifo in bytes
+
+required:

Best regards,
Krzysztof

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

author maintainer
#15 lore raw

Re: [PATCH 6/9] ASoC: dt-bindings: meson: convert axg fifo to schema

Quoted 110 lines · Krzysztof Kozlowski
Quoted 84 lines · Jerome Brunet

Convert the DT binding documentation for the Amlogic axg audio FIFOs to schema.

---
 .../bindings/sound/amlogic,axg-fifo.txt       |  34 -----
 .../bindings/sound/amlogic,axg-fifo.yaml      | 116 ++++++++++++++++++
 2 files changed, 116 insertions(+), 34 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt deleted +0 -34
deleted file mode 100644
index fa4545ed81ca..000000000000
@@ -1,34 +0,0 @@
-* Amlogic Audio FIFO controllers
-
-Required properties:
-- compatible: 'amlogic,axg-toddr' or
-	      'amlogic,axg-toddr' or
-	      'amlogic,g12a-frddr' or
-	      'amlogic,g12a-toddr' or
-	      'amlogic,sm1-frddr' or
-	      'amlogic,sm1-toddr'
-- reg: physical base address of the controller and length of memory
-       mapped region.
-- interrupts: interrupt specifier for the fifo.
-- clocks: phandle to the fifo peripheral clock provided by the audio
-	  clock controller.
-- resets: list of reset phandle, one for each entry reset-names.
-- reset-names: should contain the following:
-  * "arb" : memory ARB line (required)
-  * "rst" : dedicated device reset line (optional)
-- #sound-dai-cells: must be 0.
-- amlogic,fifo-depth: The size of the controller's fifo in bytes. This
-  		      is useful for determining certain configuration such
-		      as the flush threshold of the fifo
-
-Example of FRDDR A on the A113 SoC:
-
-frddr_a: audio-controller@1c0 {
-	compatible = "amlogic,axg-frddr";
-	reg = <0x0 0x1c0 0x0 0x1c>;
-	#sound-dai-cells = <0>;
-	interrupts = <GIC_SPI 88 IRQ_TYPE_EDGE_RISING>;
-	clocks = <&clkc_audio AUD_CLKID_FRDDR_A>;
-	resets = <&arb AXG_ARB_FRDDR_A>;
-	fifo-depth = <512>;
-};
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +27 -0
new file mode 100644
index 000000000000..f6222ad08880
@@ -0,0 +1,116 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/amlogic,axg-fifo.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic AXG Audio FIFO controllers
+
+maintainers:
+  - Jerome Brunet <[email protected]>
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  $nodename:
+    pattern: "^audio-controller@.*"
+
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - amlogic,axg-toddr
+              - amlogic,axg-frddr
+      - items:
+          - enum:
+              - amlogic,g12a-toddr

Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml line 37

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +10 -0
+              - amlogic,sm1-toddr
+          - const:
+              amlogic,axg-toddr
+      - items:
+          - enum:
+              - amlogic,g12a-frddr
+              - amlogic,sm1-frddr
+          - const:
+              amlogic,axg-frddr
+

All usual comments apply.

Quoted 12 lines
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +12 -0
+  reg:
+    maxItems: 1
+
+  "#sound-dai-cells":
+    const: 0
+
+  clocks:
+    items:
+      - description: Peripheral clock
+
+  interrupts:
+    maxItems: 1
Quoted 9 lines

Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml line 54

Quoted 5 lines
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +5 -0
+
+  resets:
+    items:
+      - description: Memory ARB line
+      - description: Dedicated device reset line

This won't work without minItems and you should see errors on your DTS or in dt_binding_check

The example provided here worked but there is indeed a warning with the axg-frddr variant.

I'm adding a 2nd example so it does not happen again.

Quoted 5 lines

Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml line 56

Quoted 2 lines
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +2 -0
+
+  reset-names: true

minItems
maxItems

Adding this causes troubles with the reset-names definitions in the 'if' clause. If I put min: 1, max: 2 and min: 2 in the 'then' clause I get:

Quoted 7 lines

Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml: allOf:1:then:properties:reset-names: 'oneOf' conditional failed, one must be fixed:
[{'const': 'arb'}, {'const': 'rst'}] is too long
[{'const': 'arb'}, {'const': 'rst'}] is too short
False schema does not allow 2
1 was expected
hint: "minItems" is only needed if less than the "items" list length
from schema $id: http://devicetree.org/meta-schemas/items.yaml#

The older devices just have the 'arb' reset. Newer devices have a 2nd reset line (called rst here)

If I just restrict the min and max, it would be valid for the older devices to have 'rst' only - but it is not valid.

With just 'true', it works as expected (throw errors if an incorrect name or number of names is passed). Min and Max comes from the items list.

Any suggestions ?

Quoted 10 lines

Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml line 62

Quoted 7 lines
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +6 -0
+
+  amlogic,fifo-depth:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Size of the controller's fifo in bytes
+
+required:

Best regards,
Krzysztof

#16 lore raw

Re: [PATCH 6/9] ASoC: dt-bindings: meson: convert axg fifo to schema

Quoted 7 lines · Jerome Brunet
Quoted 7 lines
Quoted 6 lines
Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml new file +4 -0
+  resets:
+    items:
+      - description: Memory ARB line
+      - description: Dedicated device reset line
Quoted 8 lines
Quoted 3 lines

This won't work without minItems and you should see errors on your DTS or in dt_binding_check

The example provided here worked but there is indeed a warning with the axg-frddr variant.

I'm adding a 2nd example so it does not happen again.

If the difference is only in one property, no need. If the difference is in more properties - then could be. We do not keep examples for every trivial change, because the assumption is that submitter tests DTS as well.

Quoted 17 lines
Quoted 6 lines

Review

Quoted 3 lines
(quoted diff) +2 -0
+
+  reset-names: true

minItems
maxItems

Adding this causes troubles with the reset-names definitions in the 'if' clause. If I put min: 1, max: 2 and min: 2 in the 'then' clause I get:

Quoted 7 lines

Documentation/devicetree/bindings/sound/amlogic,axg-fifo.yaml: allOf:1:then:properties:reset-names: 'oneOf' conditional failed, one must be fixed:
[{'const': 'arb'}, {'const': 'rst'}] is too long
[{'const': 'arb'}, {'const': 'rst'}] is too short
False schema does not allow 2
1 was expected
hint: "minItems" is only needed if less than the "items" list length
from schema $id: http://devicetree.org/meta-schemas/items.yaml#

Probably because rest of binding does not match. One way is like this:

https://elixir.bootlin.com/linux/v5.19-rc6/source/Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml#L57

Quoted 6 lines

The older devices just have the 'arb' reset. Newer devices have a 2nd reset line (called rst here)

If I just restrict the min and max, it would be valid for the older devices to have 'rst' only - but it is not valid.

How? Why would you define for old devices "rst" as one name if this is not correct?

Quoted 3 lines

With just 'true', it works as expected (throw errors if an incorrect name or number of names is passed). Min and Max comes from the items list.

Because the rest is not in recommended way. Once you implement it in recommended way, there will be no such...

Quoted 2 lines

Any suggestions ?

Implement rest of comments.

Best regards,
Krzysztof

author maintainer
#17 lore raw

PATCH 7/9 ASoC: dt-bindings: meson: convert axg spdif input to schema

In reply to Jerome Brunet

Convert the DT binding documentation for the Amlogic axg spdif input to schema.

---
 .../bindings/sound/amlogic,axg-spdifin.txt    | 27 ------
 .../bindings/sound/amlogic,axg-spdifin.yaml   | 90 +++++++++++++++++++
 2 files changed, 90 insertions(+), 27 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.txt deleted +0 -27
deleted file mode 100644
index df92a4ecf288..000000000000
@@ -1,27 +0,0 @@
-* Amlogic Audio SPDIF Input
-
-Required properties:
-- compatible: 'amlogic,axg-spdifin' or
-	      'amlogic,g12a-spdifin' or
-	      'amlogic,sm1-spdifin'
-- interrupts: interrupt specifier for the spdif input.
-- clocks: list of clock phandle, one for each entry clock-names.
-- clock-names: should contain the following:
-  * "pclk" : peripheral clock.
-  * "refclk" : spdif input reference clock
-- #sound-dai-cells: must be 0.
-
-Optional property:
-- resets: phandle to the dedicated reset line of the spdif input.
-
-Example on the A113 SoC:
-
-spdifin: audio-controller@400 {
-	compatible = "amlogic,axg-spdifin";
-	reg = <0x0 0x400 0x0 0x30>;
-	#sound-dai-cells = <0>;
-	interrupts = <GIC_SPI 87 IRQ_TYPE_EDGE_RISING>;
-	clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
-		 <&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
-	clock-names = "pclk", "refclk";
-};
Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.yaml new file +90 -0

90 lines not on this page · raw message

Signature · 7 lines
2.39.0


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
#18 lore raw

Re: [PATCH 7/9] ASoC: dt-bindings: meson: convert axg spdif input to schema

Quoted 61 lines · Jerome Brunet

Convert the DT binding documentation for the Amlogic axg spdif input to schema.

---
 .../bindings/sound/amlogic,axg-spdifin.txt    | 27 ------
 .../bindings/sound/amlogic,axg-spdifin.yaml   | 90 +++++++++++++++++++
 2 files changed, 90 insertions(+), 27 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.txt deleted +0 -27
deleted file mode 100644
index df92a4ecf288..000000000000
@@ -1,27 +0,0 @@
-* Amlogic Audio SPDIF Input
-
-Required properties:
-- compatible: 'amlogic,axg-spdifin' or
-	      'amlogic,g12a-spdifin' or
-	      'amlogic,sm1-spdifin'
-- interrupts: interrupt specifier for the spdif input.
-- clocks: list of clock phandle, one for each entry clock-names.
-- clock-names: should contain the following:
-  * "pclk" : peripheral clock.
-  * "refclk" : spdif input reference clock
-- #sound-dai-cells: must be 0.
-
-Optional property:
-- resets: phandle to the dedicated reset line of the spdif input.
-
-Example on the A113 SoC:
-
-spdifin: audio-controller@400 {
-	compatible = "amlogic,axg-spdifin";
-	reg = <0x0 0x400 0x0 0x30>;
-	#sound-dai-cells = <0>;
-	interrupts = <GIC_SPI 87 IRQ_TYPE_EDGE_RISING>;
-	clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
-		 <&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
-	clock-names = "pclk", "refclk";
-};
Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.yaml new file +11 -0
new file mode 100644
index 000000000000..4f7e4c21acc1
@@ -0,0 +1,90 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/amlogic,axg-spdifin.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic Audio AXG SPDIF Input
+
+maintainers:
+  - Jerome Brunet <[email protected]>
+

Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.yaml line 21

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.yaml new file +10 -0
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  $nodename:
+    pattern: "^audio-controller@.*"
+
+  compatible:
+    oneOf:
+      - items:

All usual comments apply.

Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.yaml line 29

Quoted 8 lines
Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.yaml new file +8 -0
+          - const:
+              amlogic,axg-spdifin
+      - items:
+          - enum:
+              - amlogic,g12a-spdifin
+              - amlogic,sm1-spdifin
+          - const:
+              amlogic,axg-spdifin

All usual comments apply.

Quoted 44 lines
Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.yaml new file +44 -0
+
+  reg:
+    maxItems: 1
+
+  "#sound-dai-cells":
+    const: 0
+
+  clocks:
+    items:
+      - description: Peripheral clock
+      - description: SPDIF input reference clock
+
+  clock-names:
+    items:
+      - const: pclk
+      - const: refclk
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - "#sound-dai-cells"
+  - clocks
+  - clock-names
+  - interrupts
+
+if:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - amlogic,g12a-spdifin
+          - amlogic,sm1-spdifin
+then:
+  properties:
+    resets:
+      items:
+        - description: dedicated device reset line
+
+  required:
+    - resets
+

Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.yaml line 83

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.yaml new file +10 -0
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/axg-audio-clkc.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    spdifin: audio-controller@400 {
+    	compatible = "amlogic,axg-spdifin";

Fix indentation.

Best regards,
Krzysztof

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

author maintainer
#19 lore raw

PATCH 8/9 ASoC: dt-bindings: meson: convert axg spdif output to schema

In reply to Jerome Brunet

Convert the DT binding documentation for the Amlogic axg spdif output to schema.

---
 .../bindings/sound/amlogic,axg-spdifout.txt   | 25 ------
 .../bindings/sound/amlogic,axg-spdifout.yaml  | 83 +++++++++++++++++++
 2 files changed, 83 insertions(+), 25 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.txt deleted +0 -25
deleted file mode 100644
index 28381dd1f633..000000000000
@@ -1,25 +0,0 @@
-* Amlogic Audio SPDIF Output
-
-Required properties:
-- compatible: 'amlogic,axg-spdifout' or
-	      'amlogic,g12a-spdifout' or
-	      'amlogic,sm1-spdifout'
-- clocks: list of clock phandle, one for each entry clock-names.
-- clock-names: should contain the following:
-  * "pclk" : peripheral clock.
-  * "mclk" : master clock
-- #sound-dai-cells: must be 0.
-
-Optional property:
-- resets: phandle to the dedicated reset line of the spdif output.
-
-Example on the A113 SoC:
-
-spdifout: audio-controller@480 {
-	compatible = "amlogic,axg-spdifout";
-	reg = <0x0 0x480 0x0 0x50>;
-	#sound-dai-cells = <0>;
-	clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
-		 <&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
-	clock-names = "pclk", "mclk";
-};
Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.yaml new file +83 -0

83 lines not on this page · raw message

Signature · 7 lines
2.39.0


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
#20 lore raw

Re: [PATCH 8/9] ASoC: dt-bindings: meson: convert axg spdif output to schema

Quoted 61 lines · Jerome Brunet

Convert the DT binding documentation for the Amlogic axg spdif output to schema.

---
 .../bindings/sound/amlogic,axg-spdifout.txt   | 25 ------
 .../bindings/sound/amlogic,axg-spdifout.yaml  | 83 +++++++++++++++++++
 2 files changed, 83 insertions(+), 25 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.txt deleted +0 -25
deleted file mode 100644
index 28381dd1f633..000000000000
@@ -1,25 +0,0 @@
-* Amlogic Audio SPDIF Output
-
-Required properties:
-- compatible: 'amlogic,axg-spdifout' or
-	      'amlogic,g12a-spdifout' or
-	      'amlogic,sm1-spdifout'
-- clocks: list of clock phandle, one for each entry clock-names.
-- clock-names: should contain the following:
-  * "pclk" : peripheral clock.
-  * "mclk" : master clock
-- #sound-dai-cells: must be 0.
-
-Optional property:
-- resets: phandle to the dedicated reset line of the spdif output.
-
-Example on the A113 SoC:
-
-spdifout: audio-controller@480 {
-	compatible = "amlogic,axg-spdifout";
-	reg = <0x0 0x480 0x0 0x50>;
-	#sound-dai-cells = <0>;
-	clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
-		 <&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
-	clock-names = "pclk", "mclk";
-};
Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.yaml new file +13 -0
new file mode 100644
index 000000000000..c661ce7f8b9d
@@ -0,0 +1,83 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/amlogic,axg-spdifout.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic Audio AXG SPDIF Output
+
+maintainers:
+  - Jerome Brunet <[email protected]>
+
+allOf:
+  - $ref: dai-common.yaml#

Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.yaml line 23

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.yaml new file +10 -0
+
+properties:
+  $nodename:
+    pattern: "^audio-controller@.*"
+
+  compatible:
+    oneOf:
+      - items:
+          - const:
+              amlogic,axg-spdifout

All usual comments apply.

Quoted 44 lines
Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.yaml new file +44 -0
+      - items:
+          - enum:
+              - amlogic,g12a-spdifout
+              - amlogic,sm1-spdifout
+          - const:
+              amlogic,axg-spdifout
+
+  reg:
+    maxItems: 1
+
+  "#sound-dai-cells":
+    const: 0
+
+  clocks:
+    items:
+      - description: Peripheral clock
+      - description: SPDIF output master clock
+
+  clock-names:
+    items:
+      - const: pclk
+      - const: mclk
+
+required:
+  - compatible
+  - reg
+  - "#sound-dai-cells"
+  - clocks
+  - clock-names
+
+if:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - amlogic,g12a-spdifout
+          - amlogic,sm1-spdifout
+then:
+  properties:
+    resets:
+      items:
+        - description: dedicated device reset line
+
+  required:

Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.yaml line 77

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.yaml new file +10 -0
+    - resets
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/axg-audio-clkc.h>
+
+    spdifout: audio-controller@480 {
+    	compatible = "amlogic,axg-spdifout";

Indentation.

Best regards,
Krzysztof

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

author maintainer
#21 lore raw

PATCH 9/9 ASoC: dt-bindings: meson: convert axg sound card control to schema

In reply to Jerome Brunet

Convert the DT binding documentation for the Amlogic axg sound card to schema.

---
 .../bindings/sound/amlogic,axg-sound-card.txt | 124 ------------
 .../sound/amlogic,axg-sound-card.yaml         | 182 ++++++++++++++++++
 2 files changed, 182 insertions(+), 124 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.txt deleted +0 -124
deleted file mode 100644
index 80b411296480..000000000000
@@ -1,124 +0,0 @@
-Amlogic AXG sound card:
-
-Required properties:
-
-- compatible: "amlogic,axg-sound-card"
-- model : User specified audio sound card name, one string
-
-Optional properties:
-
-- audio-aux-devs : List of phandles pointing to auxiliary devices
-- audio-widgets : Please refer to widgets.txt.
-- audio-routing : A list of the connections between audio components.
-
-Subnodes:
-
-- dai-link: Container for dai-link level properties and the CODEC
-	    sub-nodes. There should be at least one (and probably more)
-	    subnode of this type.
-
-Required dai-link properties:
-
-- sound-dai: phandle and port of the CPU DAI.
-
-Required TDM Backend dai-link properties:
-- dai-format : CPU/CODEC common audio format
-
-Optional TDM Backend dai-link properties:
-- dai-tdm-slot-rx-mask-{0,1,2,3}: Receive direction slot masks
-- dai-tdm-slot-tx-mask-{0,1,2,3}: Transmit direction slot masks
-				  When omitted, mask is assumed to have to no
-				  slots. A valid must have at one slot, so at
-				  least one these mask should be provided with
-				  an enabled slot.
-- dai-tdm-slot-num : Please refer to tdm-slot.txt.
-		     If omitted, slot number is set to accommodate the largest
-		     mask provided.
-- dai-tdm-slot-width : Please refer to tdm-slot.txt. default to 32 if omitted.
-- mclk-fs : Multiplication factor between stream rate and mclk
-
-Backend dai-link subnodes:
-
-- codec: dai-link representing backend links should have at least one subnode.
-	 One subnode for each codec of the dai-link.
-	 dai-link representing frontend links have no codec, therefore have no
-	 subnodes
-
-Required codec subnodes properties:
-
-- sound-dai: phandle and port of the CODEC DAI.
-
-Optional codec subnodes properties:
-
-- dai-tdm-slot-tx-mask : Please refer to tdm-slot.txt.
-- dai-tdm-slot-rx-mask : Please refer to tdm-slot.txt.
-
-Example:
-
-sound {
-	compatible = "amlogic,axg-sound-card";
-	model = "AXG-S420";
-	audio-aux-devs = <&tdmin_a>, <&tdmout_c>;
-	audio-widgets = "Line", "Lineout",
-			"Line", "Linein",
-			"Speaker", "Speaker1 Left",
-			"Speaker", "Speaker1 Right";
-			"Speaker", "Speaker2 Left",
-			"Speaker", "Speaker2 Right";
-	audio-routing = "TDMOUT_C IN 0", "FRDDR_A OUT 2",
-			"SPDIFOUT IN 0", "FRDDR_A OUT 3",
-			"TDM_C Playback", "TDMOUT_C OUT",
-			"TDMIN_A IN 2", "TDM_C Capture",
-			"TDMIN_A IN 5", "TDM_C Loopback",
-			"TODDR_A IN 0", "TDMIN_A OUT",
-			"Lineout", "Lineout AOUTL",
-			"Lineout", "Lineout AOUTR",
-			"Speaker1 Left", "SPK1 OUT_A",
-			"Speaker2 Left", "SPK2 OUT_A",
-			"Speaker1 Right", "SPK1 OUT_B",
-			"Speaker2 Right", "SPK2 OUT_B",
-			"Linein AINL", "Linein",
-			"Linein AINR", "Linein";
-
-	dai-link@0 {
-		sound-dai = <&frddr_a>;
-	};
-
-	dai-link@1 {
-		sound-dai = <&toddr_a>;
-	};
-
-	dai-link@2 {
-		sound-dai = <&tdmif_c>;
-		dai-format = "i2s";
-		dai-tdm-slot-tx-mask-2 = <1 1>;
-		dai-tdm-slot-tx-mask-3 = <1 1>;
-		dai-tdm-slot-rx-mask-1 = <1 1>;
-		mclk-fs = <256>;
-
-		codec@0 {
-			sound-dai = <&lineout>;
-		};
-
-		codec@1 {
-			sound-dai = <&speaker_amp1>;
-		};
-
-		codec@2 {
-			sound-dai = <&speaker_amp2>;
-		};
-
-		codec@3 {
-			sound-dai = <&linein>;
-		};
-
-	};
-
-	dai-link@3 {
-		sound-dai = <&spdifout>;
-
-		codec {
-			sound-dai = <&spdif_dit>;
-		};
-	};
-};
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +182 -0

182 lines not on this page · raw message

Signature · 7 lines
2.39.0


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
#22 lore raw

Re: [PATCH 9/9] ASoC: dt-bindings: meson: convert axg sound card control to schema

Quoted 151 lines · Jerome Brunet

Convert the DT binding documentation for the Amlogic axg sound card to schema.

---
 .../bindings/sound/amlogic,axg-sound-card.txt | 124 ------------
 .../sound/amlogic,axg-sound-card.yaml         | 182 ++++++++++++++++++
 2 files changed, 182 insertions(+), 124 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.txt deleted +0 -124
deleted file mode 100644
index 80b411296480..000000000000
@@ -1,124 +0,0 @@
-Amlogic AXG sound card:
-
-Required properties:
-
-- compatible: "amlogic,axg-sound-card"
-- model : User specified audio sound card name, one string
-
-Optional properties:
-
-- audio-aux-devs : List of phandles pointing to auxiliary devices
-- audio-widgets : Please refer to widgets.txt.
-- audio-routing : A list of the connections between audio components.
-
-Subnodes:
-
-- dai-link: Container for dai-link level properties and the CODEC
-	    sub-nodes. There should be at least one (and probably more)
-	    subnode of this type.
-
-Required dai-link properties:
-
-- sound-dai: phandle and port of the CPU DAI.
-
-Required TDM Backend dai-link properties:
-- dai-format : CPU/CODEC common audio format
-
-Optional TDM Backend dai-link properties:
-- dai-tdm-slot-rx-mask-{0,1,2,3}: Receive direction slot masks
-- dai-tdm-slot-tx-mask-{0,1,2,3}: Transmit direction slot masks
-				  When omitted, mask is assumed to have to no
-				  slots. A valid must have at one slot, so at
-				  least one these mask should be provided with
-				  an enabled slot.
-- dai-tdm-slot-num : Please refer to tdm-slot.txt.
-		     If omitted, slot number is set to accommodate the largest
-		     mask provided.
-- dai-tdm-slot-width : Please refer to tdm-slot.txt. default to 32 if omitted.
-- mclk-fs : Multiplication factor between stream rate and mclk
-
-Backend dai-link subnodes:
-
-- codec: dai-link representing backend links should have at least one subnode.
-	 One subnode for each codec of the dai-link.
-	 dai-link representing frontend links have no codec, therefore have no
-	 subnodes
-
-Required codec subnodes properties:
-
-- sound-dai: phandle and port of the CODEC DAI.
-
-Optional codec subnodes properties:
-
-- dai-tdm-slot-tx-mask : Please refer to tdm-slot.txt.
-- dai-tdm-slot-rx-mask : Please refer to tdm-slot.txt.
-
-Example:
-
-sound {
-	compatible = "amlogic,axg-sound-card";
-	model = "AXG-S420";
-	audio-aux-devs = <&tdmin_a>, <&tdmout_c>;
-	audio-widgets = "Line", "Lineout",
-			"Line", "Linein",
-			"Speaker", "Speaker1 Left",
-			"Speaker", "Speaker1 Right";
-			"Speaker", "Speaker2 Left",
-			"Speaker", "Speaker2 Right";
-	audio-routing = "TDMOUT_C IN 0", "FRDDR_A OUT 2",
-			"SPDIFOUT IN 0", "FRDDR_A OUT 3",
-			"TDM_C Playback", "TDMOUT_C OUT",
-			"TDMIN_A IN 2", "TDM_C Capture",
-			"TDMIN_A IN 5", "TDM_C Loopback",
-			"TODDR_A IN 0", "TDMIN_A OUT",
-			"Lineout", "Lineout AOUTL",
-			"Lineout", "Lineout AOUTR",
-			"Speaker1 Left", "SPK1 OUT_A",
-			"Speaker2 Left", "SPK2 OUT_A",
-			"Speaker1 Right", "SPK1 OUT_B",
-			"Speaker2 Right", "SPK2 OUT_B",
-			"Linein AINL", "Linein",
-			"Linein AINR", "Linein";
-
-	dai-link@0 {
-		sound-dai = <&frddr_a>;
-	};
-
-	dai-link@1 {
-		sound-dai = <&toddr_a>;
-	};
-
-	dai-link@2 {
-		sound-dai = <&tdmif_c>;
-		dai-format = "i2s";
-		dai-tdm-slot-tx-mask-2 = <1 1>;
-		dai-tdm-slot-tx-mask-3 = <1 1>;
-		dai-tdm-slot-rx-mask-1 = <1 1>;
-		mclk-fs = <256>;
-
-		codec@0 {
-			sound-dai = <&lineout>;
-		};
-
-		codec@1 {
-			sound-dai = <&speaker_amp1>;
-		};
-
-		codec@2 {
-			sound-dai = <&speaker_amp2>;
-		};
-
-		codec@3 {
-			sound-dai = <&linein>;
-		};
-
-	};
-
-	dai-link@3 {
-		sound-dai = <&spdifout>;
-
-		codec {
-			sound-dai = <&spdif_dit>;
-		};
-	};
-};
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +4 -0
new file mode 100644
index 000000000000..185cd9fbeda1
@@ -0,0 +1,182 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/amlogic,axg-sound-card.yaml#

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 14

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +10 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic AXG sound card
+
+maintainers:
+  - Jerome Brunet <[email protected]>
+
+properties:
+  compatible:
+    items:

Drop

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 15

Quoted 1 line
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +1 -0
+      - const: amlogic,axg-sound-card

And here you can keep such code in one line?

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 19

Quoted 4 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +4 -0
+
+  audio-aux-devs:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description: list of auxiliary devices

min/maxItems

Quoted 13 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +13 -0
+
+  audio-routing:
+    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
+    description: |-
+      A list of the connections between audio components. Each entry is a
+      pair of strings, the first being the connection's sink, the second
+      being the connection's source.
+
+  audio-widgets:
+    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
+    description: |-
+      A list off component DAPM widget. Each entry is a pair of strings,
+      the first being the widget type, the second being the widget name

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 42

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +10 -0
+
+  model:
+    $ref: /schemas/types.yaml#/definitions/string
+    description: User specified audio sound card name
+
+patternProperties:
+  "^dai-link-[0-9]+$":
+    type: object
+    additionalProperties: false
+    description: |-

Drop |-

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 43

Quoted 1 line
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +1 -0
+      dai-link child nodes:

Drop, this is not a property list.

Quoted 14 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +14 -0
+        Container for dai-link level properties and the CODEC sub-nodes.
+        There should be at least one (and probably more) subnode of this type
+
+    properties:
+      dai-format:
+        $ref: /schemas/types.yaml#/definitions/string
+        enum: [ i2s, left-j, dsp_a ]
+
+      dai-tdm-slot-num:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: |
+          Number of slots in use. If omitted, slot number is set to
+          accommodate the largest mask provided.
+        maximum: 32

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 67

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +10 -0
+
+      dai-tdm-slot-width:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: Width in bits for each slot
+        enum: [ 8, 16, 20, 24, 32 ]
+        default: 32
+
+      mclk-fs:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: |-

Drop |-
Drop it everywhere where not needed

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 72

Quoted 5 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +5 -0
+          Multiplication factor between the frame rate and master clock
+          rate
+
+      sound-dai:
+        $ref: /schemas/types.yaml#/definitions/phandle-array

Old binding was saying it is just phandle

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 78

Quoted 6 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +6 -0
+        description: phandle of the CPU DAI
+
+    patternProperties:
+      "^dai-tdm-slot-(t|r)x-mask-[0-3]$":
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        description: |-

Drop |-

Quoted 6 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +6 -0
+          Transmit and receive cpu slot masks of each TDM lane
+          When omitted, mask is assumed to have to no slots. A valid
+          interface must have at least one slot, so at least one these
+          mask should be provided with an enabled slot.
+
+      "^codec(-[0-9]+)?$":

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 94

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +10 -0
+        type: object
+        additionalProperties: false
+        description: |-
+          dai-link representing backend links should have at least one subnode.
+          One subnode for each codec of the dai-link. dai-link representing
+          frontend links have no codec, therefore have no subnodes
+
+        properties:
+          sound-dai:
+            $ref: /schemas/types.yaml#/definitions/phandle-array

phandle

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 100

Quoted 6 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +6 -0
+            description: phandle of the codec DAI
+
+        patternProperties:
+          "^dai-tdm-slot-(t|r)x-mask$":
+            $ref: /schemas/types.yaml#/definitions/uint32-array
+            description: Transmit and receive codec slot masks

Are you sure codec has dai-tdm-slot-....?

Quoted 32 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +32 -0
+
+        required:
+          - sound-dai
+
+    required:
+      - sound-dai
+
+required:
+  - model
+  - dai-link-0
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    sound {
+        compatible = "amlogic,axg-sound-card";
+        model = "AXG-S420";
+        audio-aux-devs = <&tdmin_a>, <&tdmout_c>;
+        audio-widgets = "Line", "Lineout",
+                        "Line", "Linein",
+                        "Speaker", "Speaker1 Left",
+                        "Speaker", "Speaker1 Right",
+                        "Speaker", "Speaker2 Left",
+                        "Speaker", "Speaker2 Right";
+        audio-routing = "TDMOUT_C IN 0", "FRDDR_A OUT 2",
+                        "SPDIFOUT IN 0", "FRDDR_A OUT 3",
+                        "TDM_C Playback", "TDMOUT_C OUT",
+                        "TDMIN_A IN 2", "TDM_C Capture",
+                        "TDMIN_A IN 5", "TDM_C Loopback",
+                        "TODDR_A IN 0", "TDMIN_A OUT",
+                        "Lineout", "Lineout AOUTL",

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 142

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +10 -0
+                        "Lineout", "Lineout AOUTR",
+                        "Speaker1 Left", "SPK1 OUT_A",
+                        "Speaker2 Left", "SPK2 OUT_A",
+                        "Speaker1 Right", "SPK1 OUT_B",
+                        "Speaker2 Right", "SPK2 OUT_B",
+                        "Linein AINL", "Linein",
+                        "Linein AINR", "Linein";
+
+        dai-link-0 {
+               sound-dai = <&frddr_a>;

Use 4 spaces for example indentation.

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 147

Quoted 5 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +5 -0
+        };
+
+        dai-link-1 {
+               sound-dai = <&toddr_a>;
+        };

Best regards,
Krzysztof

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic

author maintainer
#23 lore raw

Re: [PATCH 9/9] ASoC: dt-bindings: meson: convert axg sound card control to schema

Quoted 167 lines · Krzysztof Kozlowski
Quoted 151 lines · Jerome Brunet

Convert the DT binding documentation for the Amlogic axg sound card to schema.

---
 .../bindings/sound/amlogic,axg-sound-card.txt | 124 ------------
 .../sound/amlogic,axg-sound-card.yaml         | 182 ++++++++++++++++++
 2 files changed, 182 insertions(+), 124 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.txt
 create mode 100644 Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.txt deleted +0 -124
deleted file mode 100644
index 80b411296480..000000000000
@@ -1,124 +0,0 @@
-Amlogic AXG sound card:
-
-Required properties:
-
-- compatible: "amlogic,axg-sound-card"
-- model : User specified audio sound card name, one string
-
-Optional properties:
-
-- audio-aux-devs : List of phandles pointing to auxiliary devices
-- audio-widgets : Please refer to widgets.txt.
-- audio-routing : A list of the connections between audio components.
-
-Subnodes:
-
-- dai-link: Container for dai-link level properties and the CODEC
-	    sub-nodes. There should be at least one (and probably more)
-	    subnode of this type.
-
-Required dai-link properties:
-
-- sound-dai: phandle and port of the CPU DAI.
-
-Required TDM Backend dai-link properties:
-- dai-format : CPU/CODEC common audio format
-
-Optional TDM Backend dai-link properties:
-- dai-tdm-slot-rx-mask-{0,1,2,3}: Receive direction slot masks
-- dai-tdm-slot-tx-mask-{0,1,2,3}: Transmit direction slot masks
-				  When omitted, mask is assumed to have to no
-				  slots. A valid must have at one slot, so at
-				  least one these mask should be provided with
-				  an enabled slot.
-- dai-tdm-slot-num : Please refer to tdm-slot.txt.
-		     If omitted, slot number is set to accommodate the largest
-		     mask provided.
-- dai-tdm-slot-width : Please refer to tdm-slot.txt. default to 32 if omitted.
-- mclk-fs : Multiplication factor between stream rate and mclk
-
-Backend dai-link subnodes:
-
-- codec: dai-link representing backend links should have at least one subnode.
-	 One subnode for each codec of the dai-link.
-	 dai-link representing frontend links have no codec, therefore have no
-	 subnodes
-
-Required codec subnodes properties:
-
-- sound-dai: phandle and port of the CODEC DAI.
-
-Optional codec subnodes properties:
-
-- dai-tdm-slot-tx-mask : Please refer to tdm-slot.txt.
-- dai-tdm-slot-rx-mask : Please refer to tdm-slot.txt.
-
-Example:
-
-sound {
-	compatible = "amlogic,axg-sound-card";
-	model = "AXG-S420";
-	audio-aux-devs = <&tdmin_a>, <&tdmout_c>;
-	audio-widgets = "Line", "Lineout",
-			"Line", "Linein",
-			"Speaker", "Speaker1 Left",
-			"Speaker", "Speaker1 Right";
-			"Speaker", "Speaker2 Left",
-			"Speaker", "Speaker2 Right";
-	audio-routing = "TDMOUT_C IN 0", "FRDDR_A OUT 2",
-			"SPDIFOUT IN 0", "FRDDR_A OUT 3",
-			"TDM_C Playback", "TDMOUT_C OUT",
-			"TDMIN_A IN 2", "TDM_C Capture",
-			"TDMIN_A IN 5", "TDM_C Loopback",
-			"TODDR_A IN 0", "TDMIN_A OUT",
-			"Lineout", "Lineout AOUTL",
-			"Lineout", "Lineout AOUTR",
-			"Speaker1 Left", "SPK1 OUT_A",
-			"Speaker2 Left", "SPK2 OUT_A",
-			"Speaker1 Right", "SPK1 OUT_B",
-			"Speaker2 Right", "SPK2 OUT_B",
-			"Linein AINL", "Linein",
-			"Linein AINR", "Linein";
-
-	dai-link@0 {
-		sound-dai = <&frddr_a>;
-	};
-
-	dai-link@1 {
-		sound-dai = <&toddr_a>;
-	};
-
-	dai-link@2 {
-		sound-dai = <&tdmif_c>;
-		dai-format = "i2s";
-		dai-tdm-slot-tx-mask-2 = <1 1>;
-		dai-tdm-slot-tx-mask-3 = <1 1>;
-		dai-tdm-slot-rx-mask-1 = <1 1>;
-		mclk-fs = <256>;
-
-		codec@0 {
-			sound-dai = <&lineout>;
-		};
-
-		codec@1 {
-			sound-dai = <&speaker_amp1>;
-		};
-
-		codec@2 {
-			sound-dai = <&speaker_amp2>;
-		};
-
-		codec@3 {
-			sound-dai = <&linein>;
-		};
-
-	};
-
-	dai-link@3 {
-		sound-dai = <&spdifout>;
-
-		codec {
-			sound-dai = <&spdif_dit>;
-		};
-	};
-};
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +4 -0
new file mode 100644
index 000000000000..185cd9fbeda1
@@ -0,0 +1,182 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/amlogic,axg-sound-card.yaml#

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 14

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +10 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic AXG sound card
+
+maintainers:
+  - Jerome Brunet <[email protected]>
+
+properties:
+  compatible:
+    items:

Drop

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 15

Quoted 1 line
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +1 -0
+      - const: amlogic,axg-sound-card
Quoted 8 lines

And here you can keep such code in one line?

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 19

Quoted 4 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +4 -0
+
+  audio-aux-devs:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description: list of auxiliary devices

min/maxItems

Auxiliary devices are not mandatory and there is no limit on how many a sound card may have. Any number of item is valid.

Quoted 59 lines
Quoted 14 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +13 -0
+
+  audio-routing:
+    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
+    description: |-
+      A list of the connections between audio components. Each entry is a
+      pair of strings, the first being the connection's sink, the second
+      being the connection's source.
+
+  audio-widgets:
+    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
+    description: |-
+      A list off component DAPM widget. Each entry is a pair of strings,
+      the first being the widget type, the second being the widget name

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 42

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +10 -0
+
+  model:
+    $ref: /schemas/types.yaml#/definitions/string
+    description: User specified audio sound card name
+
+patternProperties:
+  "^dai-link-[0-9]+$":
+    type: object
+    additionalProperties: false
+    description: |-

Drop |-

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 43

Quoted 1 line
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +1 -0
+      dai-link child nodes:

Drop, this is not a property list.

Quoted 14 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +14 -0
+        Container for dai-link level properties and the CODEC sub-nodes.
+        There should be at least one (and probably more) subnode of this type
+
+    properties:
+      dai-format:
+        $ref: /schemas/types.yaml#/definitions/string
+        enum: [ i2s, left-j, dsp_a ]
+
+      dai-tdm-slot-num:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: |
+          Number of slots in use. If omitted, slot number is set to
+          accommodate the largest mask provided.
+        maximum: 32

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 67

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +10 -0
+
+      dai-tdm-slot-width:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: Width in bits for each slot
+        enum: [ 8, 16, 20, 24, 32 ]
+        default: 32
+
+      mclk-fs:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        description: |-

Drop |-
Drop it everywhere where not needed

Quoted 7 lines

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 72

Quoted 5 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +5 -0
+          Multiplication factor between the frame rate and master clock
+          rate
+
+      sound-dai:
+        $ref: /schemas/types.yaml#/definitions/phandle-array

Old binding was saying it is just phandle

It is just a phandle but the bindings used to have problem with phandle that had cells.

See:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/Documentation/devicetree/bindings/sound/amlogic,gx-sound-card.yaml?h=v6.2-rc6&id=d031d99b02eaf7363c33f5b27b38086cc8104082

Was it wrong or did the situation change since then ?

Quoted 29 lines

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 78

Quoted 7 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +6 -0
+        description: phandle of the CPU DAI
+
+    patternProperties:
+      "^dai-tdm-slot-(t|r)x-mask-[0-3]$":
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        description: |-

Drop |-

Quoted 6 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +6 -0
+          Transmit and receive cpu slot masks of each TDM lane
+          When omitted, mask is assumed to have to no slots. A valid
+          interface must have at least one slot, so at least one these
+          mask should be provided with an enabled slot.
+
+      "^codec(-[0-9]+)?$":

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 94

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +10 -0
+        type: object
+        additionalProperties: false
+        description: |-
+          dai-link representing backend links should have at least one subnode.
+          One subnode for each codec of the dai-link. dai-link representing
+          frontend links have no codec, therefore have no subnodes
+
+        properties:
+          sound-dai:
+            $ref: /schemas/types.yaml#/definitions/phandle-array

phandle

Quoted 8 lines

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 100

Quoted 6 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +6 -0
+            description: phandle of the codec DAI
+
+        patternProperties:
+          "^dai-tdm-slot-(t|r)x-mask$":
+            $ref: /schemas/types.yaml#/definitions/uint32-array
+            description: Transmit and receive codec slot masks

Are you sure codec has dai-tdm-slot-....?

Yes. Both CPU and and codecs have slots.

A classic case is a CPU with 2 codecs attached
Codec #0 plays slots 0,1
Codec #1 plays slots 2,3

CPU tx slots is       <1, 1, 1, 1>
Codec #0 rx slots is  <1, 1, 0, 0>
Codec #1 rx slots is  <0, 0, 1, 1>
Quoted 54 lines
Quoted 33 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +32 -0
+
+        required:
+          - sound-dai
+
+    required:
+      - sound-dai
+
+required:
+  - model
+  - dai-link-0
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    sound {
+        compatible = "amlogic,axg-sound-card";
+        model = "AXG-S420";
+        audio-aux-devs = <&tdmin_a>, <&tdmout_c>;
+        audio-widgets = "Line", "Lineout",
+                        "Line", "Linein",
+                        "Speaker", "Speaker1 Left",
+                        "Speaker", "Speaker1 Right",
+                        "Speaker", "Speaker2 Left",
+                        "Speaker", "Speaker2 Right";
+        audio-routing = "TDMOUT_C IN 0", "FRDDR_A OUT 2",
+                        "SPDIFOUT IN 0", "FRDDR_A OUT 3",
+                        "TDM_C Playback", "TDMOUT_C OUT",
+                        "TDMIN_A IN 2", "TDM_C Capture",
+                        "TDMIN_A IN 5", "TDM_C Loopback",
+                        "TODDR_A IN 0", "TDMIN_A OUT",
+                        "Lineout", "Lineout AOUTL",

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 142

Quoted 10 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +10 -0
+                        "Lineout", "Lineout AOUTR",
+                        "Speaker1 Left", "SPK1 OUT_A",
+                        "Speaker2 Left", "SPK2 OUT_A",
+                        "Speaker1 Right", "SPK1 OUT_B",
+                        "Speaker2 Right", "SPK2 OUT_B",
+                        "Linein AINL", "Linein",
+                        "Linein AINR", "Linein";
+
+        dai-link-0 {
+               sound-dai = <&frddr_a>;

Use 4 spaces for example indentation.

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 147

Quoted 5 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +5 -0
+        };
+
+        dai-link-1 {
+               sound-dai = <&toddr_a>;
+        };

Best regards,
Krzysztof

#24 lore raw

Re: [PATCH 9/9] ASoC: dt-bindings: meson: convert axg sound card control to schema

Quoted 8 lines · Jerome Brunet
Quoted 7 lines

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 72

Quoted 5 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +5 -0
+          Multiplication factor between the frame rate and master clock
+          rate
+
+      sound-dai:
+        $ref: /schemas/types.yaml#/definitions/phandle-array

Old binding was saying it is just phandle

Quoted 7 lines

It is just a phandle but the bindings used to have problem with phandle that had cells.

See:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/Documentation/devicetree/bindings/sound/amlogic,gx-sound-card.yaml?h=v6.2-rc6&id=d031d99b02eaf7363c33f5b27b38086cc8104082

Was it wrong or did the situation change since then ?

Then define it as having cells:

https://elixir.bootlin.com/linux/v5.18-rc1/source/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml#L42

Best regards,
Krzysztof

author maintainer
#25 lore raw

Re: [PATCH 9/9] ASoC: dt-bindings: meson: convert axg sound card control to schema

Quoted 12 lines · Krzysztof Kozlowski
Quoted 11 lines · Jerome Brunet
Quoted 7 lines

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 72

Quoted 5 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +5 -0
+          Multiplication factor between the frame rate and master clock
+          rate
+
+      sound-dai:
+        $ref: /schemas/types.yaml#/definitions/phandle-array

Old binding was saying it is just phandle

It is just a phandle but the bindings used to have problem with phandle that had cells.

Quoted 9 lines
Quoted 4 lines

See:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/Documentation/devicetree/bindings/sound/amlogic,gx-sound-card.yaml?h=v6.2-rc6&id=d031d99b02eaf7363c33f5b27b38086cc8104082

Was it wrong or did the situation change since then ?

Then define it as having cells:

https://elixir.bootlin.com/linux/v5.18-rc1/source/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml#L42

The card is provided with the phandle.
Whether or not the phandle has cells or not has nothing do with card driver. The card just consums sound-dai. I don't understand this comment.

Quoted 3 lines

Best regards,
Krzysztof

#26 lore raw

Re: [PATCH 9/9] ASoC: dt-bindings: meson: convert axg sound card control to schema

Quoted 20 lines · Jerome Brunet
Quoted 17 lines · Krzysztof Kozlowski
Quoted 15 lines · Jerome Brunet
Quoted 7 lines

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 72

Quoted 5 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +5 -0
+          Multiplication factor between the frame rate and master clock
+          rate
+
+      sound-dai:
+        $ref: /schemas/types.yaml#/definitions/phandle-array

Old binding was saying it is just phandle

It is just a phandle but the bindings used to have problem with phandle that had cells.

See:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/Documentation/devicetree/bindings/sound/amlogic,gx-sound-card.yaml?h=v6.2-rc6&id=d031d99b02eaf7363c33f5b27b38086cc8104082

Was it wrong or did the situation change since then ?

Quoted 8 lines
Quoted 4 lines

Then define it as having cells:

https://elixir.bootlin.com/linux/v5.18-rc1/source/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml#L42

The card is provided with the phandle.
Whether or not the phandle has cells or not has nothing do with card driver. The card just consums sound-dai. I don't understand this comment.

You said this is only a phandle. Then you have just two options - either this is one phandle without arguments (then change it as I asked originally) or this is one phandle with arguments (then change it to define the arguments like in example I gave you).

Best regards,
Krzysztof

#27 lore raw

Re: [PATCH 9/9] ASoC: dt-bindings: meson: convert axg sound card control to schema

In reply to Jerome Brunet
Quoted 15 lines · Jerome Brunet
Quoted 12 lines · Krzysztof Kozlowski
Quoted 11 lines · Jerome Brunet
Quoted 7 lines

Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml line 72

Quoted 5 lines
Documentation/devicetree/bindings/sound/amlogic,axg-sound-card.yaml new file +5 -0
+          Multiplication factor between the frame rate and master clock
+          rate
+
+      sound-dai:
+        $ref: /schemas/types.yaml#/definitions/phandle-array

Old binding was saying it is just phandle

It is just a phandle but the bindings used to have problem with phandle that had cells.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

See:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/Documentation/devicetree/bindings/sound/amlogic,gx-sound-card.yaml?h=v6.2-rc6&id=d031d99b02eaf7363c33f5b27b38086cc8104082

Was it wrong or did the situation change since then ?

Then define it as having cells:

https://elixir.bootlin.com/linux/v5.18-rc1/source/Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml#L42

Eh, it is already defined, so my advice is incorrect. Drop the ref and define maxItems.

Best regards,
Krzysztof

maintainer
#28 lore raw

Re: (subset) [PATCH 0/9] ASoC: dt-bindings: meson: covert axg audio to schema

In reply to Jerome Brunet
Quoted 13 lines · Jerome Brunet

Convert AXG audio dt-binding documentation to schema

Jerome Brunet (9):
ASoC: dt-bindings: create component common schema
ASoC: dt-bindings: meson: fix gx-card codec node regex
ASoC: dt-bindings: meson: convert axg tdm interface to schema
ASoC: dt-bindings: meson: convert axg tdm formatters to schema
ASoC: dt-bindings: meson: convert axg pdm to schema
ASoC: dt-bindings: meson: convert axg fifo to schema
ASoC: dt-bindings: meson: convert axg spdif input to schema
ASoC: dt-bindings: meson: convert axg spdif output to schema
ASoC: dt-bindings: meson: convert axg sound card control to schema

Quoted 1 line

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/9] ASoC: dt-bindings: create component common schema

      commit: e398bbb9834a2f6cbe27cbd72956159ecc92055f
[2/9] ASoC: dt-bindings: meson: fix gx-card codec node regex
      commit: 480b26226873c88e482575ceb0d0a38d76e1be57

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark