1// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2/*
3 * Copyright 2021 Google LLC
4 */
5
6#include "mt8183-kukui.dtsi"
7
8/ {
9	panel: panel {
10		compatible = "auo,b116xw03";
11		power-supply = <&pp3300_panel>;
12		ddc-i2c-bus = <&i2c4>;
13		backlight = <&backlight_lcd0>;
14
15		port {
16			panel_in: endpoint {
17				remote-endpoint = <&anx7625_out>;
18			};
19		};
20	};
21
22	pp1200_mipibrdg: pp1200-mipibrdg {
23		compatible = "regulator-fixed";
24		regulator-name = "pp1200_mipibrdg";
25		pinctrl-names = "default";
26		pinctrl-0 = <&pp1200_mipibrdg_en>;
27
28		enable-active-high;
29		regulator-boot-on;
30
31		gpio = <&pio 54 GPIO_ACTIVE_HIGH>;
32	};
33
34	pp1800_mipibrdg: pp1800-mipibrdg {
35		compatible = "regulator-fixed";
36		regulator-name = "pp1800_mipibrdg";
37		pinctrl-names = "default";
38		pinctrl-0 = <&pp1800_lcd_en>;
39
40		enable-active-high;
41		regulator-boot-on;
42
43		gpio = <&pio 36 GPIO_ACTIVE_HIGH>;
44	};
45
46	pp3300_panel: pp3300-panel {
47		compatible = "regulator-fixed";
48		regulator-name = "pp3300_panel";
49		regulator-min-microvolt = <3300000>;
50		regulator-max-microvolt = <3300000>;
51		pinctrl-names = "default";
52		pinctrl-0 = <&pp3300_panel_pins>;
53
54		enable-active-high;
55		regulator-boot-on;
56
57		gpio = <&pio 35 GPIO_ACTIVE_HIGH>;
58	};
59
60	vddio_mipibrdg: vddio-mipibrdg {
61		compatible = "regulator-fixed";
62		regulator-name = "vddio_mipibrdg";
63		pinctrl-names = "default";
64		pinctrl-0 = <&vddio_mipibrdg_en>;
65
66		enable-active-high;
67		regulator-boot-on;
68
69		gpio = <&pio 37 GPIO_ACTIVE_HIGH>;
70	};
71
72	volume_buttons: volume-buttons {
73		compatible = "gpio-keys";
74		pinctrl-names = "default";
75		pinctrl-0 = <&volume_button_pins>;
76
77		volume_down {
78			label = "Volume Down";
79			linux,code = <KEY_VOLUMEDOWN>;
80			debounce-interval = <100>;
81
82			gpios = <&pio 6 GPIO_ACTIVE_LOW>;
83		};
84
85		volume_up {
86			label = "Volume Up";
87			linux,code = <KEY_VOLUMEUP>;
88			debounce-interval = <100>;
89
90			gpios = <&pio 5 GPIO_ACTIVE_LOW>;
91		};
92	};
93};
94
95&cros_ec {
96	cros_ec_pwm: ec-pwm {
97		compatible = "google,cros-ec-pwm";
98		#pwm-cells = <1>;
99		status = "disabled";
100	};
101};
102
103&dsi0 {
104	status = "okay";
105	/delete-node/panel@0;
106	ports {
107		port {
108			dsi_out: endpoint {
109				remote-endpoint = <&anx7625_in>;
110			};
111		};
112	};
113};
114
115&i2c0 {
116	status = "okay";
117
118	touchscreen: touchscreen@10 {
119		compatible = "elan,ekth3500";
120		reg = <0x10>;
121
122		pinctrl-names = "default";
123		pinctrl-0 = <&touchscreen_pins>;
124
125		interrupts-extended = <&pio 155 IRQ_TYPE_LEVEL_LOW>;
126
127		reset-gpios = <&pio 156 GPIO_ACTIVE_LOW>;
128	};
129};
130
131&i2c2 {
132	pinctrl-names = "default";
133	pinctrl-0 = <&i2c2_pins>;
134	status = "okay";
135	clock-frequency = <400000>;
136
137	trackpad@15 {
138		compatible = "elan,ekth3000";
139		reg = <0x15>;
140
141		pinctrl-names = "default";
142		pinctrl-0 = <&trackpad_pins>;
143
144		interrupts-extended = <&pio 7 IRQ_TYPE_LEVEL_LOW>;
145
146		wakeup-source;
147	};
148};
149
150&i2c4 {
151	pinctrl-names = "default";
152	pinctrl-0 = <&i2c4_pins>;
153	status = "okay";
154	clock-frequency = <100000>;
155
156	anx_bridge: anx7625@58 {
157		compatible = "analogix,anx7625";
158		reg = <0x58>;
159		pinctrl-names = "default";
160		pinctrl-0 = <&anx7625_pins>;
161		panel_flags = <1>;
162		enable-gpios = <&pio 45 GPIO_ACTIVE_HIGH>;
163		reset-gpios = <&pio 73 GPIO_ACTIVE_HIGH>;
164		vdd10-supply = <&pp1200_mipibrdg>;
165		vdd18-supply = <&pp1800_mipibrdg>;
166		vdd33-supply = <&vddio_mipibrdg>;
167
168		#address-cells = <1>;
169		#size-cells = <0>;
170		port@0 {
171			reg = <0>;
172
173			anx7625_in: endpoint {
174				remote-endpoint = <&dsi_out>;
175			};
176		};
177
178		port@1 {
179			reg = <1>;
180
181			anx7625_out: endpoint {
182				remote-endpoint = <&panel_in>;
183			};
184		};
185	};
186};
187
188&i2c_tunnel {
189	google,remote-bus = <2>;
190};
191
192&pio {
193	/* 192 lines */
194	gpio-line-names =
195		"SPI_AP_EC_CS_L",
196		"SPI_AP_EC_MOSI",
197		"SPI_AP_EC_CLK",
198		"I2S3_DO",
199		"USB_PD_INT_ODL",
200		"",
201		"",
202		"",
203		"",
204		"IT6505_HPD_L",
205		"I2S3_TDM_D3",
206		"SOC_I2C6_1V8_SCL",
207		"SOC_I2C6_1V8_SDA",
208		"DPI_D0",
209		"DPI_D1",
210		"DPI_D2",
211		"DPI_D3",
212		"DPI_D4",
213		"DPI_D5",
214		"DPI_D6",
215		"DPI_D7",
216		"DPI_D8",
217		"DPI_D9",
218		"DPI_D10",
219		"DPI_D11",
220		"DPI_HSYNC",
221		"DPI_VSYNC",
222		"DPI_DE",
223		"DPI_CK",
224		"AP_MSDC1_CLK",
225		"AP_MSDC1_DAT3",
226		"AP_MSDC1_CMD",
227		"AP_MSDC1_DAT0",
228		"AP_MSDC1_DAT2",
229		"AP_MSDC1_DAT1",
230		"",
231		"",
232		"",
233		"",
234		"",
235		"",
236		"OTG_EN",
237		"DRVBUS",
238		"DISP_PWM",
239		"DSI_TE",
240		"LCM_RST_1V8",
241		"AP_CTS_WIFI_RTS",
242		"AP_RTS_WIFI_CTS",
243		"SOC_I2C5_1V8_SCL",
244		"SOC_I2C5_1V8_SDA",
245		"SOC_I2C3_1V8_SCL",
246		"SOC_I2C3_1V8_SDA",
247		"",
248		"",
249		"",
250		"",
251		"",
252		"",
253		"",
254		"",
255		"",
256		"",
257		"",
258		"",
259		"",
260		"",
261		"",
262		"",
263		"",
264		"",
265		"",
266		"",
267		"",
268		"",
269		"",
270		"",
271		"",
272		"",
273		"",
274		"",
275		"",
276		"SOC_I2C1_1V8_SDA",
277		"SOC_I2C0_1V8_SDA",
278		"SOC_I2C0_1V8_SCL",
279		"SOC_I2C1_1V8_SCL",
280		"AP_SPI_H1_MISO",
281		"AP_SPI_H1_CS_L",
282		"AP_SPI_H1_MOSI",
283		"AP_SPI_H1_CLK",
284		"I2S5_BCK",
285		"I2S5_LRCK",
286		"I2S5_DO",
287		"BOOTBLOCK_EN_L",
288		"MT8183_KPCOL0",
289		"SPI_AP_EC_MISO",
290		"UART_DBG_TX_AP_RX",
291		"UART_AP_TX_DBG_RX",
292		"I2S2_MCK",
293		"I2S2_BCK",
294		"CLK_5M_WCAM",
295		"CLK_2M_UCAM",
296		"I2S2_LRCK",
297		"I2S2_DI",
298		"SOC_I2C2_1V8_SCL",
299		"SOC_I2C2_1V8_SDA",
300		"SOC_I2C4_1V8_SCL",
301		"SOC_I2C4_1V8_SDA",
302		"",
303		"SCL8",
304		"SDA8",
305		"FCAM_PWDN_L",
306		"",
307		"",
308		"",
309		"",
310		"",
311		"",
312		"",
313		"",
314		"",
315		"",
316		"",
317		"",
318		"",
319		"",
320		"",
321		"",
322		"",
323		"",
324		"",
325		"",
326		"",
327		"",
328		"",
329		"",
330		"",
331		"I2S_PMIC",
332		"I2S_PMIC",
333		"I2S_PMIC",
334		"I2S_PMIC",
335		"I2S_PMIC",
336		"I2S_PMIC",
337		"I2S_PMIC",
338		"I2S_PMIC",
339		"",
340		"",
341		"",
342		"",
343		"",
344		"",
345		/*
346		 * AP_FLASH_WP_L is crossystem ABI. Rev1 schematics
347		 * call it BIOS_FLASH_WP_R_L.
348		 */
349		"AP_FLASH_WP_L",
350		"EC_AP_INT_ODL",
351		"IT6505_INT_ODL",
352		"H1_INT_OD_L",
353		"",
354		"",
355		"",
356		"",
357		"",
358		"",
359		"",
360		"AP_SPI_FLASH_MISO",
361		"AP_SPI_FLASH_CS_L",
362		"AP_SPI_FLASH_MOSI",
363		"AP_SPI_FLASH_CLK",
364		"DA7219_IRQ",
365		"",
366		"",
367		"",
368		"",
369		"",
370		"",
371		"",
372		"",
373		"",
374		"",
375		"",
376		"",
377		"",
378		"",
379		"",
380		"",
381		"",
382		"",
383		"",
384		"",
385		"",
386		"",
387		"",
388		"",
389		"",
390		"";
391
392	pp1200_mipibrdg_en: pp1200-mipibrdg-en {
393		pins1 {
394			pinmux = <PINMUX_GPIO54__FUNC_GPIO54>;
395			output-low;
396		};
397	};
398
399	pp1800_lcd_en: pp1800-lcd-en {
400		pins1 {
401			pinmux = <PINMUX_GPIO36__FUNC_GPIO36>;
402			output-low;
403		};
404	};
405
406	pp3300_panel_pins: pp3300-panel-pins {
407		panel_3v3_enable: panel-3v3-enable {
408			pinmux = <PINMUX_GPIO35__FUNC_GPIO35>;
409			output-low;
410		};
411	};
412
413	ppvarp_lcd_en: ppvarp-lcd-en {
414		pins1 {
415			pinmux = <PINMUX_GPIO66__FUNC_GPIO66>;
416			output-low;
417		};
418	};
419
420	ppvarn_lcd_en: ppvarn-lcd-en {
421		pins1 {
422			pinmux = <PINMUX_GPIO166__FUNC_GPIO166>;
423			output-low;
424		};
425	};
426
427	anx7625_pins: anx7625-pins {
428		pins1 {
429			pinmux = <PINMUX_GPIO45__FUNC_GPIO45>,
430				 <PINMUX_GPIO73__FUNC_GPIO73>;
431			output-low;
432		};
433		pins2 {
434			pinmux = <PINMUX_GPIO4__FUNC_GPIO4>;
435			input-enable;
436			bias-pull-up;
437		};
438	};
439
440	touchscreen_pins: touchscreen-pins {
441		touch_int_odl {
442			pinmux = <PINMUX_GPIO155__FUNC_GPIO155>;
443			input-enable;
444			bias-pull-up;
445		};
446
447		touch_rst_l {
448			pinmux = <PINMUX_GPIO156__FUNC_GPIO156>;
449			output-high;
450		};
451	};
452
453	trackpad_pins: trackpad-pins {
454		trackpad_int {
455			pinmux = <PINMUX_GPIO7__FUNC_GPIO7>;
456			input-enable;
457			bias-disable; /* pulled externally */
458		};
459	};
460
461	vddio_mipibrdg_en: vddio-mipibrdg-en {
462		pins1 {
463			pinmux = <PINMUX_GPIO37__FUNC_GPIO37>;
464			output-low;
465		};
466	};
467
468	volume_button_pins: volume-button-pins {
469		voldn-btn-odl {
470			pinmux = <PINMUX_GPIO6__FUNC_GPIO6>;
471			input-enable;
472			bias-pull-up;
473		};
474
475		volup-btn-odl {
476			pinmux = <PINMUX_GPIO5__FUNC_GPIO5>;
477			input-enable;
478			bias-pull-up;
479		};
480	};
481};
482
483