1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Google Trogdor dts fragment for the boards with Parade ps8640 edp bridge
4 *
5 * Copyright 2021 Google LLC.
6 */
7
8#include <dt-bindings/gpio/gpio.h>
9
10/ {
11	pp3300_brij_ps8640: pp3300-brij-ps8640-regulator {
12		compatible = "regulator-fixed";
13		status = "okay";
14		regulator-name = "pp3300_brij_ps8640";
15
16		regulator-min-microvolt = <3300000>;
17		regulator-max-microvolt = <3300000>;
18
19		gpio = <&tlmm 32 GPIO_ACTIVE_HIGH>;
20		enable-active-high;
21
22		pinctrl-names = "default";
23		pinctrl-0 = <&en_pp3300_edp_brij_ps8640>;
24
25		vin-supply = <&pp3300_a>;
26	};
27};
28
29/*
30 * ADDITIONS TO FIXED REGULATORS DEFINED IN PARENT DEVICE TREE FILES
31 *
32 * Sort order matches the order in the parent files (parents before children).
33 */
34
35&pp3300_dx_edp {
36	off-on-delay-us = <500000>;
37
38	/*
39	 * It's nicer to start with this regulator enabled. The
40	 * bootloader may have left it on and it's nice not to cause an
41	 * extra power cycle of the touchscreen and eDP panel at bootup.
42	 * This should help speed bootup because we have off-on-delay-us.
43	 */
44	regulator-boot-on;
45};
46
47/* ADDITIONS TO NODES DEFINED IN PARENT DEVICE TREE FILES */
48
49&dsi0_out {
50	remote-endpoint = <&ps8640_in>;
51};
52
53edp_brij_i2c: &i2c2 {
54	status = "okay";
55	clock-frequency = <400000>;
56
57	ps8640_bridge: bridge@8 {
58		compatible = "parade,ps8640";
59		reg = <0x8>;
60
61		powerdown-gpios = <&tlmm 104 GPIO_ACTIVE_LOW>;
62		reset-gpios = <&tlmm 11 GPIO_ACTIVE_LOW>;
63
64		pinctrl-names = "default";
65		pinctrl-0 = <&edp_brij_en>, <&edp_brij_ps8640_rst>;
66
67		vdd12-supply = <&pp1200_brij>;
68		vdd33-supply = <&pp3300_brij_ps8640>;
69
70		ports {
71			#address-cells = <1>;
72			#size-cells = <0>;
73
74			port@0 {
75				reg = <0>;
76				ps8640_in: endpoint {
77					remote-endpoint = <&dsi0_out>;
78				};
79			};
80
81			port@1 {
82				reg = <1>;
83				ps8640_out: endpoint {
84					remote-endpoint = <&panel_in_edp>;
85				};
86			};
87		};
88
89		aux-bus {
90			panel: panel {
91				/* Compatible will be filled in per-board */
92				power-supply = <&pp3300_dx_edp>;
93				backlight = <&backlight>;
94
95				port {
96					panel_in_edp: endpoint {
97						remote-endpoint = <&ps8640_out>;
98					};
99				};
100			};
101		};
102	};
103};
104
105&tlmm {
106	edp_brij_ps8640_rst: edp-brij-ps8640-rst-state {
107		pins = "gpio11";
108		function = "gpio";
109		drive-strength = <2>;
110		bias-disable;
111	};
112
113	en_pp3300_edp_brij_ps8640: en-pp3300-edp-brij-ps8640-state {
114		pins = "gpio32";
115		function = "gpio";
116		drive-strength = <2>;
117		bias-disable;
118	};
119};
120