linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: imx8mm-beacon: Enable Digitial Microphone
@ 2022-07-17 18:09 Adam Ford
  2022-07-17 18:09 ` [PATCH 1/6] arm64: dts: imx8mn-beacon: " Adam Ford
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Adam Ford @ 2022-07-17 18:09 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Adam Ford, Rob Herring, Krzysztof Kozlowski, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Catalin Marinas, Will Deacon, devicetree,
	linux-kernel

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>;
+			};
+		};
+	};
 };
 
 &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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 1/6] arm64: dts: imx8mn-beacon: Enable Digitial Microphone
  2022-07-17 18:09 [PATCH] arm64: dts: imx8mm-beacon: Enable Digitial Microphone Adam Ford
@ 2022-07-17 18:09 ` Adam Ford
  2022-07-19  5:57   ` Ahmad Fatoum
  2022-07-17 18:09 ` [PATCH 2/6] arm64: dts: imx8mn-beacon: Enable SPDIF Sound card Adam Ford
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Adam Ford @ 2022-07-17 18:09 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Adam Ford, Rob Herring, Krzysztof Kozlowski, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Catalin Marinas, Will Deacon, devicetree,
	linux-kernel

There is a PDM microphone 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/imx8mn-beacon-baseboard.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi
index 9e82069c941f..fa66cc9bf455 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi
@@ -63,7 +63,7 @@ reg_usb_otg_vbus: regulator-usb {
 		enable-active-high;
 	};
 
-	sound {
+	sound-codec {
 		compatible = "fsl,imx-audio-wm8962";
 		model = "wm8962-audio";
 		audio-cpu = <&sai3>;
@@ -76,6 +76,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>;
+			};
+		};
+	};
 };
 
 &ecspi2 {
@@ -150,6 +162,16 @@ &easrc {
 	status = "okay";
 };
 
+&micfil {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_pdm>;
+	assigned-clocks = <&clk IMX8MN_CLK_PDM>;
+	assigned-clock-parents = <&clk IMX8MN_AUDIO_PLL1_OUT>;
+	assigned-clock-rates = <196608000>;
+	status = "okay";
+	#sound-dai-cells = <0>;
+};
+
 &sai3 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_sai3>;
@@ -232,6 +254,13 @@ MX8MN_IOMUXC_SAI2_MCLK_GPIO4_IO27		0x19
 		>;
 	};
 
+	pinctrl_pdm: pdmgrp {
+		fsl,pins = <
+			MX8MN_IOMUXC_SAI5_RXC_PDM_CLK	0xd6
+			MX8MN_IOMUXC_SAI5_RXD0_PDM_BIT_STREAM0	0xd6
+		>;
+	};
+
 	pinctrl_reg_usb_otg: reg-otggrp {
 		fsl,pins = <
 			MX8MN_IOMUXC_SAI3_RXC_GPIO4_IO29     0x19
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/6] arm64: dts: imx8mn-beacon: Enable SPDIF Sound card
  2022-07-17 18:09 [PATCH] arm64: dts: imx8mm-beacon: Enable Digitial Microphone Adam Ford
  2022-07-17 18:09 ` [PATCH 1/6] arm64: dts: imx8mn-beacon: " Adam Ford
@ 2022-07-17 18:09 ` Adam Ford
  2022-07-17 18:09 ` [PATCH 3/6] arm64: dts: Associate easrc to the audio CODEC Adam Ford
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Adam Ford @ 2022-07-17 18:09 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Adam Ford, Rob Herring, Krzysztof Kozlowski, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Catalin Marinas, Will Deacon, devicetree,
	linux-kernel

Add a sound card to support SPDIF since the imx8mn-beacon baseboard
can support it.

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

diff --git a/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi
index fa66cc9bf455..224845d24b64 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi
@@ -88,6 +88,14 @@ cpu {
 			};
 		};
 	};
+
+	sound-spdif {
+		compatible = "fsl,imx-audio-spdif";
+		model = "imx-spdif";
+		spdif-controller = <&spdif1>;
+		spdif-out;
+		spdif-in;
+	};
 };
 
 &ecspi2 {
@@ -186,6 +194,23 @@ &snvs_pwrkey {
 	status = "okay";
 };
 
+&spdif1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_spdif1>;
+	assigned-clocks = <&clk IMX8MN_CLK_SPDIF1>;
+	assigned-clock-parents = <&clk IMX8MN_AUDIO_PLL1_OUT>;
+	assigned-clock-rates = <24576000>;
+	clocks = <&clk IMX8MN_CLK_AUDIO_AHB>, <&clk IMX8MN_CLK_24M>,
+		<&clk IMX8MN_CLK_SPDIF1>, <&clk IMX8MN_CLK_DUMMY>,
+		<&clk IMX8MN_CLK_DUMMY>, <&clk IMX8MN_CLK_DUMMY>,
+		<&clk IMX8MN_CLK_AUDIO_AHB>, <&clk IMX8MN_CLK_DUMMY>,
+		<&clk IMX8MN_CLK_DUMMY>, <&clk IMX8MN_CLK_DUMMY>,
+		<&clk IMX8MN_AUDIO_PLL1_OUT>, <&clk IMX8MN_AUDIO_PLL2_OUT>;
+	clock-names = "core", "rxtx0", "rxtx1", "rxtx2", "rxtx3",
+		"rxtx4", "rxtx5", "rxtx6", "rxtx7", "spba", "pll8k", "pll11k";
+	status = "okay";
+};
+
 &uart2 { /* console */
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart2>;
@@ -277,6 +302,13 @@ MX8MN_IOMUXC_SAI3_RXD_SAI3_RX_DATA0	0xd6
 		>;
 	};
 
+	pinctrl_spdif1: spdif1grp {
+		fsl,pins = <
+			MX8MN_IOMUXC_SPDIF_TX_SPDIF1_OUT	0xd6
+			MX8MN_IOMUXC_SPDIF_RX_SPDIF1_IN	0xd6
+		>;
+	};
+
 	pinctrl_uart2: uart2grp {
 		fsl,pins = <
 			MX8MN_IOMUXC_UART2_RXD_UART2_DCE_RX	0x140
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/6] arm64: dts: Associate easrc to the audio CODEC
  2022-07-17 18:09 [PATCH] arm64: dts: imx8mm-beacon: Enable Digitial Microphone Adam Ford
  2022-07-17 18:09 ` [PATCH 1/6] arm64: dts: imx8mn-beacon: " Adam Ford
  2022-07-17 18:09 ` [PATCH 2/6] arm64: dts: imx8mn-beacon: Enable SPDIF Sound card Adam Ford
@ 2022-07-17 18:09 ` Adam Ford
  2022-07-17 18:09 ` [PATCH 4/6] arm64: dts: imx8mm-beacon: Enable Digitial Microphone Adam Ford
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Adam Ford @ 2022-07-17 18:09 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Adam Ford, Rob Herring, Krzysztof Kozlowski, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Catalin Marinas, Will Deacon, devicetree,
	linux-kernel

There is a wm8962 Audio codec already enabled, and the
EASRC is also enabled, but there is nothing connecting them to each
other. Set audio-asrc to point to easrc.

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

diff --git a/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi b/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi
index 224845d24b64..f31ba1101a1d 100644
--- a/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mn-beacon-baseboard.dtsi
@@ -67,6 +67,7 @@ sound-codec {
 		compatible = "fsl,imx-audio-wm8962";
 		model = "wm8962-audio";
 		audio-cpu = <&sai3>;
+		audio-asrc = <&easrc>;
 		audio-codec = <&wm8962>;
 		audio-routing =
 			"Headphone Jack", "HPOUTL",
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/6] arm64: dts: imx8mm-beacon: Enable Digitial Microphone
  2022-07-17 18:09 [PATCH] arm64: dts: imx8mm-beacon: Enable Digitial Microphone Adam Ford
                   ` (2 preceding siblings ...)
  2022-07-17 18:09 ` [PATCH 3/6] arm64: dts: Associate easrc to the audio CODEC Adam Ford
@ 2022-07-17 18:09 ` Adam Ford
  2022-07-18  5:37   ` Sascha Hauer
  2022-07-17 18:09 ` [PATCH 5/6] arm64: dts: imx8mm-beacon: Enable SPDIF Sound card Adam Ford
  2022-07-17 18:10 ` [PATCH 6/6] arm64: defconfig: Enable imx-audio-card Adam Ford
  5 siblings, 1 reply; 12+ messages in thread
From: Adam Ford @ 2022-07-17 18:09 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Adam Ford, Rob Herring, Krzysztof Kozlowski, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Catalin Marinas, Will Deacon, devicetree,
	linux-kernel

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>;
+			};
+		};
+	};
 };
 
 &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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/6] arm64: dts: imx8mm-beacon: Enable SPDIF Sound card
  2022-07-17 18:09 [PATCH] arm64: dts: imx8mm-beacon: Enable Digitial Microphone Adam Ford
                   ` (3 preceding siblings ...)
  2022-07-17 18:09 ` [PATCH 4/6] arm64: dts: imx8mm-beacon: Enable Digitial Microphone Adam Ford
@ 2022-07-17 18:09 ` Adam Ford
  2022-07-17 18:10 ` [PATCH 6/6] arm64: defconfig: Enable imx-audio-card Adam Ford
  5 siblings, 0 replies; 12+ messages in thread
From: Adam Ford @ 2022-07-17 18:09 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Adam Ford, Rob Herring, Krzysztof Kozlowski, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Catalin Marinas, Will Deacon, devicetree,
	linux-kernel

Add a sound card to support SPDIF since the imx8mn-beacon baseboard
can support it.

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 16444954f873..c41359c74c50 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
@@ -123,6 +123,14 @@ cpu {
 			};
 		};
 	};
+
+	sound-spdif {
+		compatible = "fsl,imx-audio-spdif";
+		model = "imx-spdif";
+		spdif-controller = <&spdif1>;
+		spdif-out;
+		spdif-in;
+	};
 };
 
 &csi {
@@ -289,6 +297,23 @@ &snvs_pwrkey {
 	status = "okay";
 };
 
+&spdif1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_spdif1>;
+	assigned-clocks = <&clk IMX8MM_CLK_SPDIF1>;
+	assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
+	assigned-clock-rates = <24576000>;
+	clocks = <&clk IMX8MM_CLK_AUDIO_AHB>, <&clk IMX8MM_CLK_24M>,
+		<&clk IMX8MM_CLK_SPDIF1>, <&clk IMX8MM_CLK_DUMMY>,
+		<&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>,
+		<&clk IMX8MM_CLK_AUDIO_AHB>, <&clk IMX8MM_CLK_DUMMY>,
+		<&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>,
+		<&clk IMX8MM_AUDIO_PLL1_OUT>, <&clk IMX8MM_AUDIO_PLL2_OUT>;
+	clock-names = "core", "rxtx0", "rxtx1", "rxtx2", "rxtx3",
+		"rxtx4", "rxtx5", "rxtx6", "rxtx7", "spba", "pll8k", "pll11k";
+	status = "okay";
+};
+
 &uart2 { /* console */
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart2>;
@@ -405,6 +430,14 @@ MX8MM_IOMUXC_SAI3_RXD_SAI3_RX_DATA0	0xd6
 		>;
 	};
 
+	pinctrl_spdif1: spdif1grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_SPDIF_TX_SPDIF1_OUT	0xd6
+			MX8MM_IOMUXC_SPDIF_RX_SPDIF1_IN		0xd6
+			MX8MM_IOMUXC_SPDIF_EXT_CLK_SPDIF1_EXT_CLK	0xd6
+		>;
+	};
+
 	pinctrl_uart2: uart2grp {
 		fsl,pins = <
 			MX8MM_IOMUXC_UART2_RXD_UART2_DCE_RX	0x140
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 6/6] arm64: defconfig: Enable imx-audio-card
  2022-07-17 18:09 [PATCH] arm64: dts: imx8mm-beacon: Enable Digitial Microphone Adam Ford
                   ` (4 preceding siblings ...)
  2022-07-17 18:09 ` [PATCH 5/6] arm64: dts: imx8mm-beacon: Enable SPDIF Sound card Adam Ford
@ 2022-07-17 18:10 ` Adam Ford
  5 siblings, 0 replies; 12+ messages in thread
From: Adam Ford @ 2022-07-17 18:10 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Adam Ford, Rob Herring, Krzysztof Kozlowski, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Catalin Marinas, Will Deacon, devicetree,
	linux-kernel

Both the imx8mm-beacon and imx8mn-beacon kits have a PDM microphone
port. The PDM is used with micfil driver, and that is associated to
imx-audio-card, but that is not currently enabled by default.  Enable it
as a module.

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

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index d3ad1cb2f5eb..2a824590811b 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -792,6 +792,7 @@ CONFIG_SND_SOC_IMX_SGTL5000=m
 CONFIG_SND_SOC_IMX_SPDIF=m
 CONFIG_SND_SOC_FSL_ASOC_CARD=m
 CONFIG_SND_SOC_IMX_AUDMIX=m
+CONFIG_SND_SOC_IMX_CARD=m
 CONFIG_SND_MESON_AXG_SOUND_CARD=m
 CONFIG_SND_MESON_GX_SOUND_CARD=m
 CONFIG_SND_SOC_QCOM=m
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/6] arm64: dts: imx8mm-beacon: Enable Digitial Microphone
  2022-07-17 18:09 ` [PATCH 4/6] arm64: dts: imx8mm-beacon: Enable Digitial Microphone Adam Ford
@ 2022-07-18  5:37   ` Sascha Hauer
  2022-07-18 15:44     ` Adam Ford
  2023-03-02 13:28     ` Adam Ford
  0 siblings, 2 replies; 12+ messages in thread
From: Sascha Hauer @ 2022-07-18  5:37 UTC (permalink / raw)
  To: Adam Ford
  Cc: linux-arm-kernel, Rob Herring, Krzysztof Kozlowski, Shawn Guo,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Catalin Marinas, Will Deacon, devicetree, linux-kernel

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

-- 
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 |

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/6] arm64: dts: imx8mm-beacon: Enable Digitial Microphone
  2022-07-18  5:37   ` Sascha Hauer
@ 2022-07-18 15:44     ` Adam Ford
  2023-03-02 13:28     ` Adam Ford
  1 sibling, 0 replies; 12+ messages in thread
From: Adam Ford @ 2022-07-18 15:44 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: arm-soc, Rob Herring, Krzysztof Kozlowski, Shawn Guo,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Catalin Marinas, Will Deacon, devicetree,
	Linux Kernel Mailing List

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 |

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/6] arm64: dts: imx8mn-beacon: Enable Digitial Microphone
  2022-07-17 18:09 ` [PATCH 1/6] arm64: dts: imx8mn-beacon: " Adam Ford
@ 2022-07-19  5:57   ` Ahmad Fatoum
  2022-07-19 19:17     ` Adam Ford
  0 siblings, 1 reply; 12+ messages in thread
From: Ahmad Fatoum @ 2022-07-19  5:57 UTC (permalink / raw)
  To: Adam Ford, linux-arm-kernel
  Cc: devicetree, Fabio Estevam, Krzysztof Kozlowski, Will Deacon,
	Sascha Hauer, linux-kernel, Rob Herring, NXP Linux Team,
	Pengutronix Kernel Team, Catalin Marinas, Shawn Guo

Hello Adam,

On 17.07.22 20:09, Adam Ford wrote:
> +
> +	sound-micfil {
> +		compatible = "fsl,imx-audio-card";
> +		model = "imx-audio-micfil";
> +		pri-dai-link {
> +			link-name = "micfil hifi";
> +			format = "i2s";

Given that MICFIL and mic speak PDM with each other,
is i2s the correct format here?

Cheers,
Ahmad

-- 
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 |

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/6] arm64: dts: imx8mn-beacon: Enable Digitial Microphone
  2022-07-19  5:57   ` Ahmad Fatoum
@ 2022-07-19 19:17     ` Adam Ford
  0 siblings, 0 replies; 12+ messages in thread
From: Adam Ford @ 2022-07-19 19:17 UTC (permalink / raw)
  To: Ahmad Fatoum
  Cc: arm-soc, devicetree, Fabio Estevam, Krzysztof Kozlowski,
	Will Deacon, Sascha Hauer, Linux Kernel Mailing List,
	Rob Herring, NXP Linux Team, Pengutronix Kernel Team,
	Catalin Marinas, Shawn Guo

On Tue, Jul 19, 2022 at 12:57 AM Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>
> Hello Adam,
>
> On 17.07.22 20:09, Adam Ford wrote:
> > +
> > +     sound-micfil {
> > +             compatible = "fsl,imx-audio-card";
> > +             model = "imx-audio-micfil";
> > +             pri-dai-link {
> > +                     link-name = "micfil hifi";
> > +                     format = "i2s";
>
> Given that MICFIL and mic speak PDM with each other,
> is i2s the correct format here?

I was basing this off some references from some NXP stuff in their
downstream kernel.  I know the audio I record with the PDM microphone
worked and sounded like I expected when I tested it.

adam

>
> Cheers,
> Ahmad
>
> --
> 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 |

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/6] arm64: dts: imx8mm-beacon: Enable Digitial Microphone
  2022-07-18  5:37   ` Sascha Hauer
  2022-07-18 15:44     ` Adam Ford
@ 2023-03-02 13:28     ` Adam Ford
  1 sibling, 0 replies; 12+ messages in thread
From: Adam Ford @ 2023-03-02 13:28 UTC (permalink / raw)
  To: Sascha Hauer
  Cc: linux-arm-kernel, Rob Herring, Krzysztof Kozlowski, Shawn Guo,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Catalin Marinas, Will Deacon, devicetree, linux-kernel

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.

Sascha,

Sorry to resurrect an old thread.

I tried using the simple-audio-card, but it doesn't present me with an
audio card.  I don't get errors, but I don't get a card either.  Can
you point me to an example where someone did this?  I added debug code
to the simple-audio-card and I migrated an existing card, and I see
the debug code for the wm8962 CODEC, but not the micfil.  The Micfil
works just fine with the imx-audio-card, but I don't mind using the
simple-audio-card if it makes more sense.

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 |

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-03-02 13:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-17 18:09 [PATCH] arm64: dts: imx8mm-beacon: Enable Digitial Microphone Adam Ford
2022-07-17 18:09 ` [PATCH 1/6] arm64: dts: imx8mn-beacon: " Adam Ford
2022-07-19  5:57   ` Ahmad Fatoum
2022-07-19 19:17     ` Adam Ford
2022-07-17 18:09 ` [PATCH 2/6] arm64: dts: imx8mn-beacon: Enable SPDIF Sound card Adam Ford
2022-07-17 18:09 ` [PATCH 3/6] arm64: dts: Associate easrc to the audio CODEC Adam Ford
2022-07-17 18:09 ` [PATCH 4/6] arm64: dts: imx8mm-beacon: Enable Digitial Microphone Adam Ford
2022-07-18  5:37   ` Sascha Hauer
2022-07-18 15:44     ` Adam Ford
2023-03-02 13:28     ` Adam Ford
2022-07-17 18:09 ` [PATCH 5/6] arm64: dts: imx8mm-beacon: Enable SPDIF Sound card Adam Ford
2022-07-17 18:10 ` [PATCH 6/6] arm64: defconfig: Enable imx-audio-card Adam Ford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).