linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Enable wm8524 codec on i.MX8MM EVK
@ 2019-04-22 19:35 Daniel Baluta
  2019-04-22 19:35 ` [PATCH v2 1/2] arm64: dts: imx8mm: Add SAI nodes Daniel Baluta
  2019-04-22 19:36 ` [PATCH v2 2/2] arm64: dts: imx8mm-evk: Enable audio codec wm8524 Daniel Baluta
  0 siblings, 2 replies; 8+ messages in thread
From: Daniel Baluta @ 2019-04-22 19:35 UTC (permalink / raw)
  To: shawnguo
  Cc: mark.rutland, robh+dt, s.hauer, kernel, festevam, dl-linux-imx,
	Aisheng Dong, Anson Huang, S.j. Wang, Peng Fan, devicetree,
	linux-arm-kernel, linux-kernel, Daniel Baluta

This patch series introduces the SAI nodes on i.MX8MM EVK then
creates the wm8524 codec node and finally uses simple card machine
driver to create a sound card.

Changes since v1:
	- use "fsl,imx8mm-sai", "fsl,imx8mq-sai" compatbile strings and
	  remove "fsl,imx6sx-sai" because SAI module on i.MX8M is not
	  compatbile with SAI modules form i.MX6

Daniel Baluta (2):
  arm64: dts: imx8mm: Add SAI nodes
  arm64: dts: imx8mm-evk: Enable audio codec wm8524

 arch/arm64/boot/dts/freescale/imx8mm-evk.dts | 48 +++++++++++++
 arch/arm64/boot/dts/freescale/imx8mm.dtsi    | 71 ++++++++++++++++++++
 2 files changed, 119 insertions(+)

-- 
2.17.1


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

* [PATCH v2 1/2] arm64: dts: imx8mm: Add SAI nodes
  2019-04-22 19:35 [PATCH v2 0/2] Enable wm8524 codec on i.MX8MM EVK Daniel Baluta
@ 2019-04-22 19:35 ` Daniel Baluta
  2019-04-23  5:20   ` Marco Felsch
  2019-04-22 19:36 ` [PATCH v2 2/2] arm64: dts: imx8mm-evk: Enable audio codec wm8524 Daniel Baluta
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Baluta @ 2019-04-22 19:35 UTC (permalink / raw)
  To: shawnguo
  Cc: mark.rutland, robh+dt, s.hauer, kernel, festevam, dl-linux-imx,
	Aisheng Dong, Anson Huang, S.j. Wang, Peng Fan, devicetree,
	linux-arm-kernel, linux-kernel, Daniel Baluta

i.MX8MM has 5 SAI instances with the following base
addresses according to RM.

SAI1 base address: 3001_0000h
SAI2 base address: 3002_0000h
SAI3 base address: 3003_0000h
SAI5 base address: 3005_0000h
SAI6 base address: 3006_0000h

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8mm.dtsi | 71 +++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
index de3498c2dd44..4d080dc47216 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
@@ -171,6 +171,77 @@
 			#size-cells = <1>;
 			ranges;
 
+			sai1: sai@30010000 {
+				compatible = "fsl,imx8mm-sai",
+						"fsl,imx8mq-sai";
+				reg = <0x30010000 0x10000>;
+				interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clk IMX8MM_CLK_SAI1_IPG>,
+					 <&clk IMX8MM_CLK_SAI1_ROOT>,
+					 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
+				clock-names = "bus", "mclk1", "mclk2", "mclk3";
+				dmas = <&sdma2 0 2 0>, <&sdma2 1 2 0>;
+				dma-names = "rx", "tx";
+				status = "disabled";
+			};
+
+			sai2: sai@30020000 {
+				compatible = "fsl,imx8mm-sai",
+						"fsl,imx8mq-sai";
+				reg = <0x30020000 0x10000>;
+				interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clk IMX8MM_CLK_SAI2_IPG>,
+					<&clk IMX8MM_CLK_SAI2_ROOT>,
+					<&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
+				clock-names = "bus", "mclk1", "mclk2", "mclk3";
+				dmas = <&sdma2 2 2 0>, <&sdma2 3 2 0>;
+				dma-names = "rx", "tx";
+				status = "disabled";
+			};
+
+			sai3: sai@30030000 {
+				#sound-dai-cells = <0>;
+				compatible = "fsl,imx8mm-sai",
+						"fsl,imx8mq-sai";
+				reg = <0x30030000 0x10000>;
+				interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clk IMX8MM_CLK_SAI3_IPG>,
+					 <&clk IMX8MM_CLK_SAI3_ROOT>,
+					 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
+				clock-names = "bus", "mclk1", "mclk2", "mclk3";
+				dmas = <&sdma2 4 2 0>, <&sdma2 5 2 0>;
+				dma-names = "rx", "tx";
+				status = "disabled";
+			};
+
+			sai5: sai@30050000 {
+				compatible = "fsl,imx8mm-sai",
+						"fsl,imx8mq-sai";
+				reg = <0x30050000 0x10000>;
+				interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clk IMX8MM_CLK_SAI5_IPG>,
+					 <&clk IMX8MM_CLK_SAI5_ROOT>,
+					 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
+				clock-names = "bus", "mclk1", "mclk2", "mclk3";
+				dmas = <&sdma2 8 2 0>, <&sdma2 9 2 0>;
+				dma-names = "rx", "tx";
+				status = "disabled";
+			};
+
+			sai6: sai@30060000 {
+				compatible = "fsl,imx8mm-sai",
+						"fsl,imx8mq-sai";
+				reg = <0x30060000 0x10000>;
+				interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clk IMX8MM_CLK_SAI6_IPG>,
+					 <&clk IMX8MM_CLK_SAI6_ROOT>,
+					 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
+				clock-names = "bus", "mclk1", "mclk2", "mclk3";
+				dmas = <&sdma2 10 2 0>, <&sdma2 11 2 0>;
+				dma-names = "rx", "tx";
+				status = "disabled";
+			};
+
 			gpio1: gpio@30200000 {
 				compatible = "fsl,imx8mm-gpio", "fsl,imx35-gpio";
 				reg = <0x30200000 0x10000>;
-- 
2.17.1


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

* [PATCH v2 2/2] arm64: dts: imx8mm-evk: Enable audio codec wm8524
  2019-04-22 19:35 [PATCH v2 0/2] Enable wm8524 codec on i.MX8MM EVK Daniel Baluta
  2019-04-22 19:35 ` [PATCH v2 1/2] arm64: dts: imx8mm: Add SAI nodes Daniel Baluta
@ 2019-04-22 19:36 ` Daniel Baluta
  2019-04-23  5:17   ` Marco Felsch
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Baluta @ 2019-04-22 19:36 UTC (permalink / raw)
  To: shawnguo
  Cc: mark.rutland, robh+dt, s.hauer, kernel, festevam, dl-linux-imx,
	Aisheng Dong, Anson Huang, S.j. Wang, Peng Fan, devicetree,
	linux-arm-kernel, linux-kernel, Daniel Baluta

i.MX8MM has one wm8524 audio codec connected with
SAI3 digital audio interface.

This patch uses simple-card machine driver in order
to enable wm8524 codec.

We need to set:
	* SAI3 pinctrl configuration
	* clock hierarchy
	* codec node
	* simple-card configuration

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
---
 arch/arm64/boot/dts/freescale/imx8mm-evk.dts | 48 ++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk.dts
index 2d5d89475b76..207b13266a96 100644
--- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dts
@@ -37,6 +37,35 @@
 		gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 	};
+
+	wm8524: audio-codec {
+		#sound-dai-cells = <0>;
+		compatible = "wlf,wm8524";
+		wlf,mute-gpios = <&gpio5 21 GPIO_ACTIVE_LOW>;
+	};
+
+	sound-wm8524 {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "wm8524-audio";
+		simple-audio-card,format = "i2s";
+		simple-audio-card,frame-master = <&cpudai>;
+		simple-audio-card,bitclock-master = <&cpudai>;
+		simple-audio-card,widgets =
+			"Line", "Left Line Out Jack",
+			"Line", "Right Line Out Jack";
+		simple-audio-card,routing =
+			"Left Line Out Jack", "LINEVOUTL",
+			"Right Line Out Jack", "LINEVOUTR";
+
+		cpudai: simple-audio-card,cpu {
+			sound-dai = <&sai3>;
+		};
+
+		link_codec: simple-audio-card,codec {
+			sound-dai = <&wm8524>;
+			clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;
+		};
+	};
 };
 
 &fec1 {
@@ -61,6 +90,15 @@
 	};
 };
 
+&sai3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_sai3>;
+	assigned-clocks = <&clk IMX8MM_CLK_SAI3>;
+	assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
+	assigned-clock-rates = <24576000>;
+	status = "okay";
+};
+
 &uart2 { /* console */
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart2>;
@@ -130,6 +168,16 @@
 		>;
 	};
 
+	pinctrl_sai3: sai3grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC     0xd6
+			MX8MM_IOMUXC_SAI3_TXC_SAI3_TX_BCLK      0xd6
+			MX8MM_IOMUXC_SAI3_MCLK_SAI3_MCLK        0xd6
+			MX8MM_IOMUXC_SAI3_TXD_SAI3_TX_DATA0     0xd6
+			MX8MM_IOMUXC_I2C4_SDA_GPIO5_IO21        0xd6
+		>;
+	};
+
 	pinctrl_uart2: uart2grp {
 		fsl,pins = <
 			MX8MM_IOMUXC_UART2_RXD_UART2_DCE_RX	0x140
-- 
2.17.1


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

* Re: [PATCH v2 2/2] arm64: dts: imx8mm-evk: Enable audio codec wm8524
  2019-04-22 19:36 ` [PATCH v2 2/2] arm64: dts: imx8mm-evk: Enable audio codec wm8524 Daniel Baluta
@ 2019-04-23  5:17   ` Marco Felsch
  2019-04-23  6:22     ` Daniel Baluta
  0 siblings, 1 reply; 8+ messages in thread
From: Marco Felsch @ 2019-04-23  5:17 UTC (permalink / raw)
  To: Daniel Baluta
  Cc: shawnguo, mark.rutland, Aisheng Dong, Peng Fan, Anson Huang,
	devicetree, s.hauer, linux-kernel, robh+dt, dl-linux-imx, kernel,
	festevam, S.j. Wang, linux-arm-kernel

Hi Daniel,

On 19-04-22 19:36, Daniel Baluta wrote:
> i.MX8MM has one wm8524 audio codec connected with
> SAI3 digital audio interface.
> 
> This patch uses simple-card machine driver in order
> to enable wm8524 codec.
> 
> We need to set:
> 	* SAI3 pinctrl configuration
> 	* clock hierarchy
> 	* codec node
> 	* simple-card configuration
> 
> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> ---
>  arch/arm64/boot/dts/freescale/imx8mm-evk.dts | 48 ++++++++++++++++++++
>  1 file changed, 48 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk.dts
> index 2d5d89475b76..207b13266a96 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dts
> +++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dts
> @@ -37,6 +37,35 @@
>  		gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
>  		enable-active-high;
>  	};
> +
> +	wm8524: audio-codec {
> +		#sound-dai-cells = <0>;
> +		compatible = "wlf,wm8524";
> +		wlf,mute-gpios = <&gpio5 21 GPIO_ACTIVE_LOW>;

I would mux the gpio where I use them.

> +	};
> +
> +	sound-wm8524 {
> +		compatible = "simple-audio-card";
> +		simple-audio-card,name = "wm8524-audio";
> +		simple-audio-card,format = "i2s";
> +		simple-audio-card,frame-master = <&cpudai>;
> +		simple-audio-card,bitclock-master = <&cpudai>;
> +		simple-audio-card,widgets =
> +			"Line", "Left Line Out Jack",
> +			"Line", "Right Line Out Jack";
> +		simple-audio-card,routing =
> +			"Left Line Out Jack", "LINEVOUTL",
> +			"Right Line Out Jack", "LINEVOUTR";
> +
> +		cpudai: simple-audio-card,cpu {
> +			sound-dai = <&sai3>;
> +		};
> +
> +		link_codec: simple-audio-card,codec {

Can you drop that phandle?

Regards,
  Marco

> +			sound-dai = <&wm8524>;
> +			clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;
> +		};
> +	};
>  };
>  
>  &fec1 {
> @@ -61,6 +90,15 @@
>  	};
>  };
>  
> +&sai3 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_sai3>;
> +	assigned-clocks = <&clk IMX8MM_CLK_SAI3>;
> +	assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
> +	assigned-clock-rates = <24576000>;
> +	status = "okay";
> +};
> +
>  &uart2 { /* console */
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&pinctrl_uart2>;
> @@ -130,6 +168,16 @@
>  		>;
>  	};
>  
> +	pinctrl_sai3: sai3grp {
> +		fsl,pins = <
> +			MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC     0xd6
> +			MX8MM_IOMUXC_SAI3_TXC_SAI3_TX_BCLK      0xd6
> +			MX8MM_IOMUXC_SAI3_MCLK_SAI3_MCLK        0xd6
> +			MX8MM_IOMUXC_SAI3_TXD_SAI3_TX_DATA0     0xd6
> +			MX8MM_IOMUXC_I2C4_SDA_GPIO5_IO21        0xd6
> +		>;
> +	};
> +
>  	pinctrl_uart2: uart2grp {
>  		fsl,pins = <
>  			MX8MM_IOMUXC_UART2_RXD_UART2_DCE_RX	0x140
> -- 
> 2.17.1
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH v2 1/2] arm64: dts: imx8mm: Add SAI nodes
  2019-04-22 19:35 ` [PATCH v2 1/2] arm64: dts: imx8mm: Add SAI nodes Daniel Baluta
@ 2019-04-23  5:20   ` Marco Felsch
  2019-04-23  6:16     ` Daniel Baluta
  0 siblings, 1 reply; 8+ messages in thread
From: Marco Felsch @ 2019-04-23  5:20 UTC (permalink / raw)
  To: Daniel Baluta
  Cc: shawnguo, mark.rutland, Aisheng Dong, Peng Fan, Anson Huang,
	devicetree, s.hauer, linux-kernel, robh+dt, dl-linux-imx, kernel,
	festevam, S.j. Wang, linux-arm-kernel

Hi Daniel,

On 19-04-22 19:35, Daniel Baluta wrote:
> i.MX8MM has 5 SAI instances with the following base
> addresses according to RM.
> 
> SAI1 base address: 3001_0000h
> SAI2 base address: 3002_0000h
> SAI3 base address: 3003_0000h
> SAI5 base address: 3005_0000h
> SAI6 base address: 3006_0000h
> 
> Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> ---
>  arch/arm64/boot/dts/freescale/imx8mm.dtsi | 71 +++++++++++++++++++++++
>  1 file changed, 71 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> index de3498c2dd44..4d080dc47216 100644
> --- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> +++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> @@ -171,6 +171,77 @@
>  			#size-cells = <1>;
>  			ranges;
>  
> +			sai1: sai@30010000 {
> +				compatible = "fsl,imx8mm-sai",
> +						"fsl,imx8mq-sai";

Just a nitpick but I would not break this line here. This applies to the
other sai nodes too.

Regards,
  Marco

> +				reg = <0x30010000 0x10000>;
> +				interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
> +				clocks = <&clk IMX8MM_CLK_SAI1_IPG>,
> +					 <&clk IMX8MM_CLK_SAI1_ROOT>,
> +					 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
> +				clock-names = "bus", "mclk1", "mclk2", "mclk3";
> +				dmas = <&sdma2 0 2 0>, <&sdma2 1 2 0>;
> +				dma-names = "rx", "tx";
> +				status = "disabled";
> +			};
> +
> +			sai2: sai@30020000 {
> +				compatible = "fsl,imx8mm-sai",
> +						"fsl,imx8mq-sai";
> +				reg = <0x30020000 0x10000>;
> +				interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
> +				clocks = <&clk IMX8MM_CLK_SAI2_IPG>,
> +					<&clk IMX8MM_CLK_SAI2_ROOT>,
> +					<&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
> +				clock-names = "bus", "mclk1", "mclk2", "mclk3";
> +				dmas = <&sdma2 2 2 0>, <&sdma2 3 2 0>;
> +				dma-names = "rx", "tx";
> +				status = "disabled";
> +			};
> +
> +			sai3: sai@30030000 {
> +				#sound-dai-cells = <0>;
> +				compatible = "fsl,imx8mm-sai",
> +						"fsl,imx8mq-sai";
> +				reg = <0x30030000 0x10000>;
> +				interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
> +				clocks = <&clk IMX8MM_CLK_SAI3_IPG>,
> +					 <&clk IMX8MM_CLK_SAI3_ROOT>,
> +					 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
> +				clock-names = "bus", "mclk1", "mclk2", "mclk3";
> +				dmas = <&sdma2 4 2 0>, <&sdma2 5 2 0>;
> +				dma-names = "rx", "tx";
> +				status = "disabled";
> +			};
> +
> +			sai5: sai@30050000 {
> +				compatible = "fsl,imx8mm-sai",
> +						"fsl,imx8mq-sai";
> +				reg = <0x30050000 0x10000>;
> +				interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
> +				clocks = <&clk IMX8MM_CLK_SAI5_IPG>,
> +					 <&clk IMX8MM_CLK_SAI5_ROOT>,
> +					 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
> +				clock-names = "bus", "mclk1", "mclk2", "mclk3";
> +				dmas = <&sdma2 8 2 0>, <&sdma2 9 2 0>;
> +				dma-names = "rx", "tx";
> +				status = "disabled";
> +			};
> +
> +			sai6: sai@30060000 {
> +				compatible = "fsl,imx8mm-sai",
> +						"fsl,imx8mq-sai";
> +				reg = <0x30060000 0x10000>;
> +				interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
> +				clocks = <&clk IMX8MM_CLK_SAI6_IPG>,
> +					 <&clk IMX8MM_CLK_SAI6_ROOT>,
> +					 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
> +				clock-names = "bus", "mclk1", "mclk2", "mclk3";
> +				dmas = <&sdma2 10 2 0>, <&sdma2 11 2 0>;
> +				dma-names = "rx", "tx";
> +				status = "disabled";
> +			};
> +
>  			gpio1: gpio@30200000 {
>  				compatible = "fsl,imx8mm-gpio", "fsl,imx35-gpio";
>  				reg = <0x30200000 0x10000>;
> -- 
> 2.17.1
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* Re: [PATCH v2 1/2] arm64: dts: imx8mm: Add SAI nodes
  2019-04-23  5:20   ` Marco Felsch
@ 2019-04-23  6:16     ` Daniel Baluta
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Baluta @ 2019-04-23  6:16 UTC (permalink / raw)
  To: Marco Felsch
  Cc: Daniel Baluta, shawnguo, mark.rutland, Aisheng Dong, Peng Fan,
	Anson Huang, devicetree, s.hauer, linux-kernel, robh+dt,
	dl-linux-imx, kernel, festevam, S.j. Wang, linux-arm-kernel

On Tue, Apr 23, 2019 at 8:21 AM Marco Felsch <m.felsch@pengutronix.de> wrote:
>
> Hi Daniel,
>
> On 19-04-22 19:35, Daniel Baluta wrote:
> > i.MX8MM has 5 SAI instances with the following base
> > addresses according to RM.
> >
> > SAI1 base address: 3001_0000h
> > SAI2 base address: 3002_0000h
> > SAI3 base address: 3003_0000h
> > SAI5 base address: 3005_0000h
> > SAI6 base address: 3006_0000h
> >
> > Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> > ---
> >  arch/arm64/boot/dts/freescale/imx8mm.dtsi | 71 +++++++++++++++++++++++
> >  1 file changed, 71 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> > index de3498c2dd44..4d080dc47216 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> > +++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> > @@ -171,6 +171,77 @@
> >                       #size-cells = <1>;
> >                       ranges;
> >
> > +                     sai1: sai@30010000 {
> > +                             compatible = "fsl,imx8mm-sai",
> > +                                             "fsl,imx8mq-sai";
>
> Just a nitpick but I would not break this line here. This applies to the
> other sai nodes too.

Yes, I thought about this and I think I will fix it as you say also I get past
the 80 chars limit.

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

* Re: [PATCH v2 2/2] arm64: dts: imx8mm-evk: Enable audio codec wm8524
  2019-04-23  5:17   ` Marco Felsch
@ 2019-04-23  6:22     ` Daniel Baluta
  2019-04-23  7:31       ` Marco Felsch
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Baluta @ 2019-04-23  6:22 UTC (permalink / raw)
  To: Marco Felsch
  Cc: Daniel Baluta, shawnguo, mark.rutland, Aisheng Dong, Peng Fan,
	Anson Huang, devicetree, s.hauer, linux-kernel, robh+dt,
	dl-linux-imx, kernel, festevam, S.j. Wang, linux-arm-kernel

Hi Marco,

On Tue, Apr 23, 2019 at 8:19 AM Marco Felsch <m.felsch@pengutronix.de> wrote:
>
> Hi Daniel,
>
> On 19-04-22 19:36, Daniel Baluta wrote:
> > i.MX8MM has one wm8524 audio codec connected with
> > SAI3 digital audio interface.
> >
> > This patch uses simple-card machine driver in order
> > to enable wm8524 codec.
> >
> > We need to set:
> >       * SAI3 pinctrl configuration
> >       * clock hierarchy
> >       * codec node
> >       * simple-card configuration
> >
> > Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> > ---
> >  arch/arm64/boot/dts/freescale/imx8mm-evk.dts | 48 ++++++++++++++++++++
> >  1 file changed, 48 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk.dts
> > index 2d5d89475b76..207b13266a96 100644
> > --- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dts
> > +++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dts
> > @@ -37,6 +37,35 @@
> >               gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
> >               enable-active-high;
> >       };
> > +
> > +     wm8524: audio-codec {
> > +             #sound-dai-cells = <0>;
> > +             compatible = "wlf,wm8524";
> > +             wlf,mute-gpios = <&gpio5 21 GPIO_ACTIVE_LOW>;
>
> I would mux the gpio where I use them.

I'm not sure I understand this. Can you provide an example.
>
> > +     };
> > +
> > +     sound-wm8524 {
> > +             compatible = "simple-audio-card";
> > +             simple-audio-card,name = "wm8524-audio";
> > +             simple-audio-card,format = "i2s";
> > +             simple-audio-card,frame-master = <&cpudai>;
> > +             simple-audio-card,bitclock-master = <&cpudai>;
> > +             simple-audio-card,widgets =
> > +                     "Line", "Left Line Out Jack",
> > +                     "Line", "Right Line Out Jack";
> > +             simple-audio-card,routing =
> > +                     "Left Line Out Jack", "LINEVOUTL",
> > +                     "Right Line Out Jack", "LINEVOUTR";
> > +
> > +             cpudai: simple-audio-card,cpu {
> > +                     sound-dai = <&sai3>;
> > +             };
> > +
> > +             link_codec: simple-audio-card,codec {
>
> Can you drop that phandle?

I see your point here. But for symmetry and consistency with
imx8mm-evk I would prefer
to keep it like that.

https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git/tree/arch/arm64/boot/dts/freescale/imx8mq-evk.dts?h=for-next#n59

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

* Re: [PATCH v2 2/2] arm64: dts: imx8mm-evk: Enable audio codec wm8524
  2019-04-23  6:22     ` Daniel Baluta
@ 2019-04-23  7:31       ` Marco Felsch
  0 siblings, 0 replies; 8+ messages in thread
From: Marco Felsch @ 2019-04-23  7:31 UTC (permalink / raw)
  To: Daniel Baluta
  Cc: Daniel Baluta, shawnguo, mark.rutland, Aisheng Dong, Peng Fan,
	Anson Huang, devicetree, s.hauer, linux-kernel, robh+dt,
	dl-linux-imx, kernel, festevam, S.j. Wang, linux-arm-kernel

Hi Daniel,

On 19-04-23 09:22, Daniel Baluta wrote:
> Hi Marco,
> 
> On Tue, Apr 23, 2019 at 8:19 AM Marco Felsch <m.felsch@pengutronix.de> wrote:
> >
> > Hi Daniel,
> >
> > On 19-04-22 19:36, Daniel Baluta wrote:
> > > i.MX8MM has one wm8524 audio codec connected with
> > > SAI3 digital audio interface.
> > >
> > > This patch uses simple-card machine driver in order
> > > to enable wm8524 codec.
> > >
> > > We need to set:
> > >       * SAI3 pinctrl configuration
> > >       * clock hierarchy
> > >       * codec node
> > >       * simple-card configuration
> > >
> > > Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
> > > ---
> > >  arch/arm64/boot/dts/freescale/imx8mm-evk.dts | 48 ++++++++++++++++++++
> > >  1 file changed, 48 insertions(+)
> > >
> > > diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk.dts
> > > index 2d5d89475b76..207b13266a96 100644
> > > --- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dts
> > > +++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dts
> > > @@ -37,6 +37,35 @@
> > >               gpio = <&gpio2 19 GPIO_ACTIVE_HIGH>;
> > >               enable-active-high;
> > >       };
> > > +
> > > +     wm8524: audio-codec {
> > > +             #sound-dai-cells = <0>;
> > > +             compatible = "wlf,wm8524";
> > > +             wlf,mute-gpios = <&gpio5 21 GPIO_ACTIVE_LOW>;
> >
> > I would mux the gpio where I use them.
> 
> I'm not sure I understand this. Can you provide an example.

Just adding a princtrl-0 and pinctrl-names entry to mux the gpio here
rather than within the sai node.

> >
> > > +     };
> > > +
> > > +     sound-wm8524 {
> > > +             compatible = "simple-audio-card";
> > > +             simple-audio-card,name = "wm8524-audio";
> > > +             simple-audio-card,format = "i2s";
> > > +             simple-audio-card,frame-master = <&cpudai>;
> > > +             simple-audio-card,bitclock-master = <&cpudai>;
> > > +             simple-audio-card,widgets =
> > > +                     "Line", "Left Line Out Jack",
> > > +                     "Line", "Right Line Out Jack";
> > > +             simple-audio-card,routing =
> > > +                     "Left Line Out Jack", "LINEVOUTL",
> > > +                     "Right Line Out Jack", "LINEVOUTR";
> > > +
> > > +             cpudai: simple-audio-card,cpu {
> > > +                     sound-dai = <&sai3>;
> > > +             };
> > > +
> > > +             link_codec: simple-audio-card,codec {
> >
> > Can you drop that phandle?
> 
> I see your point here. But for symmetry and consistency with
> imx8mm-evk I would prefer
> to keep it like that.
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux.git/tree/arch/arm64/boot/dts/freescale/imx8mq-evk.dts?h=for-next#n59
> 

Got your point but I think that the evk dts will be used as base for
future dts. Instead of keep them here I would send a patch to drop the
phandle in the imx8mq-evk.dts since it isn't necessary.

Regards,
  Marco

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

end of thread, other threads:[~2019-04-23  7:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-22 19:35 [PATCH v2 0/2] Enable wm8524 codec on i.MX8MM EVK Daniel Baluta
2019-04-22 19:35 ` [PATCH v2 1/2] arm64: dts: imx8mm: Add SAI nodes Daniel Baluta
2019-04-23  5:20   ` Marco Felsch
2019-04-23  6:16     ` Daniel Baluta
2019-04-22 19:36 ` [PATCH v2 2/2] arm64: dts: imx8mm-evk: Enable audio codec wm8524 Daniel Baluta
2019-04-23  5:17   ` Marco Felsch
2019-04-23  6:22     ` Daniel Baluta
2019-04-23  7:31       ` Marco Felsch

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