1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Google Wormdingler board device tree source
4 *
5 * Copyright 2021 Google LLC.
6 */
7
8/dts-v1/;
9
10#include "sc7180-trogdor.dtsi"
11
12/ {
13	avdd_lcd: avdd-lcd {
14		compatible = "regulator-fixed";
15		regulator-name = "avdd_lcd";
16
17		gpio = <&tlmm 88 GPIO_ACTIVE_HIGH>;
18		enable-active-high;
19		pinctrl-names = "default";
20		pinctrl-0 = <&avdd_lcd_en>;
21
22		vin-supply = <&pp5000_a>;
23	};
24
25	avee_lcd: avee-lcd {
26		compatible = "regulator-fixed";
27		regulator-name = "avee_lcd";
28
29		gpio = <&tlmm 21 GPIO_ACTIVE_HIGH>;
30		enable-active-high;
31		pinctrl-names = "default";
32		pinctrl-0 = <&avee_lcd_en>;
33
34		vin-supply = <&pp5000_a>;
35	};
36
37	pp1800_ts:
38	v1p8_mipi: v1p8-mipi {
39		compatible = "regulator-fixed";
40		regulator-name = "v1p8_mipi";
41
42		gpio = <&tlmm 86 GPIO_ACTIVE_HIGH>;
43		enable-active-high;
44		pinctrl-names = "default";
45		pinctrl-0 = <&mipi_1800_en>;
46
47		vin-supply = <&pp3300_a>;
48	};
49
50	thermal-zones {
51		skin_temp_thermal: skin-temp-thermal {
52			polling-delay-passive = <250>;
53			polling-delay = <0>;
54
55			thermal-sensors = <&pm6150_adc_tm 1>;
56			sustainable-power = <574>;
57
58			trips {
59				skin_temp_alert0: trip-point0 {
60					temperature = <58000>;
61					hysteresis = <1000>;
62					type = "passive";
63				};
64
65				skin_temp_alert1: trip-point1 {
66					temperature = <62500>;
67					hysteresis = <1000>;
68					type = "passive";
69				};
70
71				skin-temp-crit {
72					temperature = <68000>;
73					hysteresis = <1000>;
74					type = "critical";
75				};
76			};
77
78			cooling-maps {
79				map0 {
80					trip = <&skin_temp_alert0>;
81					cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
82							 <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
83				};
84
85				map1 {
86					trip = <&skin_temp_alert1>;
87					cooling-device = <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
88							 <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
89				};
90			};
91		};
92	};
93};
94
95&backlight {
96	pwms = <&cros_ec_pwm 0>;
97};
98
99&camcc {
100	status = "okay";
101};
102
103&cros_ec {
104	base_detection: cbas {
105		compatible = "google,cros-cbas";
106	};
107};
108
109&dsi0 {
110
111	panel: panel@0 {
112		reg = <0>;
113		enable-gpios = <&tlmm 87 GPIO_ACTIVE_HIGH>;
114		pinctrl-names = "default";
115		pinctrl-0 = <&vdd_reset_1800>;
116		avdd-supply = <&avdd_lcd>;
117		avee-supply = <&avee_lcd>;
118		pp1800-supply = <&v1p8_mipi>;
119		pp3300-supply = <&pp3300_dx_edp>;
120		backlight = <&backlight>;
121		rotation = <270>;
122
123		ports {
124			#address-cells = <1>;
125			#size-cells = <0>;
126			port@0 {
127				reg = <0>;
128				panel_in: endpoint {
129					remote-endpoint = <&dsi0_out>;
130				};
131			};
132		};
133	};
134
135	ports {
136		port@1 {
137			endpoint {
138				remote-endpoint = <&panel_in>;
139				data-lanes = <0 1 2 3>;
140			};
141		};
142	};
143};
144
145&i2c4 {
146	status = "okay";
147	clock-frequency = <400000>;
148
149	ap_ts: touchscreen@1 {
150		compatible = "hid-over-i2c";
151		reg = <0x01>;
152		pinctrl-names = "default";
153		pinctrl-0 = <&ts_int_l>;
154
155		interrupt-parent = <&tlmm>;
156		interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
157
158		post-power-on-delay-ms = <70>;
159		hid-descr-addr = <0x0001>;
160
161		vdd-supply = <&pp3300_ts>;
162		vddl-supply = <&pp1800_ts>;
163	};
164};
165
166&pm6150_adc {
167	skin-temp-thermistor@4d {
168		reg = <ADC5_AMUX_THM1_100K_PU>;
169		qcom,ratiometric;
170		qcom,hw-settle-time = <200>;
171	};
172};
173
174&pm6150_adc_tm {
175	status = "okay";
176
177	skin-temp-thermistor@1 {
178		reg = <1>;
179		io-channels = <&pm6150_adc ADC5_AMUX_THM1_100K_PU>;
180		qcom,ratiometric;
181		qcom,hw-settle-time-us = <200>;
182	};
183};
184
185&pp1800_uf_cam {
186	status = "okay";
187};
188
189&pp1800_wf_cam {
190	status = "okay";
191};
192
193&pp2800_uf_cam {
194	status = "okay";
195};
196
197&pp2800_wf_cam {
198	status = "okay";
199};
200
201&wifi {
202	qcom,ath10k-calibration-variant = "GO_WORMDINGLER";
203};
204
205/*
206 * No eDP on this board but it's logically the same signal so just give it
207 * a new name and assign the proper GPIO.
208 */
209pp3300_disp_on: &pp3300_dx_edp {
210	gpio = <&tlmm 85 GPIO_ACTIVE_HIGH>;
211};
212
213/* PINCTRL - modifications to sc7180-trogdor.dtsi */
214
215/*
216 * No eDP on this board but it's logically the same signal so just give it
217 * a new name and assign the proper GPIO.
218 */
219
220tp_en: &en_pp3300_dx_edp {
221	pinmux {
222		pins = "gpio85";
223	};
224
225	pinconf {
226		pins = "gpio85";
227	};
228};
229
230/* PINCTRL - board-specific pinctrl */
231
232&tlmm {
233	gpio-line-names = "HUB_RST_L",
234			  "AP_RAM_ID0",
235			  "AP_SKU_ID2",
236			  "AP_RAM_ID1",
237			  "",
238			  "AP_RAM_ID2",
239			  "UF_CAM_EN",
240			  "WF_CAM_EN",
241			  "TS_RESET_L",
242			  "TS_INT_L",
243			  "",
244			  "",
245			  "AP_EDP_BKLTEN",
246			  "UF_CAM_MCLK",
247			  "WF_CAM_CLK",
248			  "",
249			  "",
250			  "UF_CAM_SDA",
251			  "UF_CAM_SCL",
252			  "WF_CAM_SDA",
253			  "WF_CAM_SCL",
254			  "AVEE_LCD_EN",
255			  "",
256			  "AMP_EN",
257			  "",
258			  "",
259			  "",
260			  "",
261			  "HP_IRQ",
262			  "WF_CAM_RST_L",
263			  "UF_CAM_RST_L",
264			  "AP_BRD_ID2",
265			  "",
266			  "AP_BRD_ID0",
267			  "AP_H1_SPI_MISO",
268			  "AP_H1_SPI_MOSI",
269			  "AP_H1_SPI_CLK",
270			  "AP_H1_SPI_CS_L",
271			  "BT_UART_CTS",
272			  "BT_UART_RTS",
273			  "BT_UART_TXD",
274			  "BT_UART_RXD",
275			  "H1_AP_INT_ODL",
276			  "",
277			  "UART_AP_TX_DBG_RX",
278			  "UART_DBG_TX_AP_RX",
279			  "HP_I2C_SDA",
280			  "HP_I2C_SCL",
281			  "FORCED_USB_BOOT",
282			  "AMP_BCLK",
283			  "AMP_LRCLK",
284			  "AMP_DIN",
285			  "",
286			  "HP_BCLK",
287			  "HP_LRCLK",
288			  "HP_DOUT",
289			  "HP_DIN",
290			  "HP_MCLK",
291			  "AP_SKU_ID0",
292			  "AP_EC_SPI_MISO",
293			  "AP_EC_SPI_MOSI",
294			  "AP_EC_SPI_CLK",
295			  "AP_EC_SPI_CS_L",
296			  "AP_SPI_CLK",
297			  "AP_SPI_MOSI",
298			  "AP_SPI_MISO",
299			  /*
300			   * AP_FLASH_WP_L is crossystem ABI. Schematics
301			   * call it BIOS_FLASH_WP_L.
302			   */
303			  "AP_FLASH_WP_L",
304			  "",
305			  "AP_SPI_CS0_L",
306			  "",
307			  "",
308			  "",
309			  "",
310			  "WLAN_SW_CTRL",
311			  "",
312			  "REPORT_E",
313			  "",
314			  "ID0",
315			  "",
316			  "ID1",
317			  "",
318			  "",
319			  "",
320			  "CODEC_PWR_EN",
321			  "HUB_EN",
322			  "TP_EN",
323			  "MIPI_1.8V_EN",
324			  "VDD_RESET_1.8V",
325			  "AVDD_LCD_EN",
326			  "",
327			  "AP_SKU_ID1",
328			  "AP_RST_REQ",
329			  "",
330			  "AP_BRD_ID1",
331			  "AP_EC_INT_L",
332			  "SDM_GRFC_3",
333			  "",
334			  "",
335			  "BOOT_CONFIG_4",
336			  "BOOT_CONFIG_2",
337			  "",
338			  "",
339			  "",
340			  "",
341			  "",
342			  "",
343			  "",
344			  "BOOT_CONFIG_3",
345			  "WCI2_LTE_COEX_TXD",
346			  "WCI2_LTE_COEX_RXD",
347			  "",
348			  "",
349			  "",
350			  "",
351			  "FORCED_USB_BOOT_POL",
352			  "AP_TS_PEN_I2C_SDA",
353			  "AP_TS_PEN_I2C_SCL",
354			  "DP_HOT_PLUG_DET",
355			  "EC_IN_RW_ODL";
356
357	avdd_lcd_en: avdd-lcd-en {
358		pinmux {
359			pins = "gpio88";
360			function = "gpio";
361		};
362
363		pinconf {
364			pins = "gpio88";
365			drive-strength = <2>;
366			bias-disable;
367		};
368	};
369
370	avee_lcd_en: avee-lcd-en {
371		pinmux {
372			pins = "gpio21";
373			function = "gpio";
374		};
375
376		pinconf {
377			pins = "gpio21";
378			drive-strength = <2>;
379			bias-disable;
380		};
381	};
382
383	mipi_1800_en: mipi-1800-en {
384		pinmux {
385			pins = "gpio86";
386			function = "gpio";
387		};
388
389		pinconf {
390			pins = "gpio86";
391			drive-strength = <2>;
392			bias-disable;
393		};
394	};
395
396	vdd_reset_1800: vdd-reset-1800 {
397		pinmux {
398			pins = "gpio87";
399			function = "gpio";
400		};
401
402		pinconf {
403			pins = "gpio87";
404			drive-strength = <2>;
405			bias-disable;
406		};
407	};
408};
409