devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] Fix sound on ASUS Transformers
@ 2023-03-27 15:02 Svyatoslav Ryhel
  2023-03-27 15:02 ` [PATCH v4 1/2] ARM: tegra: transformers: update WM8903 sound nodes Svyatoslav Ryhel
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Svyatoslav Ryhel @ 2023-03-27 15:02 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Thierry Reding, Jonathan Hunter,
	Svyatoslav Ryhel, Maxim Schwalm, Dmitry Osipenko
  Cc: devicetree, linux-kernel, linux-tegra

- update dts bindings

---
Changes from v3
- fixed typo in wm8903 audio-routing

Changes from v2
- dropped already picked patches
- adjustments in binding updates (tf101 and tf300t require wm8903
  codec patch to properly work with internal mic)

Changes from v1
- fm34 dropped for re-work
- quirk for headset detection and rt5631 bringup splitted
- minor adjustments in binding updates
- improvement of rt5631 rate asignment
---

Svyatoslav Ryhel (2):
  ARM: tegra: transformers: update WM8903 sound nodes
  ARM: tegra: transformers: bind RT5631 sound nodes

 arch/arm/boot/dts/tegra20-asus-tf101.dts        | 13 +++++++------
 arch/arm/boot/dts/tegra30-asus-tf201.dts        | 17 +++++++++++++++++
 arch/arm/boot/dts/tegra30-asus-tf300t.dts       |  6 ++----
 arch/arm/boot/dts/tegra30-asus-tf300tg.dts      | 17 +++++++++++++++++
 arch/arm/boot/dts/tegra30-asus-tf700t.dts       | 17 +++++++++++++++++
 .../dts/tegra30-asus-transformer-common.dtsi    |  9 +++++----
 6 files changed, 65 insertions(+), 14 deletions(-)

-- 
2.37.2


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

* [PATCH v4 1/2] ARM: tegra: transformers: update WM8903 sound nodes
  2023-03-27 15:02 [PATCH v4 0/2] Fix sound on ASUS Transformers Svyatoslav Ryhel
@ 2023-03-27 15:02 ` Svyatoslav Ryhel
  2023-03-28 11:21   ` Thierry Reding
  2023-03-27 15:02 ` [PATCH v4 2/2] ARM: tegra: transformers: bind RT5631 " Svyatoslav Ryhel
  2023-03-28 11:21 ` [PATCH v4 0/2] Fix sound on ASUS Transformers Thierry Reding
  2 siblings, 1 reply; 5+ messages in thread
From: Svyatoslav Ryhel @ 2023-03-27 15:02 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Thierry Reding, Jonathan Hunter,
	Svyatoslav Ryhel, Maxim Schwalm, Dmitry Osipenko
  Cc: devicetree, linux-kernel, linux-tegra

- fix headset detection in common device tree;
- use device GPIO mic detection on wm8903 transformers;

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
 arch/arm/boot/dts/tegra20-asus-tf101.dts            | 13 +++++++------
 arch/arm/boot/dts/tegra30-asus-tf300t.dts           |  6 ++----
 .../boot/dts/tegra30-asus-transformer-common.dtsi   |  9 +++++----
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/arch/arm/boot/dts/tegra20-asus-tf101.dts b/arch/arm/boot/dts/tegra20-asus-tf101.dts
index 7b2969656ec9..3f1da75a2736 100644
--- a/arch/arm/boot/dts/tegra20-asus-tf101.dts
+++ b/arch/arm/boot/dts/tegra20-asus-tf101.dts
@@ -520,10 +520,10 @@ wm8903: audio-codec@1a {
 			micdet-delay = <100>;
 
 			gpio-cfg = <
-				0xffffffff /* don't touch */
-				0xffffffff /* don't touch */
+				0x00000600 /* DMIC_LR, output */
+				0x00000680 /* DMIC_DAT, input */
 				0x00000000 /* Speaker-enable GPIO, output, low */
-				0x00000400 /* Mic bias current detect */
+				0xffffffff /* don't touch */
 				0xffffffff /* don't touch */
 			>;
 
@@ -1184,15 +1184,16 @@ sound {
 			"Int Spk", "RON",
 			"Int Spk", "LOP",
 			"Int Spk", "LON",
-			"Mic Jack", "MICBIAS",
-			"IN1L", "Mic Jack";
+			"IN2L", "Mic Jack",
+			"DMICDAT", "Int Mic";
 
 		nvidia,i2s-controller = <&tegra_i2s1>;
 		nvidia,audio-codec = <&wm8903>;
 
 		nvidia,spkr-en-gpios = <&wm8903 2 GPIO_ACTIVE_HIGH>;
 		nvidia,hp-det-gpios = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW>;
-		nvidia,headset;
+		nvidia,mic-det-gpios = <&gpio TEGRA_GPIO(X, 1) GPIO_ACTIVE_LOW>;
+		nvidia,coupled-mic-hp-det;
 
 		clocks = <&tegra_car TEGRA20_CLK_PLL_A>,
 			 <&tegra_car TEGRA20_CLK_PLL_A_OUT0>,
diff --git a/arch/arm/boot/dts/tegra30-asus-tf300t.dts b/arch/arm/boot/dts/tegra30-asus-tf300t.dts
index 506ae3626731..970a1f08dc8c 100644
--- a/arch/arm/boot/dts/tegra30-asus-tf300t.dts
+++ b/arch/arm/boot/dts/tegra30-asus-tf300t.dts
@@ -128,8 +128,8 @@ wm8903: audio-codec@1a {
 			micdet-delay = <100>;
 
 			gpio-cfg = <
-				0xffffffff /* don't touch */
-				0xffffffff /* don't touch */
+				0x00000600 /* DMIC_LR, output */
+				0x00000680 /* DMIC_DAT, input */
 				0x00000000 /* Speaker-enable GPIO, output, low */
 				0xffffffff /* don't touch */
 				0xffffffff /* don't touch */
@@ -1023,12 +1023,10 @@ sound {
 			"Int Spk", "RON",
 			"Int Spk", "LOP",
 			"Int Spk", "LON",
-			"IN1L", "Mic Jack",
 			"IN2L", "Mic Jack",
 			"DMICDAT", "Int Mic";
 
 		nvidia,audio-codec = <&wm8903>;
 		nvidia,spkr-en-gpios = <&wm8903 2 GPIO_ACTIVE_HIGH>;
-		nvidia,headset;
 	};
 };
diff --git a/arch/arm/boot/dts/tegra30-asus-transformer-common.dtsi b/arch/arm/boot/dts/tegra30-asus-transformer-common.dtsi
index 1861b2de2dc3..bdb898ad6262 100644
--- a/arch/arm/boot/dts/tegra30-asus-transformer-common.dtsi
+++ b/arch/arm/boot/dts/tegra30-asus-transformer-common.dtsi
@@ -558,7 +558,7 @@ spi1_mosi_px4 {
 				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
 			};
 
-			spi2_cs1_n_pw2 {
+			hp_detect {
 				nvidia,pins = "spi2_cs1_n_pw2";
 				nvidia,function = "spi2";
 				nvidia,pull = <TEGRA_PIN_PULL_UP>;
@@ -566,10 +566,10 @@ spi2_cs1_n_pw2 {
 				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
 			};
 
-			spi2_sck_px2 {
+			mic_detect {
 				nvidia,pins = "spi2_sck_px2";
 				nvidia,function = "spi2";
-				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
+				nvidia,pull = <TEGRA_PIN_PULL_UP>;
 				nvidia,tristate = <TEGRA_PIN_DISABLE>;
 				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
 			};
@@ -1674,7 +1674,8 @@ sound {
 		nvidia,i2s-controller = <&tegra_i2s1>;
 
 		nvidia,hp-det-gpios = <&gpio TEGRA_GPIO(W, 2) GPIO_ACTIVE_LOW>;
-		nvidia,hp-mute-gpios = <&gpio TEGRA_GPIO(X, 2) GPIO_ACTIVE_LOW>;
+		nvidia,mic-det-gpios = <&gpio TEGRA_GPIO(X, 2) GPIO_ACTIVE_LOW>;
+		nvidia,coupled-mic-hp-det;
 
 		clocks = <&tegra_car TEGRA30_CLK_PLL_A>,
 			 <&tegra_car TEGRA30_CLK_PLL_A_OUT0>,
-- 
2.37.2


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

* [PATCH v4 2/2] ARM: tegra: transformers: bind RT5631 sound nodes
  2023-03-27 15:02 [PATCH v4 0/2] Fix sound on ASUS Transformers Svyatoslav Ryhel
  2023-03-27 15:02 ` [PATCH v4 1/2] ARM: tegra: transformers: update WM8903 sound nodes Svyatoslav Ryhel
@ 2023-03-27 15:02 ` Svyatoslav Ryhel
  2023-03-28 11:21 ` [PATCH v4 0/2] Fix sound on ASUS Transformers Thierry Reding
  2 siblings, 0 replies; 5+ messages in thread
From: Svyatoslav Ryhel @ 2023-03-27 15:02 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Thierry Reding, Jonathan Hunter,
	Svyatoslav Ryhel, Maxim Schwalm, Dmitry Osipenko
  Cc: devicetree, linux-kernel, linux-tegra

TF201, TF300TG and TF700T support RT5631 codec.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
---
 arch/arm/boot/dts/tegra30-asus-tf201.dts   | 17 +++++++++++++++++
 arch/arm/boot/dts/tegra30-asus-tf300tg.dts | 17 +++++++++++++++++
 arch/arm/boot/dts/tegra30-asus-tf700t.dts  | 17 +++++++++++++++++
 3 files changed, 51 insertions(+)

diff --git a/arch/arm/boot/dts/tegra30-asus-tf201.dts b/arch/arm/boot/dts/tegra30-asus-tf201.dts
index 3c2b9e93e028..0406c5a69c12 100644
--- a/arch/arm/boot/dts/tegra30-asus-tf201.dts
+++ b/arch/arm/boot/dts/tegra30-asus-tf201.dts
@@ -624,4 +624,21 @@ opp-table-emc {
 		/delete-node/ opp-800000000-1300;
 		/delete-node/ opp-900000000-1350;
 	};
+
+	sound {
+		compatible = "asus,tegra-audio-rt5631-tf201",
+			     "nvidia,tegra-audio-rt5631";
+		nvidia,model = "Asus Transformer Prime TF201 RT5631";
+
+		nvidia,audio-routing =
+			"Headphone Jack", "HPOL",
+			"Headphone Jack", "HPOR",
+			"Int Spk", "SPOL",
+			"Int Spk", "SPOR",
+			"MIC1", "MIC Bias1",
+			"MIC Bias1", "Mic Jack",
+			"DMIC", "Int Mic";
+
+		nvidia,audio-codec = <&rt5631>;
+	};
 };
diff --git a/arch/arm/boot/dts/tegra30-asus-tf300tg.dts b/arch/arm/boot/dts/tegra30-asus-tf300tg.dts
index 573deeafb7ba..4861db8e1e59 100644
--- a/arch/arm/boot/dts/tegra30-asus-tf300tg.dts
+++ b/arch/arm/boot/dts/tegra30-asus-tf300tg.dts
@@ -1084,4 +1084,21 @@ opp-table-actmon {
 		/delete-node/ opp-800000000;
 		/delete-node/ opp-900000000;
 	};
+
+	sound {
+		compatible = "asus,tegra-audio-rt5631-tf300tg",
+			     "nvidia,tegra-audio-rt5631";
+		nvidia,model = "Asus Transformer Pad TF300TG RT5631";
+
+		nvidia,audio-routing =
+			"Headphone Jack", "HPOL",
+			"Headphone Jack", "HPOR",
+			"Int Spk", "SPOL",
+			"Int Spk", "SPOR",
+			"MIC1", "MIC Bias1",
+			"MIC Bias1", "Mic Jack",
+			"DMIC", "Int Mic";
+
+		nvidia,audio-codec = <&rt5631>;
+	};
 };
diff --git a/arch/arm/boot/dts/tegra30-asus-tf700t.dts b/arch/arm/boot/dts/tegra30-asus-tf700t.dts
index e7fe8c7a7435..efde7dad718a 100644
--- a/arch/arm/boot/dts/tegra30-asus-tf700t.dts
+++ b/arch/arm/boot/dts/tegra30-asus-tf700t.dts
@@ -820,4 +820,21 @@ vdd_1v2_mipi: regulator-mipi {
 		enable-active-high;
 		vin-supply = <&vdd_3v3_sys>;
 	};
+
+	sound {
+		compatible = "asus,tegra-audio-rt5631-tf700t",
+			     "nvidia,tegra-audio-rt5631";
+		nvidia,model = "Asus Transformer Infinity TF700T RT5631";
+
+		nvidia,audio-routing =
+			"Headphone Jack", "HPOL",
+			"Headphone Jack", "HPOR",
+			"Int Spk", "SPOL",
+			"Int Spk", "SPOR",
+			"MIC1", "MIC Bias1",
+			"MIC Bias1", "Mic Jack",
+			"DMIC", "Int Mic";
+
+		nvidia,audio-codec = <&rt5631>;
+	};
 };
-- 
2.37.2


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

* Re: [PATCH v4 1/2] ARM: tegra: transformers: update WM8903 sound nodes
  2023-03-27 15:02 ` [PATCH v4 1/2] ARM: tegra: transformers: update WM8903 sound nodes Svyatoslav Ryhel
@ 2023-03-28 11:21   ` Thierry Reding
  0 siblings, 0 replies; 5+ messages in thread
From: Thierry Reding @ 2023-03-28 11:21 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Rob Herring, Krzysztof Kozlowski, Jonathan Hunter, Maxim Schwalm,
	Dmitry Osipenko, devicetree, linux-kernel, linux-tegra

[-- Attachment #1: Type: text/plain, Size: 820 bytes --]

On Mon, Mar 27, 2023 at 06:02:18PM +0300, Svyatoslav Ryhel wrote:
> - fix headset detection in common device tree;
> - use device GPIO mic detection on wm8903 transformers;
> 
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> ---
>  arch/arm/boot/dts/tegra20-asus-tf101.dts            | 13 +++++++------
>  arch/arm/boot/dts/tegra30-asus-tf300t.dts           |  6 ++----
>  .../boot/dts/tegra30-asus-transformer-common.dtsi   |  9 +++++----
>  3 files changed, 14 insertions(+), 14 deletions(-)

If you feel compelled to create a list of things you've changed in the
commit message, it often indicates that you should be creating separate
patches for each list item. Not a huge deal in this case because this
is all about fixing audio, but something to keep in mind for future
patches.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v4 0/2] Fix sound on ASUS Transformers
  2023-03-27 15:02 [PATCH v4 0/2] Fix sound on ASUS Transformers Svyatoslav Ryhel
  2023-03-27 15:02 ` [PATCH v4 1/2] ARM: tegra: transformers: update WM8903 sound nodes Svyatoslav Ryhel
  2023-03-27 15:02 ` [PATCH v4 2/2] ARM: tegra: transformers: bind RT5631 " Svyatoslav Ryhel
@ 2023-03-28 11:21 ` Thierry Reding
  2 siblings, 0 replies; 5+ messages in thread
From: Thierry Reding @ 2023-03-28 11:21 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Rob Herring, Krzysztof Kozlowski, Jonathan Hunter, Maxim Schwalm,
	Dmitry Osipenko, devicetree, linux-kernel, linux-tegra

[-- Attachment #1: Type: text/plain, Size: 781 bytes --]

On Mon, Mar 27, 2023 at 06:02:17PM +0300, Svyatoslav Ryhel wrote:
> - update dts bindings
> 
> ---
> Changes from v3
> - fixed typo in wm8903 audio-routing
> 
> Changes from v2
> - dropped already picked patches
> - adjustments in binding updates (tf101 and tf300t require wm8903
>   codec patch to properly work with internal mic)
> 
> Changes from v1
> - fm34 dropped for re-work
> - quirk for headset detection and rt5631 bringup splitted
> - minor adjustments in binding updates
> - improvement of rt5631 rate asignment
> ---
> 
> Svyatoslav Ryhel (2):
>   ARM: tegra: transformers: update WM8903 sound nodes
>   ARM: tegra: transformers: bind RT5631 sound nodes

Applied, with a slightly modified commit message on the first patch.

Thanks,
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2023-03-28 11:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-27 15:02 [PATCH v4 0/2] Fix sound on ASUS Transformers Svyatoslav Ryhel
2023-03-27 15:02 ` [PATCH v4 1/2] ARM: tegra: transformers: update WM8903 sound nodes Svyatoslav Ryhel
2023-03-28 11:21   ` Thierry Reding
2023-03-27 15:02 ` [PATCH v4 2/2] ARM: tegra: transformers: bind RT5631 " Svyatoslav Ryhel
2023-03-28 11:21 ` [PATCH v4 0/2] Fix sound on ASUS Transformers Thierry Reding

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