Skip to contentSkip to conversation

arm64: dts: meson: add internal audio DAC support

PATCH Applied Jerome Brunet 3 participants 10 messages May 6, 2020 – May 20, 2020

Subsystems (2)
lore
Share & tools
lore

Jerome Brunet

author reviewer
#0 lore raw

cover arm64: dts: meson: add internal audio DAC support

This patchset adds support for the internal audio DAC found on the gxl, g12 and sm1 SoC family.

It was mainly tested on the gxl libretech-cc and g12a u200.

/!\
This series (patches 1 in particular) depends on this reset binding [0]. Philipp has provided an immutable with it here [1]

[0]: https://lore.kernel.org/r/[email protected]
[1]: git://git.pengutronix.de/pza/linux.git reset/meson-gxl-dac

Jerome Brunet (7):
arm64: dts: meson: gxl: add acodec support
arm64: dts: meson: p230-q200: add internal DAC support
arm64: dts: meson: libretech-cc: add internal DAC support
arm64: dts: meson: libretech-ac: add internal DAC support
arm64: dts: meson: libretech-pc: add internal DAC support
arm64: dts: meson: g12: add internal DAC
arm64: dts: meson: g12: add internal DAC glue

 .../boot/dts/amlogic/meson-g12-common.dtsi    | 11 +++++++
 arch/arm64/boot/dts/amlogic/meson-g12.dtsi    |  9 ++++++
 .../dts/amlogic/meson-gx-libretech-pc.dtsi    | 31 ++++++++++++++++++
 .../boot/dts/amlogic/meson-gx-p23x-q20x.dtsi  | 32 +++++++++++++++++++
 .../amlogic/meson-gxl-s805x-libretech-ac.dts  | 30 +++++++++++++++++
 .../amlogic/meson-gxl-s905x-libretech-cc.dts  | 30 +++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi    | 11 +++++++
 7 files changed, 154 insertions(+)
Signature · 1 line
2.25.4
author reviewer
#1 lore raw

PATCH 1/7 arm64: dts: meson: gxl: add acodec support

Add the internal audio DAC to the gxl SoC DT

---
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +11 -0
index 44c0371f63ca..fc59c8534c0f 100644
@@ -54,6 +54,17 @@ dwc3: usb@c9000000 {
 			};
 		};
 
+		acodec: audio-controller@c8832000 {
+			compatible = "amlogic,t9015";
+			reg = <0x0 0xc8832000 0x0 0x14>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "ACODEC";
+			clocks = <&clkc CLKID_ACODEC>;
+			clock-names = "pclk";
+			resets = <&reset RESET_ACODEC>;
+			status = "disabled";
+		};
+
 		crypto: crypto@c883e000 {
 			compatible = "amlogic,gxl-crypto";
 			reg = <0x0 0xc883e000 0x0 0x36>;
Signature · 1 line
2.25.4
author reviewer
#2 lore raw

PATCH 2/7 arm64: dts: meson: p230-q200: add internal DAC support

In reply to Jerome Brunet

Add the necessary bits to support the internal audio DAC the p230/q200 reference design derivated boards. The output of this DAC is provided on the 3.5mm jack connector

---
 .../boot/dts/amlogic/meson-gx-p23x-q20x.dtsi  | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +32 -0
index acb05a756aca..6b57e15aade3 100644
@@ -16,6 +16,13 @@ aliases {
 		ethernet0 = &ethmac;
 	};
 
+	dio2133: analog-amplifier {
+		compatible = "simple-audio-amplifier";
+		sound-name-prefix = "AU2";
+		VCC-supply = <&hdmi_5v>;
+		enable-gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
+	};
+
 	spdif_dit: audio-codec-0 {
 		#sound-dai-cells = <0>;
 		compatible = "linux,spdif-dit";
@@ -115,6 +122,14 @@ hdmi_connector_in: endpoint {
 	sound {
 		compatible = "amlogic,gx-sound-card";
 		model = "GX-P230-Q200";
+		audio-aux-devs = <&dio2133>;
+		audio-widgets = "Line", "Lineout";
+		audio-routing = "AU2 INL", "ACODEC LOLP",
+				"AU2 INR", "ACODEC LORP",
+				"AU2 INL", "ACODEC LOLN",
+				"AU2 INR", "ACODEC LORN",
+				"Lineout", "AU2 OUTL",
+				"Lineout", "AU2 OUTR";
 		assigned-clocks = <&clkc CLKID_MPLL0>,
 				  <&clkc CLKID_MPLL1>,
 				  <&clkc CLKID_MPLL2>;
@@ -140,6 +155,10 @@ dai-link-2 {
 			codec-0 {
 				sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
 			};
+
+			codec-1 {
+				sound-dai = <&aiu AIU_ACODEC CTRL_I2S>;
+			};
 		};
 
 		dai-link-3 {
@@ -157,9 +176,22 @@ codec-0 {
 				sound-dai = <&hdmi_tx>;
 			};
 		};
+
+		dai-link-5 {
+			sound-dai = <&aiu AIU_ACODEC CTRL_OUT>;
+
+			codec-0 {
+				sound-dai = <&acodec>;
+			};
+		};
 	};
 };
 
+&acodec {
+	AVDD-supply = <&vddio_ao18>;
+	status = "okay";
+};
+
 &aiu {
 	status = "okay";
 	pinctrl-0 = <&spdif_out_h_pins>;
Signature · 1 line
2.25.4
author reviewer
#3 lore raw

PATCH 3/7 arm64: dts: meson: libretech-cc: add internal DAC support

In reply to Jerome Brunet

Add the internal DAC support on the libretech CC. The output of this DAC is provided on the 3.5mm jack connector.

---
 .../amlogic/meson-gxl-s905x-libretech-cc.dts  | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts +30 -0
index d81382b36049..5ae7bb6209cb 100644
@@ -22,6 +22,13 @@ aliases {
 		ethernet0 = &ethmac;
 	};
 
+	dio2133: analog-amplifier {
+		compatible = "simple-audio-amplifier";
+		sound-name-prefix = "AU2";
+		VCC-supply = <&hdmi_5v>;
+		enable-gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
+	};
+
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
@@ -129,6 +136,12 @@ vddio_boot: regulator-vddio_boot {
 	sound {
 		compatible = "amlogic,gx-sound-card";
 		model = "GXL-LIBRETECH-S905X-CC";
+		audio-aux-devs = <&dio2133>;
+		audio-widgets = "Line", "Lineout";
+		audio-routing = "AU2 INL", "ACODEC LOLN",
+				"AU2 INR", "ACODEC LORN",
+				"Lineout", "AU2 OUTL",
+				"Lineout", "AU2 OUTR";
 		assigned-clocks = <&clkc CLKID_MPLL0>,
 				  <&clkc CLKID_MPLL1>,
 				  <&clkc CLKID_MPLL2>;
@@ -150,6 +163,10 @@ dai-link-1 {
 			codec-0 {
 				sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
 			};
+
+			codec-1 {
+				sound-dai = <&aiu AIU_ACODEC CTRL_I2S>;
+			};
 		};
 
 		dai-link-2 {
@@ -159,9 +176,22 @@ codec-0 {
 				sound-dai = <&hdmi_tx>;
 			};
 		};
+
+		dai-link-3 {
+			sound-dai = <&aiu AIU_ACODEC CTRL_OUT>;
+
+			codec-0 {
+				sound-dai = <&acodec>;
+			};
+		};
 	};
 };
 
+&acodec {
+	AVDD-supply = <&vddio_ao18>;
+	status = "okay";
+};
+
 &aiu {
 	status = "okay";
 };
Signature · 7 lines
2.25.4


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
author reviewer
#4 lore raw

PATCH 4/7 arm64: dts: meson: libretech-ac: add internal DAC support

In reply to Jerome Brunet

Add the internal DAC support on the libretech CC. The output of this DAC is provided on the 9J5 connector.

---
 .../amlogic/meson-gxl-s805x-libretech-ac.dts  | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxl-s805x-libretech-ac.dts +30 -0
index 6e0984269662..6a226faab183 100644
@@ -98,6 +98,15 @@ vcc_3v3: regulator-vcc_3v3 {
 		regulator-always-on;
 	};
 
+	vddio_ao18: regulator-vddio_ao18 {
+		compatible = "regulator-fixed";
+		regulator-name = "VDDIO_AO18";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc_3v3>;
+		regulator-always-on;
+	};
+
 	vddio_boot: regulator-vddio_boot {
 		compatible = "regulator-fixed";
 		regulator-name = "VDDIO_BOOT";
@@ -110,6 +119,10 @@ vddio_boot: regulator-vddio_boot {
 	sound {
 		compatible = "amlogic,gx-sound-card";
 		model = "GXL-LIBRETECH-S805X-AC";
+		audio-widgets = "Speaker", "9J5-3 LEFT",
+				"Speaker", "9J5-2 RIGHT";
+		audio-routing = "9J5-3 LEFT", "ACODEC LOLN",
+				"9J5-2 RIGHT", "ACODEC LORN";
 		assigned-clocks = <&clkc CLKID_MPLL0>,
 				  <&clkc CLKID_MPLL1>,
 				  <&clkc CLKID_MPLL2>;
@@ -131,6 +144,10 @@ dai-link-1 {
 			codec-0 {
 				sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
 			};
+
+			codec-1 {
+				sound-dai = <&aiu AIU_ACODEC CTRL_I2S>;
+			};
 		};
 
 		dai-link-2 {
@@ -140,9 +157,22 @@ codec-0 {
 				sound-dai = <&hdmi_tx>;
 			};
 		};
+
+		dai-link-3 {
+			sound-dai = <&aiu AIU_ACODEC CTRL_OUT>;
+
+			codec-0 {
+				sound-dai = <&acodec>;
+			};
+		};
 	};
 };
 
+&acodec {
+	AVDD-supply = <&vddio_ao18>;
+	status = "okay";
+};
+
 &aiu {
 	status = "okay";
 };
Signature · 1 line
2.25.4
author reviewer
#5 lore raw

PATCH 5/7 arm64: dts: meson: libretech-pc: add internal DAC support

In reply to Jerome Brunet

Add the internal DAC support on the libretech CC. The output of this DAC is provided on the 9J4 connector.

---
 .../dts/amlogic/meson-gx-libretech-pc.dtsi    | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gx-libretech-pc.dtsi +31 -0
index 514fed57a5ce..c2480bab8d33 100644
@@ -30,6 +30,13 @@ aliases {
 		spi0 = &spifc;
 	};
 
+	dio2133: analog-amplifier {
+		compatible = "simple-audio-amplifier";
+		sound-name-prefix = "AU2";
+		VCC-supply = <&vcc5v>;
+		enable-gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>;
+	};
+
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
@@ -180,6 +187,13 @@ vddio_card: regulator-vddio-card {
 	sound {
 		compatible = "amlogic,gx-sound-card";
 		model = "GXL-LIBRETECH-S9XX-PC";
+		audio-aux-devs = <&dio2133>;
+		audio-widgets = "Speaker", "7J4-14 LEFT",
+				"Speaker", "7J4-11 RIGHT";
+		audio-routing = "AU2 INL", "ACODEC LOLN",
+				"AU2 INR", "ACODEC LORN",
+				"7J4-14 LEFT", "AU2 OUTL",
+				"7J4-11 RIGHT", "AU2 OUTR";
 		assigned-clocks = <&clkc CLKID_MPLL0>,
 				  <&clkc CLKID_MPLL1>,
 				  <&clkc CLKID_MPLL2>;
@@ -201,6 +215,10 @@ dai-link-1 {
 			codec-0 {
 				sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
 			};
+
+			codec-1 {
+				sound-dai = <&aiu AIU_ACODEC CTRL_I2S>;
+			};
 		};
 
 		dai-link-2 {
@@ -210,9 +228,22 @@ codec-0 {
 				sound-dai = <&hdmi_tx>;
 			};
 		};
+
+		dai-link-3 {
+			sound-dai = <&aiu AIU_ACODEC CTRL_OUT>;
+
+			codec-0 {
+				sound-dai = <&acodec>;
+			};
+		};
 	};
 };
 
+&acodec {
+	AVDD-supply = <&vddio_ao18>;
+	status = "okay";
+};
+
 &aiu {
 	status = "okay";
 };
Signature · 1 line
2.25.4
author reviewer
#6 lore raw

PATCH 6/7 arm64: dts: meson: g12: add internal DAC

In reply to Jerome Brunet

add internal audio DAC support on the g12 and sm1 SoC family

---
 arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +11 -0
index c0aef7d69117..593a006f4b7b 100644
@@ -250,6 +250,17 @@ hwrng: rng@218 {
 				};
 			};
 
+			acodec: audio-controller@32000 {
+				compatible = "amlogic,t9015";
+				reg = <0x0 0x32000 0x0 0x14>;
+				#sound-dai-cells = <0>;
+				sound-name-prefix = "ACODEC";
+				clocks = <&clkc CLKID_AUDIO_CODEC>;
+				clock-names = "pclk";
+				resets = <&reset RESET_AUDIO_CODEC>;
+				status = "disabled";
+			};
+
 			periphs: bus@34400 {
 				compatible = "simple-bus";
 				reg = <0x0 0x34400 0x0 0x400>;
Signature · 1 line
2.25.4
author reviewer
#7 lore raw

PATCH 7/7 arm64: dts: meson: g12: add internal DAC glue

In reply to Jerome Brunet

add the internal DAC glue support on the g12 and sm1 family This glue connects the different TDM interfaces of the SoC to the internal audio DAC codec.

---
 arch/arm64/boot/dts/amlogic/meson-g12.dtsi | 9 +++++++++
 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12.dtsi +9 -0
index 55d39020ec72..0d14409f509c 100644
@@ -343,6 +343,15 @@ spdifout_b: audio-controller@680 {
 			status = "disabled";
 		};
 
+		toacodec: audio-controller@740 {
+			compatible = "amlogic,g12a-toacodec";
+			reg = <0x0 0x740 0x0 0x4>;
+			#sound-dai-cells = <1>;
+			sound-name-prefix = "TOACODEC";
+			resets = <&clkc_audio AUD_RESET_TOACODEC>;
+			status = "disabled";
+		};
+
 		tohdmitx: audio-controller@744 {
 			compatible = "amlogic,g12a-tohdmitx";
 			reg = <0x0 0x744 0x0 0x4>;
Signature · 1 line
2.25.4
#8 lore raw
In reply to Jerome Brunet
This series was applied to khilman/linux-amlogic.git (refs/heads/for-next).

Hello:

This series was applied to khilman/linux-amlogic.git (refs/heads/for-next).

Quoted 10 lines · On Thu, 7 May 2020 00:16:49 +0200 you wrote:

This patchset adds support for the internal audio DAC found on the gxl, g12 and sm1 SoC family.

It was mainly tested on the gxl libretech-cc and g12a u200.

/!\
This series (patches 1 in particular) depends on this reset binding [0]. Philipp has provided an immutable with it here [1]

[...]

Here is a summary with links:
- [1/7] arm64: dts: meson: gxl: add acodec support

    https://git.kernel.org/khilman/linux-amlogic/c/a66d4ae3144a18476626dd8de8b8dff5f523daee
  - [2/7] arm64: dts: meson: p230-q200: add internal DAC support
    https://git.kernel.org/khilman/linux-amlogic/c/f3c35382259f67c2ae878de2142fb58b94df0525
  - [3/7] arm64: dts: meson: libretech-cc: add internal DAC support
    https://git.kernel.org/khilman/linux-amlogic/c/249ce3777c25b383702e91a6547ffc676dc004a5
  - [4/7] arm64: dts: meson: libretech-ac: add internal DAC support
    https://git.kernel.org/khilman/linux-amlogic/c/451323f8bc9e9b701b87b4598ec1cac8eff82d15
  - [5/7] arm64: dts: meson: libretech-pc: add internal DAC support
    https://git.kernel.org/khilman/linux-amlogic/c/2989a2d6c7f36da2bddffdb293bdf123e735d5f7
  - [6/7] arm64: dts: meson: g12: add internal DAC
    https://git.kernel.org/khilman/linux-amlogic/c/457fa78771a23ecedf3bcd9ce9946a5183472ff6
  - [7/7] arm64: dts: meson: g12: add internal DAC glue
    https://git.kernel.org/khilman/linux-amlogic/c/dbffd7f9bdb463437d3c3f7c3e1bd4379a785fe4

You are awesome, thank you!

Signature · 7 lines
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/pwbot

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
maintainer Applied
#9 lore raw
In reply to Jerome Brunet
Quoted 10 lines · Jerome Brunet

This patchset adds support for the internal audio DAC found on the gxl, g12 and sm1 SoC family.

It was mainly tested on the gxl libretech-cc and g12a u200.

/!\
This series (patches 1 in particular) depends on this reset binding [0]. Philipp has provided an immutable with it here [1]

[...]

Applied, thanks!

[1/7] arm64: dts: meson: gxl: add acodec support

      commit: a66d4ae3144a18476626dd8de8b8dff5f523daee
[2/7] arm64: dts: meson: p230-q200: add internal DAC support
      commit: f3c35382259f67c2ae878de2142fb58b94df0525
[3/7] arm64: dts: meson: libretech-cc: add internal DAC support
      commit: 249ce3777c25b383702e91a6547ffc676dc004a5
[4/7] arm64: dts: meson: libretech-ac: add internal DAC support
      commit: 451323f8bc9e9b701b87b4598ec1cac8eff82d15
[5/7] arm64: dts: meson: libretech-pc: add internal DAC support
      commit: 2989a2d6c7f36da2bddffdb293bdf123e735d5f7
[6/7] arm64: dts: meson: g12: add internal DAC
      commit: 457fa78771a23ecedf3bcd9ce9946a5183472ff6
[7/7] arm64: dts: meson: g12: add internal DAC glue
      commit: dbffd7f9bdb463437d3c3f7c3e1bd4379a785fe4

Best regards,

Signature · 1 line
Kevin Hilman <[email protected]>