diff mbox series

[v6,5/7] ASoC: dt-bindings: update fsl-asoc-card bindings after imx-spdif merge

Message ID 20240627083104.123357-6-elinor.montmasson@savoirfairelinux.com
State Accepted
Commit 4359caadd17fbde64d656c10bd6f2dc91b675a11
Headers show
Series [v6,1/7] ASoC: fsl-asoc-card: add support for dai links with multiple codecs | expand

Commit Message

Elinor Montmasson June 27, 2024, 8:31 a.m. UTC
The S/PDIF audio card support with compatible "fsl,imx-audio-spdif"
was merged from imx-spdif into the fsl-asoc-card driver.
It makes possible to use an S/PDIF with an ASRC.

This merge introduces new DT bindings to use with compatible
"fsl,imx-audio-spdif" to follow the way fsl-asoc-card works:
* the "spdif-controller" property from imx-spdif is named "audio-cpu"
  in fsl-asoc-card.
* fsl-asoc-card uses codecs explicitly declared in DT
  with "audio-codec".
  With an SPDIF, codec drivers spdif_transmitter and
  spdif_receiver should be used.
  Driver imx-spdif used instead the dummy codec and a pair of
  boolean properties, "spdif-in" and "spdif-out".

In an upcoming commit, in-tree DTs will be modified to follow these new
properties:
* Property "spdif-controller" will be renamed "audio-cpu".
* spdif_transmitter and spdif_receiver nodes will be declared
  and linked to the fsl-asoc-card node with the property "audio-codec".

To keep backward compatibility with other DTs, support for
"spdif-controller", "spdif-in" and "spdif-out" properties is kept.
However, it is recommended to use the new properties if possible.
It is better to declare transmitter and/or receiver
in DT than using the dummy codec.

DTs using compatible "fsl,imx-audio-spdif" are still supported, and
fsl-asoc-card will behave the same as imx-spdif for these DTs.

Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
---
 .../bindings/sound/fsl,imx-audio-spdif.yaml   | 66 -------------------
 .../bindings/sound/fsl-asoc-card.yaml         | 53 +++++++++++++--
 2 files changed, 49 insertions(+), 70 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/fsl,imx-audio-spdif.yaml

Comments

Rob Herring (Arm) July 8, 2024, 2:47 p.m. UTC | #1
On Thu, 27 Jun 2024 10:31:02 +0200, Elinor Montmasson wrote:
> The S/PDIF audio card support with compatible "fsl,imx-audio-spdif"
> was merged from imx-spdif into the fsl-asoc-card driver.
> It makes possible to use an S/PDIF with an ASRC.
> 
> This merge introduces new DT bindings to use with compatible
> "fsl,imx-audio-spdif" to follow the way fsl-asoc-card works:
> * the "spdif-controller" property from imx-spdif is named "audio-cpu"
>   in fsl-asoc-card.
> * fsl-asoc-card uses codecs explicitly declared in DT
>   with "audio-codec".
>   With an SPDIF, codec drivers spdif_transmitter and
>   spdif_receiver should be used.
>   Driver imx-spdif used instead the dummy codec and a pair of
>   boolean properties, "spdif-in" and "spdif-out".
> 
> In an upcoming commit, in-tree DTs will be modified to follow these new
> properties:
> * Property "spdif-controller" will be renamed "audio-cpu".
> * spdif_transmitter and spdif_receiver nodes will be declared
>   and linked to the fsl-asoc-card node with the property "audio-codec".
> 
> To keep backward compatibility with other DTs, support for
> "spdif-controller", "spdif-in" and "spdif-out" properties is kept.
> However, it is recommended to use the new properties if possible.
> It is better to declare transmitter and/or receiver
> in DT than using the dummy codec.
> 
> DTs using compatible "fsl,imx-audio-spdif" are still supported, and
> fsl-asoc-card will behave the same as imx-spdif for these DTs.
> 
> Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
> ---
>  .../bindings/sound/fsl,imx-audio-spdif.yaml   | 66 -------------------
>  .../bindings/sound/fsl-asoc-card.yaml         | 53 +++++++++++++--
>  2 files changed, 49 insertions(+), 70 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/sound/fsl,imx-audio-spdif.yaml
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/fsl,imx-audio-spdif.yaml b/Documentation/devicetree/bindings/sound/fsl,imx-audio-spdif.yaml
deleted file mode 100644
index 5fc543d02ecb..000000000000
--- a/Documentation/devicetree/bindings/sound/fsl,imx-audio-spdif.yaml
+++ /dev/null
@@ -1,66 +0,0 @@ 
-# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
-%YAML 1.2
----
-$id: http://devicetree.org/schemas/sound/fsl,imx-audio-spdif.yaml#
-$schema: http://devicetree.org/meta-schemas/core.yaml#
-
-title: Freescale i.MX audio complex with S/PDIF transceiver
-
-maintainers:
-  - Shengjiu Wang <shengjiu.wang@nxp.com>
-
-properties:
-  compatible:
-    oneOf:
-      - items:
-          - enum:
-              - fsl,imx-sabreauto-spdif
-              - fsl,imx6sx-sdb-spdif
-          - const: fsl,imx-audio-spdif
-      - enum:
-          - fsl,imx-audio-spdif
-
-  model:
-    $ref: /schemas/types.yaml#/definitions/string
-    description: User specified audio sound card name
-
-  spdif-controller:
-    $ref: /schemas/types.yaml#/definitions/phandle
-    description: The phandle of the i.MX S/PDIF controller
-
-  spdif-out:
-    type: boolean
-    description:
-      If present, the transmitting function of S/PDIF will be enabled,
-      indicating there's a physical S/PDIF out connector or jack on the
-      board or it's connecting to some other IP block, such as an HDMI
-      encoder or display-controller.
-
-  spdif-in:
-    type: boolean
-    description:
-      If present, the receiving function of S/PDIF will be enabled,
-      indicating there is a physical S/PDIF in connector/jack on the board.
-
-required:
-  - compatible
-  - model
-  - spdif-controller
-
-anyOf:
-  - required:
-      - spdif-in
-  - required:
-      - spdif-out
-
-additionalProperties: false
-
-examples:
-  - |
-    sound-spdif {
-        compatible = "fsl,imx-audio-spdif";
-        model = "imx-spdif";
-        spdif-controller = <&spdif>;
-        spdif-out;
-        spdif-in;
-    };
diff --git a/Documentation/devicetree/bindings/sound/fsl-asoc-card.yaml b/Documentation/devicetree/bindings/sound/fsl-asoc-card.yaml
index 9922664d5ccc..92aa47ec72c7 100644
--- a/Documentation/devicetree/bindings/sound/fsl-asoc-card.yaml
+++ b/Documentation/devicetree/bindings/sound/fsl-asoc-card.yaml
@@ -65,6 +65,11 @@  properties:
               - fsl,imx-audio-sgtl5000
               - fsl,imx-audio-wm8960
               - fsl,imx-audio-wm8962
+      - items:
+          - enum:
+              - fsl,imx-sabreauto-spdif
+              - fsl,imx6sx-sdb-spdif
+          - const: fsl,imx-audio-spdif
       - items:
           - enum:
               - fsl,imx-audio-ac97
@@ -81,6 +86,7 @@  properties:
               - fsl,imx-audio-wm8960
               - fsl,imx-audio-wm8962
               - fsl,imx-audio-wm8958
+              - fsl,imx-audio-spdif
 
   model:
     $ref: /schemas/types.yaml#/definitions/string
@@ -93,8 +99,15 @@  properties:
       need to add ASRC support via DPCM.
 
   audio-codec:
-    $ref: /schemas/types.yaml#/definitions/phandle
-    description: The phandle of an audio codec
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description: |
+      The phandle of an audio codec.
+      With "fsl,imx-audio-spdif", either SPDIF audio codec spdif_transmitter,
+      spdif_receiver or both.
+    minItems: 1
+    maxItems: 2
+    items:
+      maxItems: 1
 
   audio-cpu:
     $ref: /schemas/types.yaml#/definitions/phandle
@@ -150,8 +163,10 @@  properties:
     description: dai-link uses bit clock inversion.
 
   mclk-id:
-    $ref: /schemas/types.yaml#/definitions/uint32
-    description: main clock id, specific for each card configuration.
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    description: Main clock id for each codec, specific for each card configuration.
+    minItems: 1
+    maxItems: 2
 
   mux-int-port:
     $ref: /schemas/types.yaml#/definitions/uint32
@@ -167,6 +182,27 @@  properties:
     $ref: /schemas/types.yaml#/definitions/phandle
     description: The phandle of an CPU DAI controller
 
+  spdif-controller:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    deprecated: true
+    description: The phandle of an S/PDIF CPU DAI controller.
+
+  spdif-out:
+    type: boolean
+    deprecated: true
+    description: |
+      If present, the transmitting function of S/PDIF will be enabled,
+      indicating there's a physical S/PDIF out connector or jack on the
+      board or it's connecting to some other IP block, such as an HDMI
+      encoder or display-controller.
+
+  spdif-in:
+    type: boolean
+    deprecated: true
+    description: |
+      If present, the receiving function of S/PDIF will be enabled,
+      indicating there is a physical S/PDIF in connector/jack on the board.
+
 required:
   - compatible
   - model
@@ -195,3 +231,12 @@  examples:
              "AIN2L", "Line In Jack",
              "AIN2R", "Line In Jack";
     };
+
+  - |
+    sound-spdif-asrc {
+        compatible = "fsl,imx-audio-spdif";
+        model = "spdif-asrc-audio";
+        audio-cpu = <&spdif>;
+        audio-asrc = <&easrc>;
+        audio-codec = <&spdifdit>, <&spdifdir>;
+    };