diff mbox series

[4/6] arm64: dts: imx8mm-beacon: Enable Digitial Microphone

Message ID 20220717181000.1186373-5-aford173@gmail.com (mailing list archive)
State New, archived
Headers show
Series arm64: dts: imx8mm-beacon: Enable Digitial Microphone | expand

Commit Message

Adam Ford July 17, 2022, 6:09 p.m. UTC
There is a PDM microphone port on the baseboard which is connected to the
micfil controller.  Create a new sound card to support this interface.

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

Comments

Sascha Hauer July 18, 2022, 5:37 a.m. UTC | #1
Hi Adam,

On Sun, Jul 17, 2022 at 01:09:58PM -0500, Adam Ford wrote:
> There is a PDM microphone port on the baseboard which is connected to the
> micfil controller.  Create a new sound card to support this interface.
> 
> 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 03266bd90a06..16444954f873 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
> @@ -98,7 +98,7 @@ reg_usdhc2_vmmc: regulator-usdhc2 {
>  		enable-active-high;
>  	};
>  
> -	sound {
> +	sound-codec {
>  		compatible = "fsl,imx-audio-wm8962";
>  		model = "wm8962-audio";
>  		audio-cpu = <&sai3>;
> @@ -111,6 +111,18 @@ sound {
>  			"AMIC", "MICBIAS",
>  			"IN3R", "AMIC";
>  	};
> +
> +	sound-micfil {
> +		compatible = "fsl,imx-audio-card";
> +		model = "imx-audio-micfil";
> +		pri-dai-link {
> +			link-name = "micfil hifi";
> +			format = "i2s";
> +			cpu {
> +				sound-dai = <&micfil>;
> +			};
> +		};
> +	};

Note the micfil works well with the simple-audio-card driver which might
be an alternative here.

Sascha
Adam Ford July 18, 2022, 3:44 p.m. UTC | #2
On Mon, Jul 18, 2022 at 12:37 AM Sascha Hauer <s.hauer@pengutronix.de> wrote:
>
> Hi Adam,
>
> On Sun, Jul 17, 2022 at 01:09:58PM -0500, Adam Ford wrote:
> > There is a PDM microphone port on the baseboard which is connected to the
> > micfil controller.  Create a new sound card to support this interface.
> >
> > 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 03266bd90a06..16444954f873 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
> > @@ -98,7 +98,7 @@ reg_usdhc2_vmmc: regulator-usdhc2 {
> >               enable-active-high;
> >       };
> >
> > -     sound {
> > +     sound-codec {
> >               compatible = "fsl,imx-audio-wm8962";
> >               model = "wm8962-audio";
> >               audio-cpu = <&sai3>;
> > @@ -111,6 +111,18 @@ sound {
> >                       "AMIC", "MICBIAS",
> >                       "IN3R", "AMIC";
> >       };
> > +
> > +     sound-micfil {
> > +             compatible = "fsl,imx-audio-card";
> > +             model = "imx-audio-micfil";
> > +             pri-dai-link {
> > +                     link-name = "micfil hifi";
> > +                     format = "i2s";
> > +                     cpu {
> > +                             sound-dai = <&micfil>;
> > +                     };
> > +             };
> > +     };
>
> Note the micfil works well with the simple-audio-card driver which might
> be an alternative here.

I'll respin it with that and try it.  If it works we should be able to
drop the last patch enabling the imx-audio-card module.

adam
>
> Sascha
>
> --
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
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 03266bd90a06..16444954f873 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
@@ -98,7 +98,7 @@  reg_usdhc2_vmmc: regulator-usdhc2 {
 		enable-active-high;
 	};
 
-	sound {
+	sound-codec {
 		compatible = "fsl,imx-audio-wm8962";
 		model = "wm8962-audio";
 		audio-cpu = <&sai3>;
@@ -111,6 +111,18 @@  sound {
 			"AMIC", "MICBIAS",
 			"IN3R", "AMIC";
 	};
+
+	sound-micfil {
+		compatible = "fsl,imx-audio-card";
+		model = "imx-audio-micfil";
+		pri-dai-link {
+			link-name = "micfil hifi";
+			format = "i2s";
+			cpu {
+				sound-dai = <&micfil>;
+			};
+		};
+	};
 };
 
 &csi {
@@ -215,6 +227,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 = <196608000>;
+	#sound-dai-cells = <0>;
+	status = "okay";
+};
+
 &mipi_csi {
 	status = "okay";
 	ports {
@@ -354,6 +376,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