diff mbox series

[1/4] arm64: dts: imx8mm-beacon: Migrate sound card to simple-audio-card

Message ID 20230831115128.254226-1-aford173@gmail.com
State Superseded
Headers show
Series [1/4] arm64: dts: imx8mm-beacon: Migrate sound card to simple-audio-card | expand

Commit Message

Adam Ford Aug. 31, 2023, 11:51 a.m. UTC
Instead of using a custom glue layer connecting the wm8962 CODEC
to the SAI3 sound-dai, migrate the sound card to simple-audio-card.
This also brings this board in line with the imx8mn-beacon and
imx8mp-beacon.

Signed-off-by: Adam Ford <aford173@gmail.com>

Comments

Shawn Guo Sept. 25, 2023, 1:14 a.m. UTC | #1
On Thu, Aug 31, 2023 at 06:51:26AM -0500, Adam Ford wrote:
> The baseboard has a connector for a pulse density microphone.
> This is connected via the micfil interface and uses the DMIC
> audio codec with the simple-audio-card.
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
> index 313e93663d6f..d0dd4c81a557 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
> @@ -6,6 +6,13 @@
>  #include <dt-bindings/phy/phy-imx8-pcie.h>
>  
>  / {
> +
> +	dmic_codec: dmic-codec {
> +		compatible = "dmic-codec";
> +		num-channels = <1>;
> +		#sound-dai-cells = <0>;
> +	};
> +
>  	leds {
>  		compatible = "gpio-leds";
>  
> @@ -98,6 +105,22 @@ reg_usdhc2_vmmc: regulator-usdhc2 {
>  		enable-active-high;
>  	};
>  
> +	sound-dmic {
> +		compatible = "simple-audio-card";
> +		simple-audio-card,name = "dmic";
> +		simple-audio-card,format = "pdm";
> +		simple-audio-card,bitclock-master = <&dailink_master>;
> +		simple-audio-card,frame-master = <&dailink_master>;
> +
> +		dailink_master: simple-audio-card,cpu {
> +			sound-dai = <&micfil>;
> +		};
> +
> +		simple-audio-card,codec {
> +			sound-dai = <&dmic_codec>;
> +		};
> +	};
> +
>  	sound-wm8962 {
>  		compatible = "simple-audio-card";
>  		simple-audio-card,name = "wm8962";
> @@ -228,6 +251,16 @@ pca6416_1: gpio@21 {
>  	};
>  };
>  
> +&micfil {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_pdm>;
> +	assigned-clocks = <&clk IMX8MM_CLK_PDM>;
> +	assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
> +	assigned-clock-rates = <49152000>;
> +	status = "okay";

We usually end property list with 'status'.

Shawn

> +	#sound-dai-cells = <0>;
> +};
> +
>  &mipi_csi {
>  	status = "okay";
>  	ports {
> @@ -365,6 +398,13 @@ MX8MM_IOMUXC_SAI2_MCLK_GPIO4_IO27		0x19
>  		>;
>  	};
>  
> +	pinctrl_pdm: pdmgrp {
> +		fsl,pins = <
> +			MX8MM_IOMUXC_SAI5_RXC_PDM_CLK	0xd6
> +			MX8MM_IOMUXC_SAI5_RXD0_PDM_DATA0	0xd6
> +		>;
> +	};
> +
>  	pinctrl_reg_usb_otg1: usbotg1grp {
>  		fsl,pins = <
>  			MX8MM_IOMUXC_SAI3_RXC_GPIO4_IO29     0x19
> -- 
> 2.39.2
>
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
index b10e2a703a44..313e93663d6f 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
@@ -98,18 +98,30 @@  reg_usdhc2_vmmc: regulator-usdhc2 {
 		enable-active-high;
 	};
 
-	sound {
-		compatible = "fsl,imx-audio-wm8962";
-		model = "wm8962-audio";
-		audio-cpu = <&sai3>;
-		audio-codec = <&wm8962>;
-		audio-routing =
-			"Headphone Jack", "HPOUTL",
-			"Headphone Jack", "HPOUTR",
-			"Ext Spk", "SPKOUTL",
-			"Ext Spk", "SPKOUTR",
-			"AMIC", "MICBIAS",
-			"IN3R", "AMIC";
+	sound-wm8962 {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "wm8962";
+		simple-audio-card,format = "i2s";
+		simple-audio-card,widgets = "Headphone", "Headphones",
+					    "Microphone", "Headset Mic",
+					    "Speaker", "Speaker";
+		simple-audio-card,routing = "Headphones", "HPOUTL",
+					    "Headphones", "HPOUTR",
+					    "Speaker", "SPKOUTL",
+					    "Speaker", "SPKOUTR",
+					    "Headset Mic", "MICBIAS",
+					    "IN3R", "Headset Mic";
+
+		simple-audio-card,cpu {
+			sound-dai = <&sai3>;
+		};
+
+		simple-audio-card,codec {
+			sound-dai = <&wm8962>;
+			clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;
+			frame-master;
+			bitclock-master;
+		};
 	};
 };
 
@@ -192,6 +204,7 @@  wm8962: audio-codec@1a {
 			0x0000 /* 4:FN_DMICCDAT */
 			0x0000 /* 5:Default */
 		>;
+		#sound-dai-cells = <0>;
 	};
 
 	pca6416_0: gpio@20 {