Skip to contentSkip to conversation

ASoC: graph card schema rework

PATCH In review Rob Herring 4 participants 11 messages Nov 17, 2020 – Dec 1, 2020

Subsystems (4)
lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

cover ASoC: graph card schema rework

This series updates Sameer's patch to repartition the graph card binding schema and incorporate the OF graph schema. The schema was also mixing card node and DAI node properties, so I've split the DAI part (the 'port' node) into a separate schema.

There's another problem that 'frame-master' and 'bitclock-master' have inconsistent types of boolean and phandle. Having the properties just point to the local or remote endpoint within an endpoint node is kind of pointless. We should have gone with just boolean, but looks like we already have several users. MMP OLPC is the one platform using boolean, but it happens to work because the properties are effectively ignored and CPU DAI as the master is the default.

Rob

Rob Herring (3):
ASoC: dt-bindings: Use OF graph schema
ASoC: dt-bindings: marvell,mmp-sspa: Use audio-graph-port schema
ASoC: dt-bindings: Refine 'frame-master' and 'bitclock-master' type

Sameer Pujar (1):
ASoC: audio-graph-card: Refactor schema

 .../bindings/sound/audio-graph-card.yaml      | 106 +-----------------
 .../bindings/sound/audio-graph-port.yaml      |  72 ++++++++++++
 .../bindings/sound/audio-graph.yaml           |  45 ++++++++
 .../bindings/sound/marvell,mmp-sspa.yaml      |  25 +----
 .../bindings/sound/renesas,rsnd.yaml          |  12 +-
 .../bindings/sound/simple-card.yaml           |   6 +-
 6 files changed, 132 insertions(+), 134 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/audio-graph-port.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/audio-graph.yaml

base-commit: e2e99930ec006c6fe1d62af339a765ade71a0d9a

Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH 1/4 ASoC: audio-graph-card: Refactor schema

From: Sameer Pujar <[email protected]>

There can be customized sound cards which are based on generic audio graph. In such cases most of the stuff is reused from generic audio graph. To facilitate this, refactor audio graph schema into multiple files and the base schema can be reused for specific sound cards.

The graph card nodes and port nodes are separate entities, so they should be separate schemas.

Cc Kuninori Morimoto <[email protected]>
[robh: Split out port schema. Add graph.yaml in subsequent commit]
---
 .../bindings/sound/audio-graph-card.yaml      | 106 +-----------------
 .../bindings/sound/audio-graph-port.yaml      |  86 ++++++++++++++
 .../bindings/sound/audio-graph.yaml           |  45 ++++++++
 .../bindings/sound/renesas,rsnd.yaml          |  12 +-
 4 files changed, 141 insertions(+), 108 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/sound/audio-graph-port.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/audio-graph.yaml
Documentation/devicetree/bindings/sound/audio-graph-card.yaml +5 -101
index 2329aeb91db7..109e55f9e597 100644
@@ -4,120 +4,24 @@
 $id: http://devicetree.org/schemas/sound/audio-graph-card.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: Audio Graph Card Driver Device Tree Bindings
+title: Audio Graph Card Device Tree Bindings
 
 maintainers:
   - Kuninori Morimoto <[email protected]>
 
+allOf:
+  - $ref: /schemas/sound/audio-graph.yaml#
+
 properties:
   compatible:
     enum:
       - audio-graph-card
       - audio-graph-scu-card
 
-  dais:
-    $ref: /schemas/types.yaml#/definitions/phandle-array
-  label:
-    maxItems: 1
-  prefix:
-    description: "device name prefix"
-    $ref: /schemas/types.yaml#/definitions/string
-  routing:
-    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.
-    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
-  widgets:
-    description: User specified audio sound widgets.
-    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
-  convert-rate:
-    description: CPU to Codec rate convert.
-    $ref: /schemas/types.yaml#/definitions/uint32
-  convert-channels:
-    description: CPU to Codec rate channels.
-    $ref: /schemas/types.yaml#/definitions/uint32
-  pa-gpios:
-    maxItems: 1
-  hp-det-gpio:
-    maxItems: 1
-  mic-det-gpio:
-    maxItems: 1
-
-  port:
-    description: single OF-Graph subnode
-    type: object
-    properties:
-      reg:
-        maxItems: 1
-      prefix:
-        description: "device name prefix"
-        $ref: /schemas/types.yaml#/definitions/string
-      convert-rate:
-        description: CPU to Codec rate convert.
-        $ref: /schemas/types.yaml#/definitions/uint32
-      convert-channels:
-        description: CPU to Codec rate channels.
-        $ref: /schemas/types.yaml#/definitions/uint32
-    patternProperties:
-      "^endpoint(@[0-9a-f]+)?":
-        type: object
-        properties:
-          remote-endpoint:
-            maxItems: 1
-          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
-          frame-inversion:
-            description: dai-link uses frame clock inversion
-            $ref: /schemas/types.yaml#/definitions/flag
-          bitclock-inversion:
-            description: dai-link uses bit clock inversion
-            $ref: /schemas/types.yaml#/definitions/flag
-          frame-master:
-            description: Indicates dai-link frame master.
-            $ref: /schemas/types.yaml#/definitions/phandle-array
-            maxItems: 1
-          bitclock-master:
-            description: Indicates dai-link bit clock master
-            $ref: /schemas/types.yaml#/definitions/phandle-array
-            maxItems: 1
-          dai-format:
-            description: audio format.
-            items:
-              enum:
-                - i2s
-                - right_j
-                - left_j
-                - dsp_a
-                - dsp_b
-                - ac97
-                - pdm
-                - msb
-                - lsb
-          convert-rate:
-            description: CPU to Codec rate convert.
-            $ref: /schemas/types.yaml#/definitions/uint32
-          convert-channels:
-            description: CPU to Codec rate channels.
-            $ref: /schemas/types.yaml#/definitions/uint32
-        required:
-          - remote-endpoint
-
-  ports:
-    description: multi OF-Graph subnode
-    type: object
-    patternProperties:
-      "^port(@[0-9a-f]+)?":
-        $ref: "#/properties/port"
-
 required:
   - compatible
-  - dais
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
Documentation/devicetree/bindings/sound/audio-graph-port.yaml new file +86 -0

86 lines not on this page · raw message

Documentation/devicetree/bindings/sound/audio-graph.yaml new file +45 -0

45 lines not on this page · raw message

Documentation/devicetree/bindings/sound/renesas,rsnd.yaml +5 -7
index 51f4dcaa970d..cbfd5914b432 100644
@@ -9,6 +9,10 @@ title: Renesas R-Car Sound Driver Device Tree Bindings
 maintainers:
   - Kuninori Morimoto <[email protected]>
 
+allOf:
+  - $ref: audio-graph.yaml#
+  - $ref: audio-graph-port.yaml#
+
 properties:
 
   compatible:
@@ -111,13 +115,7 @@ properties:
         - pattern: '^dvc\.[0-1]$'
         - pattern: '^clk_(a|b|c|i)$'
 
-  port:
-    description: OF-Graph subnode
-    $ref: "audio-graph-card.yaml#/properties/port"
-
-  ports:
-    description: multi OF-Graph subnode
-    $ref: "audio-graph-card.yaml#/properties/ports"
+  port: true
 
 # use patternProperties to avoid naming "xxx,yyy" issue
 patternProperties:
Signature · 1 line
2.25.1
Acked-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] ASoC: audio-graph-card: Refactor schema

Hi Rob,

Quoted 14 lines

From: Sameer Pujar <[email protected]>

There can be customized sound cards which are based on generic audio graph. In such cases most of the stuff is reused from generic audio graph. To facilitate this, refactor audio graph schema into multiple files and the base schema can be reused for specific sound cards.

The graph card nodes and port nodes are separate entities, so they should be separate schemas.

Cc Kuninori Morimoto <[email protected]>
[robh: Split out port schema. Add graph.yaml in subsequent commit]
Quoted 8 lines
---
  .../bindings/sound/audio-graph-card.yaml      | 106 +-----------------
  .../bindings/sound/audio-graph-port.yaml      |  86 ++++++++++++++
  .../bindings/sound/audio-graph.yaml           |  45 ++++++++
  .../bindings/sound/renesas,rsnd.yaml          |  12 +-
  4 files changed, 141 insertions(+), 108 deletions(-)

create mode 100644 Documentation/devicetree/bindings/sound/audio-graph-port.yaml create mode 100644 Documentation/devicetree/bindings/sound/audio-graph.yaml

Thanks for the update.

author maintainer
#3 lore raw

PATCH 2/4 ASoC: dt-bindings: Use OF graph schema

In reply to Rob Herring

Now that we have an OF graph schema, let's use it for the audio-graph-port schema.

There's no need to define 'ports' nodes as specific bindings must define that and port numbering of the child 'port' nodes.

---
Note that graph.yaml is part of dtschema now intead of the kernel tree.

---
 .../bindings/sound/audio-graph-port.yaml         | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
Documentation/devicetree/bindings/sound/audio-graph-port.yaml +2 -14
index 9db19d4edc6a..c05d5643b10e 100644
@@ -13,11 +13,9 @@ select: false
 
 properties:
   port:
-    description: single OF-Graph subnode
+    $ref: /schemas/graph.yaml#/properties/port
     type: object
     properties:
-      reg:
-        maxItems: 1
       prefix:
         description: "device name prefix"
         $ref: /schemas/types.yaml#/definitions/string
@@ -31,8 +29,6 @@ properties:
       "^endpoint(@[0-9a-f]+)?":
         type: object
         properties:
-          remote-endpoint:
-            maxItems: 1
           mclk-fs:
             description: |
               Multiplication factor between stream rate and codec mclk.
@@ -73,14 +69,6 @@ properties:
             description: CPU to Codec rate channels.
             $ref: /schemas/types.yaml#/definitions/uint32
 
-        required:
-          - remote-endpoint
-
-  ports:
-    description: multi OF-Graph subnode
-    type: object
-    patternProperties:
-      "^port(@[0-9a-f]+)?":
-        $ref: "#/properties/port"
+    additionalProperties: false
 
 additionalProperties: true
Signature · 1 line
2.25.1
author maintainer
#4 lore raw

Re: [PATCH 2/4] ASoC: dt-bindings: Use OF graph schema

Quoted 7 lines · Rob Herring

Now that we have an OF graph schema, let's use it for the audio-graph-port schema.

There's no need to define 'ports' nodes as specific bindings must define that and port numbering of the child 'port' nodes.

Quoted 6 lines

---
Note that graph.yaml is part of dtschema now intead of the kernel tree.

---
 .../bindings/sound/audio-graph-port.yaml         | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

Hold off on applying this. I think graph.yaml is going to need some more refinement.

The rest should be able to be applied without this patch.

Rob

#5 lore raw

Re: [PATCH 2/4] ASoC: dt-bindings: Use OF graph schema

Hi Rob,

Quoted 6 lines
Quoted 6 lines

Now that we have an OF graph schema, let's use it for the audio-graph-port schema.

There's no need to define 'ports' nodes as specific bindings must define that and port numbering of the child 'port' nodes.

Quoted 8 lines
Quoted 6 lines

---
Note that graph.yaml is part of dtschema now intead of the kernel tree.

---
  .../bindings/sound/audio-graph-port.yaml         | 16 ++--------------
  1 file changed, 2 insertions(+), 14 deletions(-)

Hold off on applying this. I think graph.yaml is going to need some more refinement.

Would this be OK if below part of the patch is submitted separately in case above is not immediately planned?

- required:
- - remote-endpoint
-

Currently I have dependency on this for series https://patchwork.kernel.org/project/alsa-devel/list/?series=391735&state=*.

Quoted 4 lines

The rest should be able to be applied without this patch.

Rob

author maintainer
#6 lore raw

PATCH 3/4 ASoC: dt-bindings: marvell, mmp-sspa: Use audio-graph-port schema

In reply to Rob Herring

Now that we have a graph schema, reference it from the marvell,mmp-sspa schema.

---
 .../bindings/sound/marvell,mmp-sspa.yaml      | 25 +++----------------
 1 file changed, 3 insertions(+), 22 deletions(-)
Documentation/devicetree/bindings/sound/marvell,mmp-sspa.yaml +3 -22
index 6d20a24a2ae9..234f64a32184 100644
@@ -9,6 +9,9 @@ title: Marvel SSPA Digital Audio Interface Bindings
 maintainers:
   - Lubomir Rintel <[email protected]>
 
+allOf:
+  - $ref: audio-graph-port.yaml#
+
 properties:
   $nodename:
     pattern: "^audio-controller(@.*)?$"
@@ -58,29 +61,9 @@ properties:
         type: object
 
         properties:
-          remote-endpoint: true
-
-          frame-master:
-            type: boolean
-            description: SoC generates the frame clock
-
-          bitclock-master:
-            type: boolean
-            description: SoC generates the bit clock
-
           dai-format:
-            $ref: /schemas/types.yaml#/definitions/string
-            description: The digital audio format
             const: i2s
 
-        required:
-          - remote-endpoint
-
-    required:
-      - endpoint
-
-    additionalProperties: false
-
 required:
   - "#sound-dai-cells"
   - compatible
@@ -112,8 +95,6 @@ examples:
       port {
         endpoint {
           remote-endpoint = <&rt5631_0>;
-          frame-master;
-          bitclock-master;
           dai-format = "i2s";
         };
       };
Signature · 1 line
2.25.1
Acked-by on v1 3/4
#7 lore raw

Re: [PATCH 3/4] ASoC: dt-bindings: marvell,mmp-sspa: Use audio-graph-port schema

Quoted 4 lines · Rob Herring

Now that we have a graph schema, reference it from the marvell,mmp-sspa schema.

Thank you
Lubo

Quoted 60 lines
---
 .../bindings/sound/marvell,mmp-sspa.yaml      | 25 +++----------------
 1 file changed, 3 insertions(+), 22 deletions(-)
Documentation/devicetree/bindings/sound/marvell,mmp-sspa.yaml +3 -22
index 6d20a24a2ae9..234f64a32184 100644
@@ -9,6 +9,9 @@ title: Marvel SSPA Digital Audio Interface Bindings
 maintainers:
   - Lubomir Rintel <[email protected]>
 
+allOf:
+  - $ref: audio-graph-port.yaml#
+
 properties:
   $nodename:
     pattern: "^audio-controller(@.*)?$"
@@ -58,29 +61,9 @@ properties:
         type: object
 
         properties:
-          remote-endpoint: true
-
-          frame-master:
-            type: boolean
-            description: SoC generates the frame clock
-
-          bitclock-master:
-            type: boolean
-            description: SoC generates the bit clock
-
           dai-format:
-            $ref: /schemas/types.yaml#/definitions/string
-            description: The digital audio format
             const: i2s
 
-        required:
-          - remote-endpoint
-
-    required:
-      - endpoint
-
-    additionalProperties: false
-
 required:
   - "#sound-dai-cells"
   - compatible
@@ -112,8 +95,6 @@ examples:
       port {
         endpoint {
           remote-endpoint = <&rt5631_0>;
-          frame-master;
-          bitclock-master;
           dai-format = "i2s";
         };
       };
Signature · 1 line
2.25.1
author maintainer
#8 lore raw

PATCH 4/4 ASoC: dt-bindings: Refine 'frame-master' and 'bitclock-master' type

In reply to Rob Herring

'frame-master' and 'bitclock-master' are only a single phandle, so use the more specific 'phandle' type definition instead.

---
 .../devicetree/bindings/sound/audio-graph-port.yaml         | 6 ++----
 Documentation/devicetree/bindings/sound/simple-card.yaml    | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)
Documentation/devicetree/bindings/sound/audio-graph-port.yaml +2 -4
index c05d5643b10e..7c13ca41d41f 100644
@@ -43,12 +43,10 @@ properties:
             $ref: /schemas/types.yaml#/definitions/flag
           frame-master:
             description: Indicates dai-link frame master.
-            $ref: /schemas/types.yaml#/definitions/phandle-array
-            maxItems: 1
+            $ref: /schemas/types.yaml#/definitions/phandle
           bitclock-master:
             description: Indicates dai-link bit clock master
-            $ref: /schemas/types.yaml#/definitions/phandle-array
-            maxItems: 1
+            $ref: /schemas/types.yaml#/definitions/phandle
           dai-format:
             description: audio format.
             items:
Documentation/devicetree/bindings/sound/simple-card.yaml +2 -4
index 35e669020296..45fd9fd9eb54 100644
@@ -13,13 +13,11 @@ definitions:
 
   frame-master:
     description: Indicates dai-link frame master.
-    $ref: /schemas/types.yaml#/definitions/phandle-array
-    maxItems: 1
+    $ref: /schemas/types.yaml#/definitions/phandle
 
   bitclock-master:
     description: Indicates dai-link bit clock master
-    $ref: /schemas/types.yaml#/definitions/phandle-array
-    maxItems: 1
+    $ref: /schemas/types.yaml#/definitions/phandle
 
   frame-inversion:
     description: dai-link uses frame clock inversion
Signature · 1 line
2.25.1
Acked-by on v1 4/4
#9 lore raw

Re: [PATCH 4/4] ASoC: dt-bindings: Refine 'frame-master' and 'bitclock-master' type

Quoted 10 lines

'frame-master' and 'bitclock-master' are only a single phandle, so use the more specific 'phandle' type definition instead.

---
  .../devicetree/bindings/sound/audio-graph-port.yaml         | 6 ++----
  Documentation/devicetree/bindings/sound/simple-card.yaml    | 6 ++----
  2 files changed, 4 insertions(+), 8 deletions(-)
maintainer
#10 lore raw
In reply to Rob Herring
Quoted 13 lines · Rob Herring

This series updates Sameer's patch to repartition the graph card binding schema and incorporate the OF graph schema. The schema was also mixing card node and DAI node properties, so I've split the DAI part (the 'port' node) into a separate schema.

There's another problem that 'frame-master' and 'bitclock-master' have inconsistent types of boolean and phandle. Having the properties just point to the local or remote endpoint within an endpoint node is kind of pointless. We should have gone with just boolean, but looks like we already have several users. MMP OLPC is the one platform using boolean, but it happens to work because the properties are effectively ignored and CPU DAI as the master is the default.

Quoted 1 line

[...]

Applied to

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

Thanks!

[1/3] ASoC: audio-graph-card: Refactor schema

      commit: e52f3f291152042f1759b2b8838e7ca24556997e
[2/3] ASoC: dt-bindings: marvell, mmp-sspa: Use audio-graph-port schema
      commit: fd97ee45ec63759593b06be010a8ed395b299cce
[3/3] ASoC: dt-bindings: Refine 'frame-master' and 'bitclock-master' type
      commit: 251bf658558f9feff8a92ddcde402ffa220d13b8

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