lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zq+QrxKFb3U1IEv/@dragon>
Date: Sun, 4 Aug 2024 22:31:11 +0800
From: Shawn Guo <shawnguo2@...h.net>
To: Elinor Montmasson <elinor.montmasson@...oirfairelinux.com>
Cc: Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>, Shawn Guo <shawnguo@...nel.org>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Fabio Estevam <festevam@...il.com>,
	Russell King <linux@...linux.org.uk>,
	Catalin Marinas <catalin.marinas@....com>,
	Will Deacon <will@...nel.org>, Jaroslav Kysela <perex@...ex.cz>,
	Takashi Iwai <tiwai@...e.com>,
	Shengjiu Wang <shengjiu.wang@...il.com>,
	Xiubo Li <Xiubo.Lee@...il.com>,
	Nicolin Chen <nicoleotsuka@...il.com>,
	Pengutronix Kernel Team <kernel@...gutronix.de>,
	linux-sound@...r.kernel.org, devicetree@...r.kernel.org,
	imx@...ts.linux.dev, linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org, alsa-devel@...a-project.org,
	linuxppc-dev@...ts.ozlabs.org,
	Philip-Dylan <philip-dylan.gleonec@...oirfairelinux.com>
Subject: Re: [PATCH v6 6/7] arm64: dts: imx8m: update spdif sound card node
 properties

On Thu, Jun 27, 2024 at 10:31:03AM +0200, Elinor Montmasson wrote:
> 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@...oirfairelinux.com>
> ---
>  arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi | 15 +++++++++---
>  arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi | 15 +++++++++---
>  arch/arm64/boot/dts/freescale/imx8mq-evk.dts  | 24 +++++++++++++++----
>  3 files changed, 43 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
> index 90d1901df2b1..348855a41852 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi
> @@ -180,12 +180,21 @@ cpu {
>  		};
>  	};
>  
> +	spdif_out: spdif-out {
> +		#sound-dai-cells = <0>;
> +		compatible = "linux,spdif-dit";

It's recommended that the property list begins with 'compatible'.  Could
you flip them?

Shawn

> +	};
> +
> +	spdif_in: spdif-in {
> +		#sound-dai-cells = <0>;
> +		compatible = "linux,spdif-dir";
> +	};
> +
>  	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>;
>  	};
>  };
>  
> diff --git a/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
> index 9e0259ddf4bc..6a47e09703a7 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mn-evk.dtsi
> @@ -124,12 +124,21 @@ sound-wm8524 {
>  			"Line Out Jack", "LINEVOUTR";
>  	};
>  
> +	spdif_out: spdif-out {
> +		#sound-dai-cells = <0>;
> +		compatible = "linux,spdif-dit";
> +	};
> +
> +	spdif_in: spdif-in {
> +		#sound-dai-cells = <0>;
> +		compatible = "linux,spdif-dir";
> +	};
> +
>  	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 {
> diff --git a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
> index 7507548cdb16..b953865f0b46 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mq-evk.dts
> @@ -125,19 +125,33 @@ link_codec: simple-audio-card,codec {
>  		};
>  	};
>  
> +	spdif_out: spdif-out {
> +		#sound-dai-cells = <0>;
> +		compatible = "linux,spdif-dit";
> +	};
> +
> +	spdif_in: spdif-in {
> +		#sound-dai-cells = <0>;
> +		compatible = "linux,spdif-dir";
> +	};
> +
>  	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 {
> +		#sound-dai-cells = <0>;
> +		compatible = "linux,spdif-dir";
>  	};
>  
>  	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>;
>  	};
>  };
>  
> -- 
> 2.34.1
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ