Skip to contentSkip to conversation

MT8192 Asurada devicetree - Part 2

PATCH In review Nícolas F. R. A. Prado 4 participants 9 messages Nov 2, 2022 – Dec 16, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v3 cover MT8192 Asurada devicetree - Part 2

This series improves some more the support for MT8192 Asurada-based Chromebooks, by enabling some missing functionality, namely the internal display and audio.

In addition to that, aliases are also added for the i2c and mmc nodes, which should've been done while adding the devices in the previous series.

Some notable components that are still missing support are:
- external display/HDMI audio (waiting for [1])
- GPU (waiting for [2])

As part of testing the audio, an UCM file was used, which has already been submitted upstream [3].

This series depends on some missing dt-binding properties on rt5682, which are added by another series [4].

[1] https://lore.kernel.org/all/[email protected]/
[2] https://lore.kernel.org/all/[email protected]
[3] https://github.com/alsa-project/alsa-ucm-conf/pull/217
[4] https://lore.kernel.org/all/[email protected]

v2: https://lore.kernel.org/all/[email protected]
v1: https://lore.kernel.org/all/[email protected]/

Changes in v3:
- Moved codec and sound card compatibles to separate dtsi to prepare for headset codec differences in newer revisions
- Added new supplies for rt5682
- Removed i2c aliases for unused controllers

Changes in v2:
- Extended series to also include patches 4 and 5 enabling audio and adding aliases
- Adjusted display regulator hierarchy and voltages to reflect the hardware

Nícolas F. R. A. Prado (5):
arm64: dts: mediatek: asurada: Add display regulators
arm64: dts: mediatek: asurada: Add display backlight
arm64: dts: mediatek: asurada: Enable internal display
arm64: dts: mediatek: asurada: Enable audio support
arm64: dts: mediatek: asurada: Add aliases for i2c and mmc

 .../mt8192-asurada-audio-rt1015p-rt5682.dtsi  |  19 +
 .../mt8192-asurada-audio-rt1015p.dtsi         |  26 +
 .../mediatek/mt8192-asurada-audio-rt5682.dtsi |  21 +
 .../dts/mediatek/mt8192-asurada-hayato-r1.dts |   1 +
 .../mediatek/mt8192-asurada-spherion-r0.dts   |   1 +
 .../boot/dts/mediatek/mt8192-asurada.dtsi     | 465 ++++++++++++++++++
 6 files changed, 533 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8192-asurada-audio-rt1015p-rt5682.dtsi
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8192-asurada-audio-rt1015p.dtsi
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8192-asurada-audio-rt5682.dtsi
Signature · 1 line
2.38.1
#1 lore raw

PATCH v3 1/5 arm64: dts: mediatek: asurada: Add display regulators

Add the regulators present on the Asurada platform that are used to power the internal and external displays.

---

(no changes since v2)

Changes in v2:
- Added missing vin-supply to regulators
- Removed min/max-microvolt from regulators that are simple switches

 .../boot/dts/mediatek/mt8192-asurada.dtsi     | 112 ++++++++++++++++++
 1 file changed, 112 insertions(+)
arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi +112 -0
index 4b314435f8fd..fafca7428539 100644
@@ -23,6 +23,43 @@ memory@40000000 {
 		reg = <0 0x40000000 0 0x80000000>;
 	};
 
+	pp1000_dpbrdg: regulator-1v0-dpbrdg {
+		compatible = "regulator-fixed";
+		regulator-name = "pp1000_dpbrdg";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pp1000_dpbrdg_en_pins>;
+		regulator-min-microvolt = <1000000>;
+		regulator-max-microvolt = <1000000>;
+		enable-active-high;
+		regulator-boot-on;
+		gpio = <&pio 19 GPIO_ACTIVE_HIGH>;
+		vin-supply = <&mt6359_vs2_buck_reg>;
+	};
+
+	pp1000_mipibrdg: regulator-1v0-mipibrdg {
+		compatible = "regulator-fixed";
+		regulator-name = "pp1000_mipibrdg";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pp1000_mipibrdg_en_pins>;
+		regulator-min-microvolt = <1000000>;
+		regulator-max-microvolt = <1000000>;
+		enable-active-high;
+		regulator-boot-on;
+		gpio = <&pio 129 GPIO_ACTIVE_HIGH>;
+		vin-supply = <&mt6359_vs2_buck_reg>;
+	};
+
+	pp1800_dpbrdg: regulator-1v8-dpbrdg {
+		compatible = "regulator-fixed";
+		regulator-name = "pp1800_dpbrdg";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pp1800_dpbrdg_en_pins>;
+		enable-active-high;
+		regulator-boot-on;
+		gpio = <&pio 126 GPIO_ACTIVE_HIGH>;
+		vin-supply = <&mt6359_vio18_ldo_reg>;
+	};
+
 	/* system wide LDO 1.8V power rail */
 	pp1800_ldo_g: regulator-1v8-g {
 		compatible = "regulator-fixed";
@@ -34,6 +71,28 @@ pp1800_ldo_g: regulator-1v8-g {
 		vin-supply = <&pp3300_g>;
 	};
 
+	pp1800_mipibrdg: regulator-1v8-mipibrdg {
+		compatible = "regulator-fixed";
+		regulator-name = "pp1800_mipibrdg";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pp1800_mipibrdg_en_pins>;
+		enable-active-high;
+		regulator-boot-on;
+		gpio = <&pio 128 GPIO_ACTIVE_HIGH>;
+		vin-supply = <&mt6359_vio18_ldo_reg>;
+	};
+
+	pp3300_dpbrdg: regulator-3v3-dpbrdg {
+		compatible = "regulator-fixed";
+		regulator-name = "pp3300_dpbrdg";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pp3300_dpbrdg_en_pins>;
+		enable-active-high;
+		regulator-boot-on;
+		gpio = <&pio 26 GPIO_ACTIVE_HIGH>;
+		vin-supply = <&pp3300_g>;
+	};
+
 	/* system wide switching 3.3V power rail */
 	pp3300_g: regulator-3v3-g {
 		compatible = "regulator-fixed";
@@ -56,6 +115,17 @@ pp3300_ldo_z: regulator-3v3-z {
 		vin-supply = <&ppvar_sys>;
 	};
 
+	pp3300_mipibrdg: regulator-3v3-mipibrdg {
+		compatible = "regulator-fixed";
+		regulator-name = "pp3300_mipibrdg";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pp3300_mipibrdg_en_pins>;
+		enable-active-high;
+		regulator-boot-on;
+		gpio = <&pio 127 GPIO_ACTIVE_HIGH>;
+		vin-supply = <&pp3300_g>;
+	};
+
 	/* separately switched 3.3V power rail */
 	pp3300_u: regulator-3v3-u {
 		compatible = "regulator-fixed";
@@ -719,6 +789,48 @@ pins-wifi-kill {
 		};
 	};
 
+	pp1000_dpbrdg_en_pins: pp1000-dpbrdg-en-pins {
+		pins-en {
+			pinmux = <PINMUX_GPIO19__FUNC_GPIO19>;
+			output-low;
+		};
+	};
+
+	pp1000_mipibrdg_en_pins: pp1000-mipibrdg-en-pins {
+		pins-en {
+			pinmux = <PINMUX_GPIO129__FUNC_GPIO129>;
+			output-low;
+		};
+	};
+
+	pp1800_dpbrdg_en_pins: pp1800-dpbrdg-en-pins {
+		pins-en {
+			pinmux = <PINMUX_GPIO126__FUNC_GPIO126>;
+			output-low;
+		};
+	};
+
+	pp1800_mipibrdg_en_pins: pp1800-mipibrd-en-pins {
+		pins-en {
+			pinmux = <PINMUX_GPIO128__FUNC_GPIO128>;
+			output-low;
+		};
+	};
+
+	pp3300_dpbrdg_en_pins: pp3300-dpbrdg-en-pins {
+		pins-en {
+			pinmux = <PINMUX_GPIO26__FUNC_GPIO26>;
+			output-low;
+		};
+	};
+
+	pp3300_mipibrdg_en_pins: pp3300-mipibrdg-en-pins {
+		pins-en {
+			pinmux = <PINMUX_GPIO127__FUNC_GPIO127>;
+			output-low;
+		};
+	};
+
 	pp3300_wlan_pins: pp3300-wlan-pins {
 		pins-pcie-en-pp3300-wlan {
 			pinmux = <PINMUX_GPIO143__FUNC_GPIO143>;
Signature · 1 line
2.38.1
#2 lore raw

PATCH v3 2/5 arm64: dts: mediatek: asurada: Add display backlight

In reply to Nícolas F. R. A. Prado

Add the display backlight for the Asurada platform. It relies on the display PWM controller, so also enable and configure this component.

---

(no changes since v1)

 .../boot/dts/mediatek/mt8192-asurada.dtsi     | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)
arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi +28 -0
index fafca7428539..666021ca4d4f 100644
@@ -23,6 +23,16 @@ memory@40000000 {
 		reg = <0 0x40000000 0 0x80000000>;
 	};
 
+	backlight_lcd0: backlight-lcd0 {
+		compatible = "pwm-backlight";
+		pwms = <&pwm0 0 500000>;
+		power-supply = <&ppvar_sys>;
+		enable-gpios = <&pio 152 0>;
+		brightness-levels = <0 1023>;
+		num-interpolated-steps = <1023>;
+		default-brightness-level = <576>;
+	};
+
 	pp1000_dpbrdg: regulator-1v0-dpbrdg {
 		compatible = "regulator-fixed";
 		regulator-name = "pp1000_dpbrdg";
@@ -838,6 +848,17 @@ pins-pcie-en-pp3300-wlan {
 		};
 	};
 
+	pwm0_pins: pwm0-default-pins {
+		pins-pwm {
+			pinmux = <PINMUX_GPIO40__FUNC_DISP_PWM>;
+		};
+
+		pins-inhibit {
+			pinmux = <PINMUX_GPIO152__FUNC_GPIO152>;
+			output-high;
+		};
+	};
+
 	scp_pins: scp-pins {
 		pins-vreq-vao {
 			pinmux = <PINMUX_GPIO195__FUNC_SCP_VREQ_VAO>;
@@ -899,6 +920,13 @@ &pmic {
 	interrupts-extended = <&pio 214 IRQ_TYPE_LEVEL_HIGH>;
 };
 
+&pwm0 {
+	status = "okay";
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&pwm0_pins>;
+};
+
 &scp {
 	status = "okay";
 
Signature · 1 line
2.38.1
#3 lore raw

PATCH v3 3/5 arm64: dts: mediatek: asurada: Enable internal display

In reply to Nícolas F. R. A. Prado

The asurada platform has an ANX7625 bridge connecting the DSI's output to the internal eDP panel. Add and enable these devices in order to get a usable internal display.

---

(no changes since v1)

 .../boot/dts/mediatek/mt8192-asurada.dtsi     | 73 +++++++++++++++++++
 1 file changed, 73 insertions(+)
arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi +73 -0
index 666021ca4d4f..ace44827de17 100644
@@ -198,6 +198,14 @@ wifi_restricted_dma_region: wifi@c0000000 {
 	};
 };
 
+&dsi0 {
+	status = "okay";
+};
+
+&dsi_out {
+	remote-endpoint = <&anx7625_in>;
+};
+
 &i2c0 {
 	status = "okay";
 
@@ -246,6 +254,53 @@ &i2c3 {
 	clock-frequency = <400000>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c3_pins>;
+
+	anx_bridge: anx7625@58 {
+		compatible = "analogix,anx7625";
+		reg = <0x58>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&anx7625_pins>;
+		enable-gpios = <&pio 41 GPIO_ACTIVE_HIGH>;
+		reset-gpios = <&pio 42 GPIO_ACTIVE_HIGH>;
+		vdd10-supply = <&pp1000_mipibrdg>;
+		vdd18-supply = <&pp1800_mipibrdg>;
+		vdd33-supply = <&pp3300_mipibrdg>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				anx7625_in: endpoint {
+					remote-endpoint = <&dsi_out>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				anx7625_out: endpoint {
+					remote-endpoint = <&panel_in>;
+				};
+			};
+		};
+
+		aux-bus {
+			panel: panel {
+				compatible = "edp-panel";
+				power-supply = <&pp3300_mipibrdg>;
+				backlight = <&backlight_lcd0>;
+
+				port {
+					panel_in: endpoint {
+						remote-endpoint = <&anx7625_out>;
+					};
+				};
+			};
+		};
+	};
 };
 
 &i2c7 {
@@ -256,6 +311,10 @@ &i2c7 {
 	pinctrl-0 = <&i2c7_pins>;
 };
 
+&mipi_tx0 {
+	status = "okay";
+};
+
 &mmc0 {
 	status = "okay";
 
@@ -587,6 +646,20 @@ &pio {
 			  "AUD_DAT_MISO0",
 			  "AUD_DAT_MISO1";
 
+	anx7625_pins: anx7625-default-pins {
+		pins-out {
+			pinmux = <PINMUX_GPIO41__FUNC_GPIO41>,
+				 <PINMUX_GPIO42__FUNC_GPIO42>;
+			output-low;
+		};
+
+		pins-in {
+			pinmux = <PINMUX_GPIO6__FUNC_GPIO6>;
+			input-enable;
+			bias-pull-up;
+		};
+	};
+
 	cr50_int: cr50-irq-default-pins {
 		pins-gsc-ap-int-odl {
 			pinmux = <PINMUX_GPIO171__FUNC_GPIO171>;
Signature · 1 line
2.38.1
#4 lore raw

PATCH v3 4/5 arm64: dts: mediatek: asurada: Enable audio support

In reply to Nícolas F. R. A. Prado

Enable audio support for the Asurada platform. This consists of the machine sound card, the rt1015p codec for the speakers, the rt5682 codec for the headset, and the dmic codec for the internal microphone.

Newer revisions of spherion and hayato use the rt5682s codec for the headset instead, so the codecs and card compatible are added through separate dtsi files to prepare for that.

HDMI audio support is left out for now since the DisplayPort chip required isn't enabled yet.

---

Changes in v3:
- Moved rt5682, rt1015p and sound card compatible to separate dtsi files to prepare for future revisions using different codecs
- Made node names generic for rt5682, rt1015p and sound card
- Set sound-dai-cells to 1 for rt5682
- Added DBVDD and LDO1-IN supplies for rt5682

Changes in v2:
- Added this commit

 .../mt8192-asurada-audio-rt1015p-rt5682.dtsi  |  19 ++
 .../mt8192-asurada-audio-rt1015p.dtsi         |  26 ++
 .../mediatek/mt8192-asurada-audio-rt5682.dtsi |  21 ++
 .../dts/mediatek/mt8192-asurada-hayato-r1.dts |   1 +
 .../mediatek/mt8192-asurada-spherion-r0.dts   |   1 +
 .../boot/dts/mediatek/mt8192-asurada.dtsi     | 245 ++++++++++++++++++
 6 files changed, 313 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8192-asurada-audio-rt1015p-rt5682.dtsi
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8192-asurada-audio-rt1015p.dtsi
 create mode 100644 arch/arm64/boot/dts/mediatek/mt8192-asurada-audio-rt5682.dtsi
arch/arm64/boot/dts/mediatek/mt8192-asurada-audio-rt1015p-rt5682.dtsi new file +19 -0
new file mode 100644
index 000000000000..f521f50d448f
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright 2020 Google LLC
+ */
+
+#include "mt8192-asurada-audio-rt5682.dtsi"
+#include "mt8192-asurada-audio-rt1015p.dtsi"
+
+&sound {
+	compatible = "mediatek,mt8192_mt6359_rt1015p_rt5682";
+
+	speaker-codecs {
+		sound-dai = <&rt1015p>;
+	};
+
+	headset-codec {
+		sound-dai = <&rt5682 0>;
+	};
+};
arch/arm64/boot/dts/mediatek/mt8192-asurada-audio-rt1015p.dtsi new file +26 -0
new file mode 100644
index 000000000000..e5743789934e
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2022 MediaTek Inc.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/mt8192-pinfunc.h>
+
+/ {
+	rt1015p: audio-codec {
+		compatible = "realtek,rt1015p";
+		pinctrl-names = "default";
+		pinctrl-0 = <&rt1015p_pins>;
+		sdb-gpios = <&pio 147 GPIO_ACTIVE_HIGH>;
+		#sound-dai-cells = <0>;
+	};
+};
+
+&pio {
+	rt1015p_pins: rt1015p-default-pins {
+		pins {
+			pinmux = <PINMUX_GPIO147__FUNC_GPIO147>;
+			output-low;
+		};
+	};
+};
arch/arm64/boot/dts/mediatek/mt8192-asurada-audio-rt5682.dtsi new file +21 -0
new file mode 100644
index 000000000000..05e48b870a92
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2022 MediaTek Inc.
+ */
+
+&i2c1 {
+	rt5682: audio-codec@1a {
+		compatible = "realtek,rt5682i";
+		reg = <0x1a>;
+		interrupts-extended = <&pio 18 IRQ_TYPE_LEVEL_LOW>;
+		realtek,jd-src = <1>;
+		realtek,btndet-delay = <16>;
+		#sound-dai-cells = <1>;
+
+		AVDD-supply = <&mt6359_vio18_ldo_reg>;
+		DBVDD-supply = <&mt6359_vio18_ldo_reg>;
+		LDO1-IN-supply = <&mt6359_vio18_ldo_reg>;
+		MICVDD-supply = <&pp3300_g>;
+		VBAT-supply = <&pp3300_ldo_z>;
+	};
+};
arch/arm64/boot/dts/mediatek/mt8192-asurada-hayato-r1.dts +1 -0
index 1e91491945f6..43a823990a92 100644
@@ -4,6 +4,7 @@
  */
 /dts-v1/;
 #include "mt8192-asurada.dtsi"
+#include "mt8192-asurada-audio-rt1015p-rt5682.dtsi"
 
 / {
 	model = "Google Hayato rev1";
arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts +1 -0
index fa3d9573f37a..c6ad10cec95e 100644
@@ -4,6 +4,7 @@
  */
 /dts-v1/;
 #include "mt8192-asurada.dtsi"
+#include "mt8192-asurada-audio-rt1015p-rt5682.dtsi"
 #include <dt-bindings/leds/common.h>
 
 / {
arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi +245 -0

269 lines not on this page · raw message

Signature · 1 line
2.38.1
maintainer Reviewed-by on v3 4/5
#5 lore raw

Re: [PATCH v3 4/5] arm64: dts: mediatek: asurada: Enable audio support

Il 02/11/22 20:06, Nícolas F. R. A. Prado ha scritto:

Quoted 8 lines

Enable audio support for the Asurada platform. This consists of the machine sound card, the rt1015p codec for the speakers, the rt5682 codec for the headset, and the dmic codec for the internal microphone.

Newer revisions of spherion and hayato use the rt5682s codec for the headset instead, so the codecs and card compatible are added through separate dtsi files to prepare for that.

Quoted 5 lines

HDMI audio support is left out for now since the DisplayPort chip required isn't enabled yet.

#6 lore raw

PATCH v3 5/5 arm64: dts: mediatek: asurada: Add aliases for i2c and mmc

In reply to Nícolas F. R. A. Prado

Add aliases for the i2c and mmc nodes on the Asurada platform DT to ensure that we get stable ids for those devices on userspace.

---

Changes in v3:
- Removed i2c4, 5, 6, 8 and 9 as they aren't used on asurada

Changes in v2:
- Added this commit

 arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi +7 -0
index ce9e43475f9e..9f12257ab4e7 100644
@@ -11,6 +11,13 @@
 
 / {
 	aliases {
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;
+		i2c2 = &i2c2;
+		i2c3 = &i2c3;
+		i2c7 = &i2c7;
+		mmc0 = &mmc0;
+		mmc1 = &mmc1;
 		serial0 = &uart0;
 	};
 
Signature · 1 line
2.38.1
#7 lore raw
In reply to Nícolas F. R. A. Prado
Quoted 14 lines · Nícolas F. R. A. Prado

This series improves some more the support for MT8192 Asurada-based Chromebooks, by enabling some missing functionality, namely the internal display and audio.

In addition to that, aliases are also added for the i2c and mmc nodes, which should've been done while adding the devices in the previous series.

Some notable components that are still missing support are:
- external display/HDMI audio (waiting for [1])
- GPU (waiting for [2])

Quoted 5 lines

As part of testing the audio, an UCM file was used, which has already been submitted upstream [3].

This series depends on some missing dt-binding properties on rt5682, which are added by another series [4].

Hi Matthias,

This series has been floating around for some time now, and has been fully tested by multiple parties. The rt5682 dt-binding changes have also been merged.

Could you queue it up?

Thanks
ChenYu

maintainer
#8 lore raw
Quoted 22 lines · Chen-Yu Tsai
Quoted 14 lines · Nícolas F. R. A. Prado

This series improves some more the support for MT8192 Asurada-based Chromebooks, by enabling some missing functionality, namely the internal display and audio.

In addition to that, aliases are also added for the i2c and mmc nodes, which should've been done while adding the devices in the previous series.

Some notable components that are still missing support are:
- external display/HDMI audio (waiting for [1])
- GPU (waiting for [2])

Quoted 5 lines

As part of testing the audio, an UCM file was used, which has already been submitted upstream [3].

This series depends on some missing dt-binding properties on rt5682, which are added by another series [4].

Quoted 8 lines

Hi Matthias,

This series has been floating around for some time now, and has been fully tested by multiple parties. The rt5682 dt-binding changes have also been merged.

Could you queue it up?

Applied now. Sorry for the delay!

Matthias