Skip to contentSkip to conversation

arm64: dts: imx8mm: Add support for micfil

PATCH Superseded Adam Ford 3 participants 7 messages Oct 8, 2020 – Oct 19, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH 1/3 arm64: dts: imx8mm: Add support for micfil

The i.MX8M Mini has supports the MICFIL digital interface. It's a 16-bit audio signal from a PDM microphone bitstream. The driver is already in the kernel, but the node is missing.

This patch adds the micfil node.

arch/arm64/boot/dts/freescale/imx8mm.dtsi +19 -0
index b83f400def8b..fad1f9cdb241 100644
@@ -339,6 +339,25 @@ sai6: sai@30060000 {
 				status = "disabled";
 			};
 
+			micfil: audio-controller@30080000 {
+				compatible = "fsl,imx8mm-micfil";
+				reg = <0x30080000 0x10000>;
+				interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
+					     <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>,
+					     <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>,
+					     <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clk IMX8MM_CLK_PDM_IPG>,
+					 <&clk IMX8MM_CLK_PDM_ROOT>,
+					 <&clk IMX8MM_AUDIO_PLL1_OUT>,
+					 <&clk IMX8MM_AUDIO_PLL2_OUT>,
+					 <&clk IMX8MM_CLK_EXT3>;
+				clock-names = "ipg_clk", "ipg_clk_app",
+					      "pll8k", "pll11k", "clkext3";
+				dmas = <&sdma2 24 25 0x80000000>;
+				dma-names = "rx";
+				status = "disabled";
+			};
+
 			gpio1: gpio@30200000 {
 				compatible = "fsl,imx8mm-gpio", "fsl,imx35-gpio";
 				reg = <0x30200000 0x10000>;
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 2/3 arm64: dts: imx8mm: Add node for SPDIF

The i.MX8M Mini can support SPIDF which is very similar to the IP used on the i.MX35.

This patch adds the SPIF node.

arch/arm64/boot/dts/freescale/imx8mm.dtsi +24 -0
index fad1f9cdb241..44a59f59f65a 100644
@@ -358,6 +358,30 @@ micfil: audio-controller@30080000 {
 				status = "disabled";
 			};
 
+			spdif1: spdif@30090000 {
+				compatible = "fsl,imx8mm-spdif", "fsl,imx35-spdif";
+				reg = <0x30090000 0x10000>;
+				interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clk IMX8MM_CLK_AUDIO_AHB>, /* core */
+					 <&clk IMX8MM_CLK_24M>, /* rxtx0 */
+					 <&clk IMX8MM_CLK_SPDIF1>, /* rxtx1 */
+					 <&clk IMX8MM_CLK_DUMMY>, /* rxtx2 */
+					 <&clk IMX8MM_CLK_DUMMY>, /* rxtx3 */
+					 <&clk IMX8MM_CLK_DUMMY>, /* rxtx4 */
+					 <&clk IMX8MM_CLK_AUDIO_AHB>, /* rxtx5 */
+					 <&clk IMX8MM_CLK_DUMMY>, /* rxtx6 */
+					 <&clk IMX8MM_CLK_DUMMY>, /* rxtx7 */
+					 <&clk IMX8MM_CLK_DUMMY>; /* spba */
+				clock-names = "core", "rxtx0",
+					      "rxtx1", "rxtx2",
+					      "rxtx3", "rxtx4",
+					      "rxtx5", "rxtx6",
+					      "rxtx7", "spba";
+				dmas = <&sdma2 28 18 0>, <&sdma2 29 18 0>;
+				dma-names = "rx", "tx";
+				status = "disabled";
+			};
+
 			gpio1: gpio@30200000 {
 				compatible = "fsl,imx8mm-gpio", "fsl,imx35-gpio";
 				reg = <0x30200000 0x10000>;
Signature · 1 line
2.25.1
#2 lore raw

Re: [PATCH 2/3] arm64: dts: imx8mm: Add node for SPDIF

Quoted 1 line · Adam Ford

The i.MX8M Mini can support SPIDF which is very similar to the

SPIDF -> SPDIF

Quoted 3 lines

IP used on the i.MX35.

This patch adds the SPIF node.

Just "Add the SPDIF node", avoid "this patch". And SPIF->SPDIF.

arch/arm64/boot/dts/freescale/imx8mm.dtsi micfil: audio-controller@30080000 { · line 362

Quoted 13 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +2 -0
index fad1f9cdb241..44a59f59f65a 100644
@@ -358,6 +358,30 @@ micfil: audio-controller@30080000 {
 				status = "disabled";
 			};
 
+			spdif1: spdif@30090000 {
+				compatible = "fsl,imx8mm-spdif", "fsl,imx35-spdif";

This does not pass the dtschema validation, so only "fsl,imx35-spdif".

Best regards,
Krzysztof

reviewer
#3 lore raw

Re: [PATCH 2/3] arm64: dts: imx8mm: Add node for SPDIF

Hi Krzysztof,

Quoted 4 lines · Krzysztof Kozlowski

arch/arm64/boot/dts/freescale/imx8mm.dtsi micfil: audio-controller@30080000 { · line 362

Quoted 2 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +2 -0
+                     spdif1: spdif@30090000 {
+                             compatible = "fsl,imx8mm-spdif", "fsl,imx35-spdif";

This does not pass the dtschema validation, so only "fsl,imx35-spdif".

Shouldn't the dt schema validation be changed then to accept this format?

#4 lore raw

Re: [PATCH 2/3] arm64: dts: imx8mm: Add node for SPDIF

Quoted 11 lines · Fabio Estevam

Hi Krzysztof,

Quoted 4 lines · Krzysztof Kozlowski

arch/arm64/boot/dts/freescale/imx8mm.dtsi micfil: audio-controller@30080000 { · line 362

Quoted 2 lines
arch/arm64/boot/dts/freescale/imx8mm.dtsi +2 -0
+                     spdif1: spdif@30090000 {
+                             compatible = "fsl,imx8mm-spdif", "fsl,imx35-spdif";

This does not pass the dtschema validation, so only "fsl,imx35-spdif".

Shouldn't the dt schema validation be changed then to accept this format?

Depends. If a given compatible is in the schema, then the answer is:
rather not. The DTS conform to schema, not the otherwise. When dtschema is sent this is the ABI to which the kernel should conform. User-space or other SW (e.g. U-Boot) could depend on it. Of course there are exceptions...

If the compatible is not in the schema, then of course it could be added if there is a need. In this case, device is simply compatible with "fsl,imx35-spdif" so there is no real need to change the schema. Just use the existing compatible. Look at one funny example in iMX:
drivers/pwm/pwm-imx27.c. Someone created multiple compatibles but does not use them at all, because the hardware looks exactly the same. Therefore driver implements only one compatible because entire HW is compatible with fsl,imx27-pwm. In such clear case, why adding many compatibles? It's just a churn.

Best regards,
Krzysztof

author
#5 lore raw

PATCH 3/3 arm64: defconfig: Enable additional sound drivers on i.MX8M Mini

In reply to Adam Ford

The i.MX8M Mini has micfil and SPDIF support but the drivers are not being loaded.

This patch updates the defconfig to add support for these drivers.

arch/arm64/configs/defconfig +4 -0
index e0f33826819f..20362359b212 100644
@@ -674,6 +674,10 @@ CONFIG_SND_HDA_CODEC_HDMI=m
 CONFIG_SND_SOC=y
 CONFIG_SND_BCM2835_SOC_I2S=m
 CONFIG_SND_SOC_FSL_SAI=m
+CONFIG_SND_SOC_FSL_MICFIL=m
+CONFIG_SND_IMX_SOC=m
+CONFIG_SND_SOC_IMX_SPDIF=m
+CONFIG_SND_SOC_IMX_AUDMIX=m
 CONFIG_SND_MESON_AXG_SOUND_CARD=m
 CONFIG_SND_MESON_GX_SOUND_CARD=m
 CONFIG_SND_SOC_SDM845=m
Signature · 1 line
2.25.1