linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: imx7d-sdb: Add notes for audio sound card
@ 2020-07-23  5:43 Shengjiu Wang
  2020-08-17 13:40 ` Shawn Guo
  0 siblings, 1 reply; 3+ messages in thread
From: Shengjiu Wang @ 2020-07-23  5:43 UTC (permalink / raw)
  To: robh+dt, shawnguo, s.hauer, kernel, festevam, linux-imx,
	devicetree, linux-kernel, linux-arm-kernel

Configure the SAI device node, configure audio clock
and pinctrl.

Enable the audio sound card, which use the SAI1 and
wm8960, and enable headphone detection.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 arch/arm/boot/dts/imx7d-sdb.dts | 81 +++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/arch/arm/boot/dts/imx7d-sdb.dts b/arch/arm/boot/dts/imx7d-sdb.dts
index 17cca8a9f77b..b50b19f2d0f1 100644
--- a/arch/arm/boot/dts/imx7d-sdb.dts
+++ b/arch/arm/boot/dts/imx7d-sdb.dts
@@ -146,6 +146,24 @@ panel_in: endpoint {
 			};
 		};
 	};
+
+	sound {
+		compatible = "fsl,imx7d-evk-wm8960",
+			     "fsl,imx-audio-wm8960";
+		model = "wm8960-audio";
+		audio-cpu = <&sai1>;
+		audio-codec = <&codec>;
+		hp-det-gpio = <&gpio2 28 GPIO_ACTIVE_HIGH>;
+		audio-routing =
+			"Headphone Jack", "HP_L",
+			"Headphone Jack", "HP_R",
+			"Ext Spk", "SPK_LP",
+			"Ext Spk", "SPK_LN",
+			"Ext Spk", "SPK_RP",
+			"Ext Spk", "SPK_RN",
+			"LINPUT1", "AMIC",
+			"AMIC", "MICB";
+	};
 };
 
 &adc1 {
@@ -363,6 +381,13 @@ codec: wm8960@1a {
 		clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
 		clock-names = "mclk";
 		wlf,shared-lrclk;
+		wlf,hp-cfg = <2 2 3>;
+		wlf,gpio-cfg = <1 3>;
+		assigned-clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_SRC>,
+				  <&clks IMX7D_PLL_AUDIO_POST_DIV>,
+				  <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
+		assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
+		assigned-clock-rates = <0>, <884736000>, <12288000>;
 	};
 };
 
@@ -391,6 +416,28 @@ &reg_1p2 {
 	vin-supply = <&sw2_reg>;
 };
 
+&sai1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_sai1>;
+	assigned-clocks = <&clks IMX7D_SAI1_ROOT_SRC>,
+			  <&clks IMX7D_PLL_AUDIO_POST_DIV>,
+			  <&clks IMX7D_SAI1_ROOT_CLK>;
+	assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
+	assigned-clock-rates = <0>, <884736000>, <36864000>;
+	status = "okay";
+};
+
+&sai3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_sai3 &pinctrl_sai3_mclk>;
+	assigned-clocks = <&clks IMX7D_SAI3_ROOT_SRC>,
+			  <&clks IMX7D_PLL_AUDIO_POST_DIV>,
+			  <&clks IMX7D_SAI3_ROOT_CLK>;
+	assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
+	assigned-clock-rates = <0>, <884736000>, <36864000>;
+	status = "okay";
+};
+
 &snvs_pwrkey {
 	status = "okay";
 };
@@ -550,6 +597,7 @@ MX7D_PAD_SD2_WP__GPIO5_IO10		0x59
 		pinctrl_hog: hoggrp {
 			fsl,pins = <
 				MX7D_PAD_ECSPI2_SS0__GPIO4_IO23		0x34  /* bt reg on */
+				MX7D_PAD_EPDC_BDR0__GPIO2_IO28		0x59  /* headphone detect */
 			>;
 		};
 
@@ -615,6 +663,33 @@ MX7D_PAD_LCD_RESET__LCD_RESET		0x79
 			>;
 		};
 
+		pinctrl_sai1: sai1grp {
+			fsl,pins = <
+				MX7D_PAD_SAI1_MCLK__SAI1_MCLK           0x1f
+				MX7D_PAD_ENET1_RX_CLK__SAI1_TX_BCLK     0x1f
+				MX7D_PAD_ENET1_CRS__SAI1_TX_SYNC	0x1f
+				MX7D_PAD_ENET1_COL__SAI1_TX_DATA0	0x30
+				MX7D_PAD_ENET1_TX_CLK__SAI1_RX_DATA0	0x1f
+			>;
+		};
+
+		pinctrl_sai2: sai2grp {
+			fsl,pins = <
+				MX7D_PAD_SAI2_TX_BCLK__SAI2_TX_BCLK     0x1f
+				MX7D_PAD_SAI2_TX_SYNC__SAI2_TX_SYNC     0x1f
+				MX7D_PAD_SAI2_TX_DATA__SAI2_TX_DATA0    0x30
+				MX7D_PAD_SAI2_RX_DATA__SAI2_RX_DATA0    0x1f
+			>;
+		};
+
+		pinctrl_sai3: sai3grp {
+			fsl,pins = <
+				MX7D_PAD_UART3_TX_DATA__SAI3_TX_BCLK   0x1f
+				MX7D_PAD_UART3_CTS_B__SAI3_TX_SYNC     0x1f
+				MX7D_PAD_UART3_RTS_B__SAI3_TX_DATA0    0x30
+			>;
+		};
+
 		pinctrl_spi4: spi4grp {
 			fsl,pins = <
 				MX7D_PAD_GPIO1_IO09__GPIO1_IO9	0x59
@@ -776,4 +851,10 @@ pinctrl_usb_otg2_vbus_reg: usbotg2vbusreggrp {
 			MX7D_PAD_LPSR_GPIO1_IO07__GPIO1_IO7	  0x14
 		>;
 	};
+
+	pinctrl_sai3_mclk: sai3grp_mclk {
+		fsl,pins = <
+			MX7D_PAD_LPSR_GPIO1_IO03__SAI3_MCLK	0x1f
+		>;
+	};
 };
-- 
2.27.0


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

* Re: [PATCH] ARM: dts: imx7d-sdb: Add notes for audio sound card
  2020-07-23  5:43 [PATCH] ARM: dts: imx7d-sdb: Add notes for audio sound card Shengjiu Wang
@ 2020-08-17 13:40 ` Shawn Guo
  0 siblings, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2020-08-17 13:40 UTC (permalink / raw)
  To: Shengjiu Wang
  Cc: robh+dt, s.hauer, kernel, festevam, linux-imx, devicetree,
	linux-kernel, linux-arm-kernel

On Thu, Jul 23, 2020 at 01:43:36PM +0800, Shengjiu Wang wrote:
> Configure the SAI device node, configure audio clock
> and pinctrl.
> 
> Enable the audio sound card, which use the SAI1 and
> wm8960, and enable headphone detection.
> 
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>

s/notes/nodes in subject?

I fixed it up and applied the patch.

Shawn

> ---
>  arch/arm/boot/dts/imx7d-sdb.dts | 81 +++++++++++++++++++++++++++++++++
>  1 file changed, 81 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx7d-sdb.dts b/arch/arm/boot/dts/imx7d-sdb.dts
> index 17cca8a9f77b..b50b19f2d0f1 100644
> --- a/arch/arm/boot/dts/imx7d-sdb.dts
> +++ b/arch/arm/boot/dts/imx7d-sdb.dts
> @@ -146,6 +146,24 @@ panel_in: endpoint {
>  			};
>  		};
>  	};
> +
> +	sound {
> +		compatible = "fsl,imx7d-evk-wm8960",
> +			     "fsl,imx-audio-wm8960";
> +		model = "wm8960-audio";
> +		audio-cpu = <&sai1>;
> +		audio-codec = <&codec>;
> +		hp-det-gpio = <&gpio2 28 GPIO_ACTIVE_HIGH>;
> +		audio-routing =
> +			"Headphone Jack", "HP_L",
> +			"Headphone Jack", "HP_R",
> +			"Ext Spk", "SPK_LP",
> +			"Ext Spk", "SPK_LN",
> +			"Ext Spk", "SPK_RP",
> +			"Ext Spk", "SPK_RN",
> +			"LINPUT1", "AMIC",
> +			"AMIC", "MICB";
> +	};
>  };
>  
>  &adc1 {
> @@ -363,6 +381,13 @@ codec: wm8960@1a {
>  		clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
>  		clock-names = "mclk";
>  		wlf,shared-lrclk;
> +		wlf,hp-cfg = <2 2 3>;
> +		wlf,gpio-cfg = <1 3>;
> +		assigned-clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_SRC>,
> +				  <&clks IMX7D_PLL_AUDIO_POST_DIV>,
> +				  <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
> +		assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
> +		assigned-clock-rates = <0>, <884736000>, <12288000>;
>  	};
>  };
>  
> @@ -391,6 +416,28 @@ &reg_1p2 {
>  	vin-supply = <&sw2_reg>;
>  };
>  
> +&sai1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_sai1>;
> +	assigned-clocks = <&clks IMX7D_SAI1_ROOT_SRC>,
> +			  <&clks IMX7D_PLL_AUDIO_POST_DIV>,
> +			  <&clks IMX7D_SAI1_ROOT_CLK>;
> +	assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
> +	assigned-clock-rates = <0>, <884736000>, <36864000>;
> +	status = "okay";
> +};
> +
> +&sai3 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_sai3 &pinctrl_sai3_mclk>;
> +	assigned-clocks = <&clks IMX7D_SAI3_ROOT_SRC>,
> +			  <&clks IMX7D_PLL_AUDIO_POST_DIV>,
> +			  <&clks IMX7D_SAI3_ROOT_CLK>;
> +	assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
> +	assigned-clock-rates = <0>, <884736000>, <36864000>;
> +	status = "okay";
> +};
> +
>  &snvs_pwrkey {
>  	status = "okay";
>  };
> @@ -550,6 +597,7 @@ MX7D_PAD_SD2_WP__GPIO5_IO10		0x59
>  		pinctrl_hog: hoggrp {
>  			fsl,pins = <
>  				MX7D_PAD_ECSPI2_SS0__GPIO4_IO23		0x34  /* bt reg on */
> +				MX7D_PAD_EPDC_BDR0__GPIO2_IO28		0x59  /* headphone detect */
>  			>;
>  		};
>  
> @@ -615,6 +663,33 @@ MX7D_PAD_LCD_RESET__LCD_RESET		0x79
>  			>;
>  		};
>  
> +		pinctrl_sai1: sai1grp {
> +			fsl,pins = <
> +				MX7D_PAD_SAI1_MCLK__SAI1_MCLK           0x1f
> +				MX7D_PAD_ENET1_RX_CLK__SAI1_TX_BCLK     0x1f
> +				MX7D_PAD_ENET1_CRS__SAI1_TX_SYNC	0x1f
> +				MX7D_PAD_ENET1_COL__SAI1_TX_DATA0	0x30
> +				MX7D_PAD_ENET1_TX_CLK__SAI1_RX_DATA0	0x1f
> +			>;
> +		};
> +
> +		pinctrl_sai2: sai2grp {
> +			fsl,pins = <
> +				MX7D_PAD_SAI2_TX_BCLK__SAI2_TX_BCLK     0x1f
> +				MX7D_PAD_SAI2_TX_SYNC__SAI2_TX_SYNC     0x1f
> +				MX7D_PAD_SAI2_TX_DATA__SAI2_TX_DATA0    0x30
> +				MX7D_PAD_SAI2_RX_DATA__SAI2_RX_DATA0    0x1f
> +			>;
> +		};
> +
> +		pinctrl_sai3: sai3grp {
> +			fsl,pins = <
> +				MX7D_PAD_UART3_TX_DATA__SAI3_TX_BCLK   0x1f
> +				MX7D_PAD_UART3_CTS_B__SAI3_TX_SYNC     0x1f
> +				MX7D_PAD_UART3_RTS_B__SAI3_TX_DATA0    0x30
> +			>;
> +		};
> +
>  		pinctrl_spi4: spi4grp {
>  			fsl,pins = <
>  				MX7D_PAD_GPIO1_IO09__GPIO1_IO9	0x59
> @@ -776,4 +851,10 @@ pinctrl_usb_otg2_vbus_reg: usbotg2vbusreggrp {
>  			MX7D_PAD_LPSR_GPIO1_IO07__GPIO1_IO7	  0x14
>  		>;
>  	};
> +
> +	pinctrl_sai3_mclk: sai3grp_mclk {
> +		fsl,pins = <
> +			MX7D_PAD_LPSR_GPIO1_IO03__SAI3_MCLK	0x1f
> +		>;
> +	};
>  };
> -- 
> 2.27.0
> 

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

* Re: [PATCH] ARM: dts: imx7d-sdb: Add notes for audio sound card
@ 2020-08-17 13:44 S.j. Wang
  0 siblings, 0 replies; 3+ messages in thread
From: S.j. Wang @ 2020-08-17 13:44 UTC (permalink / raw)
  To: Shawn Guo
  Cc: robh+dt, s.hauer, kernel, festevam, dl-linux-imx, devicetree,
	linux-kernel, linux-arm-kernel


> > Configure the SAI device node, configure audio clock and pinctrl.
> >
> > Enable the audio sound card, which use the SAI1 and wm8960, and enable
> > headphone detection.
> >
> > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> 
> s/notes/nodes in subject?

Yes.  Thanks for fixing it.

Best regards
Wang shengjiu

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

end of thread, other threads:[~2020-08-17 13:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-23  5:43 [PATCH] ARM: dts: imx7d-sdb: Add notes for audio sound card Shengjiu Wang
2020-08-17 13:40 ` Shawn Guo
2020-08-17 13:44 S.j. Wang

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