arm64: dts: imx8m: update spdif sound card node properties
authorElinor Montmasson <elinor.montmasson@savoirfairelinux.com>
Tue, 20 Aug 2024 11:28:26 +0000 (13:28 +0200)
committerShawn Guo <shawnguo@kernel.org>
Wed, 4 Sep 2024 09:36:22 +0000 (17:36 +0800)
The merge of imx-spdif driver into fsl-asoc-card brought
new DT properties that can be used with the "fsl,imx-audio-spdif"
compatible:
* 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 S/PDIF, 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".

While backward compatibility is kept to support properties
"spdif-controller", "spdif-in" and "spdif-out", using new properties has
several benefits:
* "audio-cpu" and "audio-codec" are more generic names reflecting
  that the fsl-asoc-card driver supports multiple hardware.
  They are properties already used by devices using the
  fsl-asoc-card driver.
  They are also similar to properties of simple-card: "cpu" and "codec".
* "spdif-in" and "spdif-out" imply the use of the dummy codec in the
  driver. However, there are already two codec drivers for the S/PDIF,
  spdif_transmitter and spdif_receiver.
  It is better to declare S/PDIF Tx and Rx devices in a DT, and then
  reference them with "audio-codec" than using the dummy codec.

For those reasons, this commit updates in-tree DTs to use the new
properties:
* Rename "spdif-controller" property to "audio-cpu".
* Declare S/PDIF transmitter and/or receiver devices, and use them with
  the "audio-codec" property instead of "spdif-out" and/or "spdif-in".

These modifications were tested only on an imx8mn-evk board.

Note that out-of-tree and old DTs are still supported.

Signed-off-by: Elinor Montmasson <elinor.montmasson@savoirfairelinux.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
arch/arm64/boot/dts/freescale/imx8mq-evk.dts

index 930e14fec42370e1be2c05f60c044bc984214ea4..5f8336217bb88b1d0501e6208c936c51ce23b312 100644 (file)
                };
        };
 
+       spdif_out: spdif-out {
+               compatible = "linux,spdif-dit";
+               #sound-dai-cells = <0>;
+       };
+
+       spdif_in: spdif-in {
+               compatible = "linux,spdif-dir";
+               #sound-dai-cells = <0>;
+       };
+
        sound-spdif {
                compatible = "fsl,imx-audio-spdif";
                model = "imx-spdif";
-               spdif-controller = <&spdif1>;
-               spdif-out;
-               spdif-in;
+               audio-cpu = <&spdif1>;
+               audio-codec = <&spdif_out>, <&spdif_in>;
        };
 };
 
index 9e0259ddf4bca36966010bbcee0d7b06400e1c59..33d73f3dc18759295207fae76d67100387b86461 100644 (file)
                        "Line Out Jack", "LINEVOUTR";
        };
 
+       spdif_out: spdif-out {
+               compatible = "linux,spdif-dit";
+               #sound-dai-cells = <0>;
+       };
+
+       spdif_in: spdif-in {
+               compatible = "linux,spdif-dir";
+               #sound-dai-cells = <0>;
+       };
+
        sound-spdif {
                compatible = "fsl,imx-audio-spdif";
                model = "imx-spdif";
-               spdif-controller = <&spdif1>;
-               spdif-out;
-               spdif-in;
+               audio-cpu = <&spdif1>;
+               audio-codec = <&spdif_out>, <&spdif_in>;
        };
 
        sound-micfil {
index 7507548cdb16bbd87b8e64f98461379e6e257037..a87d0692c3bb372f77c04d5190e3741f93a142ec 100644 (file)
                };
        };
 
+       spdif_out: spdif-out {
+               compatible = "linux,spdif-dit";
+               #sound-dai-cells = <0>;
+       };
+
+       spdif_in: spdif-in {
+               compatible = "linux,spdif-dir";
+               #sound-dai-cells = <0>;
+       };
+
        sound-spdif {
                compatible = "fsl,imx-audio-spdif";
                model = "imx-spdif";
-               spdif-controller = <&spdif1>;
-               spdif-out;
-               spdif-in;
+               audio-cpu = <&spdif1>;
+               audio-codec = <&spdif_out>, <&spdif_in>;
+       };
+
+       hdmi_arc_in: hdmi-arc-in {
+               compatible = "linux,spdif-dir";
+               #sound-dai-cells = <0>;
        };
 
        sound-hdmi-arc {
                compatible = "fsl,imx-audio-spdif";
                model = "imx-hdmi-arc";
-               spdif-controller = <&spdif2>;
-               spdif-in;
+               audio-cpu = <&spdif2>;
+               audio-codec = <&hdmi_arc_in>;
        };
 };