From 2cef63cd9c8f3cbc6b2a9735557d024273feaf94 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sun, 4 Sep 2022 23:11:02 +0200
Subject: [PATCH 365/463] arm64: dts: rk3399-pinephone-pro: Add internal
 display support

Touch screen improvememtns in suspend.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
 .../dts/rockchip/rk3399-pinephone-pro.dts     | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
index ef754ea30a940..e58cb344e7b63 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
@@ -168,6 +168,7 @@ vcc1v8_lcd: vcc1v8-lcd {
 		vin-supply = <&vcc3v3_sys>;
 		gpio = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>;
 		pinctrl-names = "default";
+		pinctrl-0 = <&display_pwren1>;
 	};
 
 	/* MIPI DSI panel 2.8v supply */
@@ -180,6 +181,7 @@ vcc2v8_lcd: vcc2v8-lcd {
 		vin-supply = <&vcc3v3_sys>;
 		gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>;
 		pinctrl-names = "default";
+		pinctrl-0 = <&display_pwren>;
 	};
 
 	vibrator {
@@ -311,6 +313,9 @@ vcc3v0_touch: LDO_REG2 {
 				regulator-name = "vcc3v0_touch";
 				regulator-min-microvolt = <3000000>;
 				regulator-max-microvolt = <3000000>;
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
 			};
 
 			vcca1v8_codec: LDO_REG3 {
@@ -439,6 +444,8 @@ touchscreen@14 {
 		VDDIO-supply = <&vcc3v0_touch>;
 		touchscreen-size-x = <720>;
 		touchscreen-size-y = <1440>;
+		use-dt-irq-flags;
+		poweroff-in-suspend;
 	};
 };
 
@@ -510,6 +517,7 @@ panel@0 {
 		vcc-supply = <&vcc2v8_lcd>;
 		iovcc-supply = <&vcc1v8_lcd>;
 		pinctrl-names = "default";
+		pinctrl-0 = <&display_rst_l>;
 
 		port {
 			mipi_in_panel: endpoint {
@@ -531,6 +539,20 @@ pwrbtn_pin: pwrbtn-pin {
 		};
 	};
 
+	dsi {
+		display_rst_l: display-rst-l {
+			rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_down>;
+		};
+
+		display_pwren: display-pwren {
+			rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_down>;
+		};
+
+		display_pwren1: display-pwren1 {
+			rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_down>;
+		};
+	};
+
 	leds {
 		red_led_pin: red-led-pin {
 			rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
-- 
2.46.0

