linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Add headphone detection for sound card
@ 2020-08-24  7:50 Shengjiu Wang
  2020-08-24  7:50 ` [PATCH v2 1/3] ARM: dts: imx6sx-sdb: " Shengjiu Wang
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Shengjiu Wang @ 2020-08-24  7:50 UTC (permalink / raw)
  To: robh+dt, shawnguo, s.hauer, kernel, festevam, linux-imx,
	devicetree, linux-kernel, linux-arm-kernel

Add headphone detection for sound card
and add audio sound card node for imx6sll.

Shengjiu Wang (3):
  ARM: dts: imx6sx-sdb: Add headphone detection for sound card
  ARM: dts: imx6sl-evk: Add headphone detection for sound card
  ARM: dts: imx6sll-evk: Add audio sound card node

changes in v2
- add pinctrl_hp, don't add headphone detect GPIO in hog group

 arch/arm/boot/dts/imx6sl-evk.dts  |  9 ++++
 arch/arm/boot/dts/imx6sll-evk.dts | 73 +++++++++++++++++++++++++++++++
 arch/arm/boot/dts/imx6sx-sdb.dtsi |  9 ++++
 3 files changed, 91 insertions(+)

-- 
2.27.0


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

* [PATCH v2 1/3] ARM: dts: imx6sx-sdb: Add headphone detection for sound card
  2020-08-24  7:50 [PATCH v2 0/3] Add headphone detection for sound card Shengjiu Wang
@ 2020-08-24  7:50 ` Shengjiu Wang
  2020-08-24  7:50 ` [PATCH v2 2/3] ARM: dts: imx6sl-evk: " Shengjiu Wang
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Shengjiu Wang @ 2020-08-24  7:50 UTC (permalink / raw)
  To: robh+dt, shawnguo, s.hauer, kernel, festevam, linux-imx,
	devicetree, linux-kernel, linux-arm-kernel

Headphone detection is triggered by GPIO, then driver can
switch between speaker and headphone.

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

diff --git a/arch/arm/boot/dts/imx6sx-sdb.dtsi b/arch/arm/boot/dts/imx6sx-sdb.dtsi
index b8c23eba9dc7..1351d7f70a54 100644
--- a/arch/arm/boot/dts/imx6sx-sdb.dtsi
+++ b/arch/arm/boot/dts/imx6sx-sdb.dtsi
@@ -153,6 +153,8 @@ reg_can_stby: regulator-can-stby {
 
 	sound {
 		compatible = "fsl,imx6sx-sdb-wm8962", "fsl,imx-audio-wm8962";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_hp>;
 		model = "wm8962-audio";
 		ssi-controller = <&ssi2>;
 		audio-codec = <&codec>;
@@ -165,6 +167,7 @@ sound {
 			"IN3R", "AMIC";
 		mux-int-port = <2>;
 		mux-ext-port = <6>;
+		hp-det-gpio = <&gpio1 17 GPIO_ACTIVE_LOW>;
 	};
 
 	panel {
@@ -468,6 +471,12 @@ MX6SX_PAD_CSI_DATA05__GPIO1_IO_19 0x17059
 			>;
 		};
 
+		pinctrl_hp: hpgrp {
+			fsl,pins = <
+				MX6SX_PAD_CSI_DATA03__GPIO1_IO_17 0x17059
+			>;
+		};
+
 		pinctrl_i2c1: i2c1grp {
 			fsl,pins = <
 				MX6SX_PAD_GPIO1_IO01__I2C1_SDA		0x4001b8b1
-- 
2.27.0


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

* [PATCH v2 2/3] ARM: dts: imx6sl-evk: Add headphone detection for sound card
  2020-08-24  7:50 [PATCH v2 0/3] Add headphone detection for sound card Shengjiu Wang
  2020-08-24  7:50 ` [PATCH v2 1/3] ARM: dts: imx6sx-sdb: " Shengjiu Wang
@ 2020-08-24  7:50 ` Shengjiu Wang
  2020-08-24  7:50 ` [PATCH v2 3/3] ARM: dts: imx6sll-evk: Add audio sound card node Shengjiu Wang
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Shengjiu Wang @ 2020-08-24  7:50 UTC (permalink / raw)
  To: robh+dt, shawnguo, s.hauer, kernel, festevam, linux-imx,
	devicetree, linux-kernel, linux-arm-kernel

Headphone detection is triggered by GPIO, then driver can
switch between speaker and headphone.

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

diff --git a/arch/arm/boot/dts/imx6sl-evk.dts b/arch/arm/boot/dts/imx6sl-evk.dts
index b1b069e723d2..ee6e477bfe82 100644
--- a/arch/arm/boot/dts/imx6sl-evk.dts
+++ b/arch/arm/boot/dts/imx6sl-evk.dts
@@ -94,6 +94,8 @@ reg_lcd_5v: regulator-lcd-5v {
 
 	sound {
 		compatible = "fsl,imx6sl-evk-wm8962", "fsl,imx-audio-wm8962";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_hp>;
 		model = "wm8962-audio";
 		ssi-controller = <&ssi2>;
 		audio-codec = <&codec>;
@@ -106,6 +108,7 @@ sound {
 			"IN3R", "AMIC";
 		mux-int-port = <2>;
 		mux-ext-port = <3>;
+		hp-det-gpio = <&gpio4 19 GPIO_ACTIVE_LOW>;
 	};
 
 	panel {
@@ -343,6 +346,12 @@ MX6SL_PAD_FEC_REF_CLK__GPIO4_IO26  0x3080
 			>;
 		};
 
+		pinctrl_hp: hpgrp {
+			fsl,pins = <
+				MX6SL_PAD_FEC_RX_ER__GPIO4_IO19	  0x1b0b0
+			>;
+		};
+
 		pinctrl_i2c1: i2c1grp {
 			fsl,pins = <
 				MX6SL_PAD_I2C1_SCL__I2C1_SCL	0x4001b8b1
-- 
2.27.0


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

* [PATCH v2 3/3] ARM: dts: imx6sll-evk: Add audio sound card node
  2020-08-24  7:50 [PATCH v2 0/3] Add headphone detection for sound card Shengjiu Wang
  2020-08-24  7:50 ` [PATCH v2 1/3] ARM: dts: imx6sx-sdb: " Shengjiu Wang
  2020-08-24  7:50 ` [PATCH v2 2/3] ARM: dts: imx6sl-evk: " Shengjiu Wang
@ 2020-08-24  7:50 ` Shengjiu Wang
  2020-08-24 13:41 ` [PATCH v2 0/3] Add headphone detection for sound card Fabio Estevam
  2020-08-31  2:30 ` Shawn Guo
  4 siblings, 0 replies; 6+ messages in thread
From: Shengjiu Wang @ 2020-08-24  7:50 UTC (permalink / raw)
  To: robh+dt, shawnguo, s.hauer, kernel, festevam, linux-imx,
	devicetree, linux-kernel, linux-arm-kernel

Add audio sound card node, which depends on codec node,
SSI node, audmux node.

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

diff --git a/arch/arm/boot/dts/imx6sll-evk.dts b/arch/arm/boot/dts/imx6sll-evk.dts
index c755cbdb7cde..32b3d82fec53 100644
--- a/arch/arm/boot/dts/imx6sll-evk.dts
+++ b/arch/arm/boot/dts/imx6sll-evk.dts
@@ -132,6 +132,31 @@ panel_in: endpoint {
 			};
 		};
 	};
+
+	sound {
+		compatible = "fsl,imx6sl-evk-wm8962", "fsl,imx-audio-wm8962";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_hp>;
+		model = "wm8962-audio";
+		audio-cpu = <&ssi2>;
+		audio-codec = <&wm8962>;
+		audio-routing =
+			"Headphone Jack", "HPOUTL",
+			"Headphone Jack", "HPOUTR",
+			"Ext Spk", "SPKOUTL",
+			"Ext Spk", "SPKOUTR",
+			"AMIC", "MICBIAS",
+			"IN3R", "AMIC";
+		mux-int-port = <2>;
+		mux-ext-port = <3>;
+		hp-det-gpio = <&gpio4 24 GPIO_ACTIVE_LOW>;
+	};
+};
+
+&audmux {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_audmux3>;
+	status = "okay";
 };
 
 &cpu0 {
@@ -247,6 +272,27 @@ vgen6_reg: vgen6 {
 	};
 };
 
+&i2c3 {
+	clock-frequency = <100000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c3>;
+	status = "okay";
+
+	wm8962: audio-codec@1a {
+		compatible = "wlf,wm8962";
+		reg = <0x1a>;
+		clocks = <&clks IMX6SLL_CLK_EXTERN_AUDIO>;
+		DCVDD-supply = <&vgen3_reg>;
+		DBVDD-supply = <&reg_aud3v>;
+		AVDD-supply = <&vgen3_reg>;
+		CPVDD-supply = <&vgen3_reg>;
+		MICVDD-supply = <&reg_aud3v>;
+		PLLVDD-supply = <&vgen3_reg>;
+		SPKVDD1-supply = <&reg_aud4v>;
+		SPKVDD2-supply = <&reg_aud4v>;
+	};
+};
+
 &lcdif {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_lcd>;
@@ -274,6 +320,10 @@ &snvs_pwrkey {
 	status = "okay";
 };
 
+&ssi2 {
+	status = "okay";
+};
+
 &uart1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart1>;
@@ -330,6 +380,22 @@ &wdog1 {
 };
 
 &iomuxc {
+	pinctrl_audmux3: audmux3grp {
+		fsl,pins = <
+			MX6SLL_PAD_AUD_TXC__AUD3_TXC		0x4130b0
+			MX6SLL_PAD_AUD_TXFS__AUD3_TXFS		0x4130b0
+			MX6SLL_PAD_AUD_TXD__AUD3_TXD		0x4110b0
+			MX6SLL_PAD_AUD_RXD__AUD3_RXD		0x4130b0
+			MX6SLL_PAD_AUD_MCLK__AUDIO_CLK_OUT	0x4130b0
+		>;
+	};
+
+	pinctrl_hp: hpgrp {
+		fsl,pins = <
+			MX6SLL_PAD_GPIO4_IO24__GPIO4_IO24 0x17059 /* HP DETECT */
+		>;
+	};
+
 	pinctrl_reg_sd3_vmmc: sd3vmmcgrp {
 		fsl,pins = <
 			MX6SLL_PAD_KEY_COL6__GPIO4_IO04 0x17059
@@ -449,6 +515,13 @@ MX6SLL_PAD_I2C1_SDA__I2C1_SDA	 0x4001b8b1
 		>;
 	};
 
+	pinctrl_i2c3: i2c3grp {
+		fsl,pins = <
+			MX6SLL_PAD_AUD_RXFS__I2C3_SCL  0x4041b8b1
+			MX6SLL_PAD_AUD_RXC__I2C3_SDA   0x4041b8b1
+		>;
+	};
+
 	pinctrl_lcd: lcdgrp {
 		fsl,pins = <
 			MX6SLL_PAD_LCD_DATA00__LCD_DATA00	0x79
-- 
2.27.0


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

* Re: [PATCH v2 0/3] Add headphone detection for sound card
  2020-08-24  7:50 [PATCH v2 0/3] Add headphone detection for sound card Shengjiu Wang
                   ` (2 preceding siblings ...)
  2020-08-24  7:50 ` [PATCH v2 3/3] ARM: dts: imx6sll-evk: Add audio sound card node Shengjiu Wang
@ 2020-08-24 13:41 ` Fabio Estevam
  2020-08-31  2:30 ` Shawn Guo
  4 siblings, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2020-08-24 13:41 UTC (permalink / raw)
  To: Shengjiu Wang
  Cc: Rob Herring, Shawn Guo, Sascha Hauer, Sascha Hauer,
	NXP Linux Team,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

Hi Wang,

On Mon, Aug 24, 2020 at 4:56 AM Shengjiu Wang <shengjiu.wang@nxp.com> wrote:
>
> Add headphone detection for sound card
> and add audio sound card node for imx6sll.
>
> Shengjiu Wang (3):
>   ARM: dts: imx6sx-sdb: Add headphone detection for sound card
>   ARM: dts: imx6sl-evk: Add headphone detection for sound card
>   ARM: dts: imx6sll-evk: Add audio sound card node
>
> changes in v2
> - add pinctrl_hp, don't add headphone detect GPIO in hog group

Series looks good now:

Reviewed-by: Fabio Estevam <festevam@gmail.com>

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

* Re: [PATCH v2 0/3] Add headphone detection for sound card
  2020-08-24  7:50 [PATCH v2 0/3] Add headphone detection for sound card Shengjiu Wang
                   ` (3 preceding siblings ...)
  2020-08-24 13:41 ` [PATCH v2 0/3] Add headphone detection for sound card Fabio Estevam
@ 2020-08-31  2:30 ` Shawn Guo
  4 siblings, 0 replies; 6+ messages in thread
From: Shawn Guo @ 2020-08-31  2:30 UTC (permalink / raw)
  To: Shengjiu Wang
  Cc: robh+dt, s.hauer, kernel, festevam, linux-imx, devicetree,
	linux-kernel, linux-arm-kernel

On Mon, Aug 24, 2020 at 03:50:36PM +0800, Shengjiu Wang wrote:
> Add headphone detection for sound card
> and add audio sound card node for imx6sll.
> 
> Shengjiu Wang (3):
>   ARM: dts: imx6sx-sdb: Add headphone detection for sound card
>   ARM: dts: imx6sl-evk: Add headphone detection for sound card
>   ARM: dts: imx6sll-evk: Add audio sound card node

Applied all, thanks.

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

end of thread, other threads:[~2020-08-31  2:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-24  7:50 [PATCH v2 0/3] Add headphone detection for sound card Shengjiu Wang
2020-08-24  7:50 ` [PATCH v2 1/3] ARM: dts: imx6sx-sdb: " Shengjiu Wang
2020-08-24  7:50 ` [PATCH v2 2/3] ARM: dts: imx6sl-evk: " Shengjiu Wang
2020-08-24  7:50 ` [PATCH v2 3/3] ARM: dts: imx6sll-evk: Add audio sound card node Shengjiu Wang
2020-08-24 13:41 ` [PATCH v2 0/3] Add headphone detection for sound card Fabio Estevam
2020-08-31  2:30 ` Shawn Guo

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