linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] arm64: dts: imx8mm: Add support for micfil
@ 2020-10-08 21:27 Adam Ford
  2020-10-08 21:27 ` [PATCH 2/3] arm64: dts: imx8mm: Add node for SPDIF Adam Ford
  2020-10-08 21:27 ` [PATCH 3/3] arm64: defconfig: Enable additional sound drivers on i.MX8M Mini Adam Ford
  0 siblings, 2 replies; 7+ messages in thread
From: Adam Ford @ 2020-10-08 21:27 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: aford, Adam Ford, Rob Herring, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Catalin Marinas, Will Deacon, devicetree, linux-kernel

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 <aford173@gmail.com>

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


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

* [PATCH 2/3] arm64: dts: imx8mm: Add node for SPDIF
  2020-10-08 21:27 [PATCH 1/3] arm64: dts: imx8mm: Add support for micfil Adam Ford
@ 2020-10-08 21:27 ` Adam Ford
  2020-10-12 17:00   ` Krzysztof Kozlowski
  2020-10-08 21:27 ` [PATCH 3/3] arm64: defconfig: Enable additional sound drivers on i.MX8M Mini Adam Ford
  1 sibling, 1 reply; 7+ messages in thread
From: Adam Ford @ 2020-10-08 21:27 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: aford, Adam Ford, Rob Herring, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Catalin Marinas, Will Deacon, devicetree, linux-kernel

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 <aford173@gmail.com>

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


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

* [PATCH 3/3] arm64: defconfig: Enable additional sound drivers on i.MX8M Mini
  2020-10-08 21:27 [PATCH 1/3] arm64: dts: imx8mm: Add support for micfil Adam Ford
  2020-10-08 21:27 ` [PATCH 2/3] arm64: dts: imx8mm: Add node for SPDIF Adam Ford
@ 2020-10-08 21:27 ` Adam Ford
  2020-10-19 17:51   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 7+ messages in thread
From: Adam Ford @ 2020-10-08 21:27 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: aford, Adam Ford, Rob Herring, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Catalin Marinas, Will Deacon, devicetree, linux-kernel

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 <aford173@gmail.com>

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


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

* Re: [PATCH 2/3] arm64: dts: imx8mm: Add node for SPDIF
  2020-10-08 21:27 ` [PATCH 2/3] arm64: dts: imx8mm: Add node for SPDIF Adam Ford
@ 2020-10-12 17:00   ` Krzysztof Kozlowski
  2020-10-19 16:55     ` Fabio Estevam
  0 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2020-10-12 17:00 UTC (permalink / raw)
  To: Adam Ford
  Cc: linux-arm-kernel, aford, Rob Herring, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Catalin Marinas, Will Deacon, devicetree, linux-kernel

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 <aford173@gmail.com>
> 
> 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

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

* Re: [PATCH 2/3] arm64: dts: imx8mm: Add node for SPDIF
  2020-10-12 17:00   ` Krzysztof Kozlowski
@ 2020-10-19 16:55     ` Fabio Estevam
  2020-10-19 17:06       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2020-10-19 16:55 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Adam Ford,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	Adam Ford-BE, Rob Herring, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, NXP Linux Team, Catalin Marinas,
	Will Deacon,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel

Hi Krzysztof,

On Mon, Oct 12, 2020 at 2:00 PM Krzysztof Kozlowski <krzk@kernel.org> 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?

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

* Re: [PATCH 2/3] arm64: dts: imx8mm: Add node for SPDIF
  2020-10-19 16:55     ` Fabio Estevam
@ 2020-10-19 17:06       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2020-10-19 17:06 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Adam Ford,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
	Adam Ford-BE, Rob Herring, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, NXP Linux Team, Catalin Marinas,
	Will Deacon,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel

On Mon, 19 Oct 2020 at 18:56, Fabio Estevam <festevam@gmail.com> wrote:
>
> Hi Krzysztof,
>
> On Mon, Oct 12, 2020 at 2:00 PM Krzysztof Kozlowski <krzk@kernel.org> 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

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

* Re: [PATCH 3/3] arm64: defconfig: Enable additional sound drivers on i.MX8M Mini
  2020-10-08 21:27 ` [PATCH 3/3] arm64: defconfig: Enable additional sound drivers on i.MX8M Mini Adam Ford
@ 2020-10-19 17:51   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2020-10-19 17:51 UTC (permalink / raw)
  To: Adam Ford
  Cc: linux-arm-kernel, aford, Rob Herring, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Catalin Marinas, Will Deacon, devicetree, linux-kernel

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 <aford173@gmail.com>

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

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

end of thread, other threads:[~2020-10-19 17:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-08 21:27 [PATCH 1/3] arm64: dts: imx8mm: Add support for micfil Adam Ford
2020-10-08 21:27 ` [PATCH 2/3] arm64: dts: imx8mm: Add node for SPDIF Adam Ford
2020-10-12 17:00   ` Krzysztof Kozlowski
2020-10-19 16:55     ` Fabio Estevam
2020-10-19 17:06       ` Krzysztof Kozlowski
2020-10-08 21:27 ` [PATCH 3/3] arm64: defconfig: Enable additional sound drivers on i.MX8M Mini Adam Ford
2020-10-19 17:51   ` Krzysztof Kozlowski

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