2020-10-08 21:47:40

by Adam Ford

[permalink] [raw]
Subject: [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.

Signed-off-by: Adam Ford <[email protected]>

diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
index b83f400def8b..fad1f9cdb241 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
@@ -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>;
--
2.25.1


2020-10-08 21:48:06

by Adam Ford

[permalink] [raw]
Subject: [PATCH 3/3] arm64: defconfig: Enable additional sound drivers on i.MX8M Mini

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.

Signed-off-by: Adam Ford <[email protected]>

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index e0f33826819f..20362359b212 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -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
--
2.25.1

2020-10-08 21:49:09

by Adam Ford

[permalink] [raw]
Subject: [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.

Signed-off-by: Adam Ford <[email protected]>

diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
index fad1f9cdb241..44a59f59f65a 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
@@ -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>;
--
2.25.1

2020-10-12 17:02:19

by Krzysztof Kozlowski

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

On Thu, Oct 08, 2020 at 04:27:05PM -0500, Adam Ford wrote:
> The i.MX8M Mini can support SPIDF which is very similar to the

SPIDF -> SPDIF

> IP used on the i.MX35.
>
> This patch adds the SPIF node.

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

>
> Signed-off-by: Adam Ford <[email protected]>
>
> diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> index fad1f9cdb241..44a59f59f65a 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> @@ -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

2020-10-19 16:57:57

by Fabio Estevam

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

Hi Krzysztof,

On Mon, Oct 12, 2020 at 2:00 PM Krzysztof Kozlowski <[email protected]> wrote:

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

2020-10-19 17:09:48

by Krzysztof Kozlowski

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

On Mon, 19 Oct 2020 at 18:56, Fabio Estevam <[email protected]> wrote:
>
> Hi Krzysztof,
>
> On Mon, Oct 12, 2020 at 2:00 PM Krzysztof Kozlowski <[email protected]> wrote:
>
> > > + 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

2020-10-19 17:54:28

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 3/3] arm64: defconfig: Enable additional sound drivers on i.MX8M Mini

On Thu, Oct 08, 2020 at 04:27:06PM -0500, Adam Ford wrote:
> 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.
>
> Signed-off-by: Adam Ford <[email protected]>

Reviewed-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof