1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
4 * Copyright (c) 2018 Akash Gajjar <Akash_Gajjar@mentor.com>
5 * Copyright (c) 2020 Tobias Schramm <t.schramm@manjaro.org>
6 */
7
8/dts-v1/;
9#include <dt-bindings/input/gpio-keys.h>
10#include <dt-bindings/input/linux-event-codes.h>
11#include <dt-bindings/pwm/pwm.h>
12#include <dt-bindings/usb/pd.h>
13#include <dt-bindings/leds/common.h>
14#include "rk3399.dtsi"
15#include "rk3399-opp.dtsi"
16
17/ {
18	model = "Pine64 Pinebook Pro";
19	compatible = "pine64,pinebook-pro", "rockchip,rk3399";
20
21	chosen {
22		stdout-path = "serial2:1500000n8";
23	};
24
25	backlight: edp-backlight {
26		compatible = "pwm-backlight";
27		power-supply = <&vcc_12v>;
28		pwms = <&pwm0 0 740740 0>;
29	};
30
31	edp_panel: edp-panel {
32		compatible = "boe,nv140fhmn49";
33		backlight = <&backlight>;
34		enable-gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
35		pinctrl-names = "default";
36		pinctrl-0 = <&panel_en_gpio>;
37		power-supply = <&vcc3v3_panel>;
38
39		ports {
40			#address-cells = <1>;
41			#size-cells = <0>;
42
43			port@0 {
44				reg = <0>;
45				#address-cells = <1>;
46				#size-cells = <0>;
47
48				panel_in_edp: endpoint@0 {
49					reg = <0>;
50					remote-endpoint = <&edp_out_panel>;
51				};
52			};
53		};
54	};
55
56	/*
57	 * Use separate nodes for gpio-keys to allow for selective deactivation
58	 * of wakeup sources via sysfs without disabling the whole key
59	 */
60	gpio-key-lid {
61		compatible = "gpio-keys";
62		pinctrl-names = "default";
63		pinctrl-0 = <&lidbtn_gpio>;
64
65		lid {
66			debounce-interval = <20>;
67			gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_LOW>;
68			label = "Lid";
69			linux,code = <SW_LID>;
70			linux,input-type = <EV_SW>;
71			wakeup-event-action = <EV_ACT_DEASSERTED>;
72			wakeup-source;
73		};
74	};
75
76	gpio-key-power {
77		compatible = "gpio-keys";
78		pinctrl-names = "default";
79		pinctrl-0 = <&pwrbtn_gpio>;
80
81		power {
82			debounce-interval = <20>;
83			gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
84			label = "Power";
85			linux,code = <KEY_POWER>;
86			wakeup-source;
87		};
88	};
89
90	leds {
91		compatible = "gpio-leds";
92		pinctrl-names = "default";
93		pinctrl-0 = <&pwrled_gpio &slpled_gpio>;
94
95		green-led {
96			color = <LED_COLOR_ID_GREEN>;
97			default-state = "on";
98			function = LED_FUNCTION_POWER;
99			gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>;
100			label = "green:power";
101		};
102
103		red-led {
104			color = <LED_COLOR_ID_RED>;
105			default-state = "off";
106			function = LED_FUNCTION_STANDBY;
107			gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
108			label = "red:standby";
109			panic-indicator;
110			retain-state-suspended;
111		};
112	};
113
114	/* Power sequence for SDIO WiFi module */
115	sdio_pwrseq: sdio-pwrseq {
116		compatible = "mmc-pwrseq-simple";
117		clocks = <&rk808 1>;
118		clock-names = "ext_clock";
119		pinctrl-names = "default";
120		pinctrl-0 = <&wifi_enable_h_gpio>;
121		post-power-on-delay-ms = <100>;
122		power-off-delay-us = <500000>;
123
124		/* WL_REG_ON on module */
125		reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
126	};
127
128	/* Audio components */
129	es8316-sound {
130		compatible = "simple-audio-card";
131		pinctrl-names = "default";
132		pinctrl-0 = <&hp_det_gpio>;
133		simple-audio-card,name = "rockchip,es8316-codec";
134		simple-audio-card,format = "i2s";
135		simple-audio-card,mclk-fs = <256>;
136
137		simple-audio-card,widgets =
138			"Microphone", "Mic Jack",
139			"Headphone", "Headphones",
140			"Speaker", "Speaker";
141		simple-audio-card,routing =
142			"MIC1", "Mic Jack",
143			"Headphones", "HPOL",
144			"Headphones", "HPOR",
145			"Speaker Amplifier INL", "HPOL",
146			"Speaker Amplifier INR", "HPOR",
147			"Speaker", "Speaker Amplifier OUTL",
148			"Speaker", "Speaker Amplifier OUTR";
149
150		simple-audio-card,hp-det-gpio = <&gpio0 RK_PB0 GPIO_ACTIVE_LOW>;
151		simple-audio-card,aux-devs = <&speaker_amp>;
152		simple-audio-card,pin-switches = "Speaker";
153
154		simple-audio-card,cpu {
155			sound-dai = <&i2s1>;
156		};
157
158		simple-audio-card,codec {
159			sound-dai = <&es8316>;
160		};
161	};
162
163	speaker_amp: speaker-amplifier {
164		compatible = "simple-audio-amplifier";
165		enable-gpios = <&gpio4 RK_PD3 GPIO_ACTIVE_HIGH>;
166		sound-name-prefix = "Speaker Amplifier";
167		VCC-supply = <&pa_5v>;
168	};
169
170	/* Power tree */
171	/* Root power source */
172	vcc_sysin: vcc-sysin {
173		compatible = "regulator-fixed";
174		regulator-name = "vcc_sysin";
175		regulator-always-on;
176		regulator-boot-on;
177	};
178
179	/* Regulators supplied by vcc_sysin */
180	/* LCD backlight supply */
181	vcc_12v: vcc-12v {
182		compatible = "regulator-fixed";
183		regulator-name = "vcc_12v";
184		regulator-always-on;
185		regulator-boot-on;
186		regulator-min-microvolt = <12000000>;
187		regulator-max-microvolt = <12000000>;
188		vin-supply = <&vcc_sysin>;
189
190		regulator-state-mem {
191			regulator-off-in-suspend;
192		};
193	};
194
195	/* Main 3.3 V supply */
196	vcc3v3_sys: wifi_bat: vcc3v3-sys {
197		compatible = "regulator-fixed";
198		regulator-name = "vcc3v3_sys";
199		regulator-always-on;
200		regulator-boot-on;
201		regulator-min-microvolt = <3300000>;
202		regulator-max-microvolt = <3300000>;
203		vin-supply = <&vcc_sysin>;
204
205		regulator-state-mem {
206			regulator-on-in-suspend;
207		};
208	};
209
210	/* 5 V USB power supply */
211	vcc5v0_usb: pa_5v: vcc5v0-usb-regulator {
212		compatible = "regulator-fixed";
213		enable-active-high;
214		gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
215		pinctrl-names = "default";
216		pinctrl-0 = <&pwr_5v_gpio>;
217		regulator-name = "vcc5v0_usb";
218		regulator-always-on;
219		regulator-min-microvolt = <5000000>;
220		regulator-max-microvolt = <5000000>;
221		vin-supply = <&vcc_sysin>;
222
223		regulator-state-mem {
224			regulator-off-in-suspend;
225		};
226	};
227
228	/* RK3399 logic supply */
229	vdd_log: vdd-log {
230		compatible = "pwm-regulator";
231		pwms = <&pwm2 0 25000 1>;
232		regulator-name = "vdd_log";
233		regulator-always-on;
234		regulator-boot-on;
235		regulator-min-microvolt = <800000>;
236		regulator-max-microvolt = <1400000>;
237		vin-supply = <&vcc_sysin>;
238
239		regulator-state-mem {
240			regulator-on-in-suspend;
241		};
242	};
243
244	/* Regulators supplied by vcc3v3_sys */
245	/* 0.9 V supply, always on */
246	vcc_0v9: vcc-0v9 {
247		compatible = "regulator-fixed";
248		regulator-name = "vcc_0v9";
249		regulator-always-on;
250		regulator-boot-on;
251		regulator-min-microvolt = <900000>;
252		regulator-max-microvolt = <900000>;
253		vin-supply = <&vcc3v3_sys>;
254	};
255
256	/* S3 1.8 V supply, switched by vcc1v8_s3 */
257	vcca1v8_s3: vcc1v8-s3 {
258		compatible = "regulator-fixed";
259		regulator-name = "vcca1v8_s3";
260		regulator-always-on;
261		regulator-boot-on;
262		regulator-min-microvolt = <1800000>;
263		regulator-max-microvolt = <1800000>;
264		vin-supply = <&vcc3v3_sys>;
265	};
266
267	/* micro SD card power */
268	vcc3v0_sd: vcc3v0-sd {
269		compatible = "regulator-fixed";
270		enable-active-high;
271		gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
272		pinctrl-names = "default";
273		pinctrl-0 = <&sdmmc0_pwr_h_gpio>;
274		regulator-name = "vcc3v0_sd";
275		regulator-always-on;
276		regulator-min-microvolt = <3000000>;
277		regulator-max-microvolt = <3000000>;
278		vin-supply = <&vcc3v3_sys>;
279
280		regulator-state-mem {
281			regulator-off-in-suspend;
282		};
283	};
284
285	/* LCD panel power, called VCC3V3_S0 in schematic */
286	vcc3v3_panel: vcc3v3-panel {
287		compatible = "regulator-fixed";
288		enable-active-high;
289		gpio = <&gpio1 RK_PC6 GPIO_ACTIVE_HIGH>;
290		pinctrl-names = "default";
291		pinctrl-0 = <&lcdvcc_en_gpio>;
292		regulator-name = "vcc3v3_panel";
293		regulator-always-on;
294		regulator-min-microvolt = <3300000>;
295		regulator-max-microvolt = <3300000>;
296		regulator-enable-ramp-delay = <100000>;
297		vin-supply = <&vcc3v3_sys>;
298
299		regulator-state-mem {
300			regulator-off-in-suspend;
301		};
302	};
303
304	/* M.2 adapter power, switched by vcc1v8_s3 */
305	vcc3v3_ssd: vcc3v3-ssd {
306		compatible = "regulator-fixed";
307		regulator-name = "vcc3v3_ssd";
308		regulator-min-microvolt = <3300000>;
309		regulator-max-microvolt = <3300000>;
310		vin-supply = <&vcc3v3_sys>;
311	};
312
313	/* Regulators supplied by vcc5v0_usb */
314	/* USB 3 port power supply regulator  */
315	vcc5v0_otg: vcc5v0-otg {
316		compatible = "regulator-fixed";
317		enable-active-high;
318		gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
319		pinctrl-names = "default";
320		pinctrl-0 = <&vcc5v0_host_en_gpio>;
321		regulator-name = "vcc5v0_otg";
322		regulator-always-on;
323		regulator-min-microvolt = <5000000>;
324		regulator-max-microvolt = <5000000>;
325		vin-supply = <&vcc5v0_usb>;
326
327		regulator-state-mem {
328			regulator-off-in-suspend;
329		};
330	};
331
332	/* Regulators supplied by vcc5v0_usb */
333	/* Type C port power supply regulator */
334	vbus_5vout: vbus_typec: vbus-5vout {
335		compatible = "regulator-fixed";
336		enable-active-high;
337		gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
338		pinctrl-names = "default";
339		pinctrl-0 = <&vcc5v0_typec0_en_gpio>;
340		regulator-name = "vbus_5vout";
341		regulator-min-microvolt = <5000000>;
342		regulator-max-microvolt = <5000000>;
343		vin-supply = <&vcc5v0_usb>;
344
345		regulator-state-mem {
346			regulator-off-in-suspend;
347		};
348	};
349
350	/* Regulators supplied by vcc_1v8 */
351	/* Primary 0.9 V LDO */
352	vcca0v9_s3: vcca0v9-s3 {
353		compatible = "regulator-fixed";
354		regulator-name = "vcc0v9_s3";
355		regulator-min-microvolt = <5000000>;
356		regulator-max-microvolt = <5000000>;
357		vin-supply = <&vcc_1v8>;
358
359		regulator-state-mem {
360			regulator-on-in-suspend;
361		};
362	};
363
364	mains_charger: dc-charger {
365		compatible = "gpio-charger";
366		charger-type = "mains";
367		gpios = <&gpio4 RK_PD0 GPIO_ACTIVE_LOW>;
368
369		/* Also triggered by USB charger */
370		pinctrl-names = "default";
371		pinctrl-0 = <&dc_det_gpio>;
372	};
373};
374
375&cdn_dp {
376	status = "okay";
377};
378
379&cpu_b0 {
380	cpu-supply = <&vdd_cpu_b>;
381};
382
383&cpu_b1 {
384	cpu-supply = <&vdd_cpu_b>;
385};
386
387&cpu_l0 {
388	cpu-supply = <&vdd_cpu_l>;
389};
390
391&cpu_l1 {
392	cpu-supply = <&vdd_cpu_l>;
393};
394
395&cpu_l2 {
396	cpu-supply = <&vdd_cpu_l>;
397};
398
399&cpu_l3 {
400	cpu-supply = <&vdd_cpu_l>;
401};
402
403&edp {
404	force-hpd;
405	pinctrl-names = "default";
406	pinctrl-0 = <&edp_hpd>;
407	status = "okay";
408
409	ports {
410		edp_out: port@1 {
411			reg = <1>;
412			#address-cells = <1>;
413			#size-cells = <0>;
414
415			edp_out_panel: endpoint@0 {
416				reg = <0>;
417				remote-endpoint = <&panel_in_edp>;
418			};
419		};
420	};
421};
422
423&emmc_phy {
424	status = "okay";
425};
426
427&gpu {
428	mali-supply = <&vdd_gpu>;
429	status = "okay";
430};
431
432&hdmi_sound {
433	status = "okay";
434};
435
436&i2c0 {
437	clock-frequency = <400000>;
438	i2c-scl-falling-time-ns = <4>;
439	i2c-scl-rising-time-ns = <168>;
440	status = "okay";
441
442	rk808: pmic@1b {
443		compatible = "rockchip,rk808";
444		reg = <0x1b>;
445		#clock-cells = <1>;
446		clock-output-names = "xin32k", "rk808-clkout2";
447		interrupt-parent = <&gpio3>;
448		interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
449		pinctrl-names = "default";
450		pinctrl-0 = <&pmic_int_l_gpio>;
451		rockchip,system-power-controller;
452		wakeup-source;
453
454		vcc1-supply = <&vcc_sysin>;
455		vcc2-supply = <&vcc_sysin>;
456		vcc3-supply = <&vcc_sysin>;
457		vcc4-supply = <&vcc_sysin>;
458		vcc6-supply = <&vcc_sysin>;
459		vcc7-supply = <&vcc_sysin>;
460		vcc8-supply = <&vcc3v3_sys>;
461		vcc9-supply = <&vcc_sysin>;
462		vcc10-supply = <&vcc_sysin>;
463		vcc11-supply = <&vcc_sysin>;
464		vcc12-supply = <&vcc3v3_sys>;
465		vcc13-supply = <&vcc_sysin>;
466		vcc14-supply = <&vcc_sysin>;
467
468		regulators {
469			/* rk3399 center logic supply */
470			vdd_center: DCDC_REG1 {
471				regulator-name = "vdd_center";
472				regulator-always-on;
473				regulator-boot-on;
474				regulator-min-microvolt = <750000>;
475				regulator-max-microvolt = <1350000>;
476				regulator-ramp-delay = <6001>;
477
478				regulator-state-mem {
479					regulator-off-in-suspend;
480				};
481			};
482
483			vdd_cpu_l: DCDC_REG2 {
484				regulator-name = "vdd_cpu_l";
485				regulator-always-on;
486				regulator-boot-on;
487				regulator-min-microvolt = <750000>;
488				regulator-max-microvolt = <1350000>;
489				regulator-ramp-delay = <6001>;
490
491				regulator-state-mem {
492					regulator-off-in-suspend;
493				};
494			};
495
496			vcc_ddr: DCDC_REG3 {
497				regulator-name = "vcc_ddr";
498				regulator-always-on;
499				regulator-boot-on;
500
501				regulator-state-mem {
502					regulator-on-in-suspend;
503				};
504			};
505
506			vcc_1v8: vcc_wl: DCDC_REG4 {
507				regulator-name = "vcc_1v8";
508				regulator-always-on;
509				regulator-boot-on;
510				regulator-min-microvolt = <1800000>;
511				regulator-max-microvolt = <1800000>;
512
513				regulator-state-mem {
514					regulator-on-in-suspend;
515					regulator-suspend-microvolt = <1800000>;
516				};
517			};
518
519			/* not used */
520			LDO_REG1 {
521			};
522
523			/* not used */
524			LDO_REG2 {
525			};
526
527			vcc1v8_pmupll: LDO_REG3 {
528				regulator-name = "vcc1v8_pmupll";
529				regulator-always-on;
530				regulator-boot-on;
531				regulator-min-microvolt = <1800000>;
532				regulator-max-microvolt = <1800000>;
533
534				regulator-state-mem {
535					regulator-on-in-suspend;
536					regulator-suspend-microvolt = <1800000>;
537				};
538			};
539
540			vcc_sdio: LDO_REG4 {
541				regulator-name = "vcc_sdio";
542				regulator-always-on;
543				regulator-boot-on;
544				regulator-min-microvolt = <1800000>;
545				regulator-max-microvolt = <3000000>;
546
547				regulator-state-mem {
548					regulator-on-in-suspend;
549					regulator-suspend-microvolt = <3000000>;
550				};
551			};
552
553			vcca3v0_codec: LDO_REG5 {
554				regulator-name = "vcca3v0_codec";
555				regulator-always-on;
556				regulator-boot-on;
557				regulator-min-microvolt = <3000000>;
558				regulator-max-microvolt = <3000000>;
559
560				regulator-state-mem {
561					regulator-off-in-suspend;
562				};
563			};
564
565			vcc_1v5: LDO_REG6 {
566				regulator-name = "vcc_1v5";
567				regulator-always-on;
568				regulator-boot-on;
569				regulator-min-microvolt = <1500000>;
570				regulator-max-microvolt = <1500000>;
571
572				regulator-state-mem {
573					regulator-on-in-suspend;
574					regulator-suspend-microvolt = <1500000>;
575				};
576			};
577
578			vcca1v8_codec: LDO_REG7 {
579				regulator-name = "vcca1v8_codec";
580				regulator-always-on;
581				regulator-boot-on;
582				regulator-min-microvolt = <1800000>;
583				regulator-max-microvolt = <1800000>;
584
585				regulator-state-mem {
586					regulator-off-in-suspend;
587				};
588			};
589
590			vcc_3v0: LDO_REG8 {
591				regulator-name = "vcc_3v0";
592				regulator-always-on;
593				regulator-boot-on;
594				regulator-min-microvolt = <3000000>;
595				regulator-max-microvolt = <3000000>;
596
597				regulator-state-mem {
598					regulator-on-in-suspend;
599					regulator-suspend-microvolt = <3000000>;
600				};
601			};
602
603			vcc3v3_s3: SWITCH_REG1 {
604				regulator-name = "vcc3v3_s3";
605				regulator-always-on;
606				regulator-boot-on;
607
608				regulator-state-mem {
609					regulator-off-in-suspend;
610				};
611			};
612
613			vcc3v3_s0: SWITCH_REG2 {
614				regulator-name = "vcc3v3_s0";
615				regulator-always-on;
616				regulator-boot-on;
617
618				regulator-state-mem {
619					regulator-off-in-suspend;
620				};
621			};
622		};
623	};
624
625	vdd_cpu_b: regulator@40 {
626		compatible = "silergy,syr827";
627		reg = <0x40>;
628		fcs,suspend-voltage-selector = <1>;
629		pinctrl-names = "default";
630		pinctrl-0 = <&vsel1_gpio>;
631		regulator-name = "vdd_cpu_b";
632		regulator-always-on;
633		regulator-boot-on;
634		regulator-min-microvolt = <712500>;
635		regulator-max-microvolt = <1500000>;
636		regulator-ramp-delay = <1000>;
637		vin-supply = <&vcc_1v8>;
638
639		regulator-state-mem {
640			regulator-off-in-suspend;
641		};
642	};
643
644	vdd_gpu: regulator@41 {
645		compatible = "silergy,syr828";
646		reg = <0x41>;
647		fcs,suspend-voltage-selector = <1>;
648		pinctrl-names = "default";
649		pinctrl-0 = <&vsel2_gpio>;
650		regulator-name = "vdd_gpu";
651		regulator-always-on;
652		regulator-boot-on;
653		regulator-min-microvolt = <712500>;
654		regulator-max-microvolt = <1500000>;
655		regulator-ramp-delay = <1000>;
656		vin-supply = <&vcc_1v8>;
657
658		regulator-state-mem {
659			regulator-off-in-suspend;
660		};
661	};
662};
663
664&i2c1 {
665	clock-frequency = <100000>;
666	i2c-scl-falling-time-ns = <4>;
667	i2c-scl-rising-time-ns = <168>;
668	status = "okay";
669
670	es8316: es8316@11 {
671		compatible = "everest,es8316";
672		reg = <0x11>;
673		clocks = <&cru SCLK_I2S_8CH_OUT>;
674		clock-names = "mclk";
675		#sound-dai-cells = <0>;
676	};
677};
678
679&i2c3 {
680	i2c-scl-falling-time-ns = <15>;
681	i2c-scl-rising-time-ns = <450>;
682	status = "okay";
683};
684
685&i2c4 {
686	i2c-scl-falling-time-ns = <20>;
687	i2c-scl-rising-time-ns = <600>;
688	status = "okay";
689
690	fusb0: fusb30x@22 {
691		compatible = "fcs,fusb302";
692		reg = <0x22>;
693		fcs,int_n = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>;
694		pinctrl-names = "default";
695		pinctrl-0 = <&fusb0_int_gpio>;
696		vbus-supply = <&vbus_typec>;
697
698		connector {
699			compatible = "usb-c-connector";
700			data-role = "host";
701			label = "USB-C";
702			op-sink-microwatt = <1000000>;
703			power-role = "dual";
704			sink-pdos =
705				<PDO_FIXED(5000, 2500, PDO_FIXED_USB_COMM)>;
706			source-pdos =
707				<PDO_FIXED(5000, 1400, PDO_FIXED_USB_COMM)>;
708			try-power-role = "sink";
709
710			ports {
711				#address-cells = <1>;
712				#size-cells = <0>;
713
714				port@0 {
715					reg = <0>;
716
717					usbc_hs: endpoint {
718						remote-endpoint =
719							<&u2phy0_typec_hs>;
720					};
721				};
722
723				port@1 {
724					reg = <1>;
725
726					usbc_ss: endpoint {
727						remote-endpoint =
728							<&tcphy0_typec_ss>;
729					};
730				};
731
732				port@2 {
733					reg = <2>;
734
735					usbc_dp: endpoint {
736						remote-endpoint =
737							<&tcphy0_typec_dp>;
738					};
739				};
740			};
741		};
742	};
743};
744
745&i2s1 {
746	pinctrl-names = "default";
747	pinctrl-0 = <&i2s_8ch_mclk_gpio>, <&i2s1_2ch_bus>;
748	rockchip,capture-channels = <8>;
749	rockchip,playback-channels = <8>;
750	status = "okay";
751};
752
753&io_domains {
754	audio-supply = <&vcc_3v0>;
755	gpio1830-supply = <&vcc_3v0>;
756	sdmmc-supply = <&vcc_sdio>;
757	status = "okay";
758};
759
760&pcie_phy {
761	status = "okay";
762};
763
764&pcie0 {
765	bus-scan-delay-ms = <1000>;
766	ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>;
767	max-link-speed = <2>;
768	num-lanes = <4>;
769	pinctrl-names = "default";
770	pinctrl-0 = <&pcie_clkreqn_cpm>;
771	vpcie0v9-supply = <&vcca0v9_s3>;
772	vpcie1v8-supply = <&vcca1v8_s3>;
773	vpcie3v3-supply = <&vcc3v3_ssd>;
774	status = "okay";
775};
776
777&pinctrl {
778	buttons {
779		pwrbtn_gpio: pwrbtn-gpio {
780			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
781		};
782
783		lidbtn_gpio: lidbtn-gpio {
784			rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
785		};
786	};
787
788	dc-charger {
789		dc_det_gpio: dc-det-gpio {
790			rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
791		};
792	};
793
794	es8316 {
795		hp_det_gpio: hp-det-gpio {
796			rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_down>;
797		};
798	};
799
800	fusb302x {
801		fusb0_int_gpio: fusb0-int-gpio {
802			rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
803		};
804	};
805
806	i2s1 {
807		i2s_8ch_mclk_gpio: i2s-8ch-mclk-gpio {
808			rockchip,pins = <4 RK_PA0 1 &pcfg_pull_none>;
809		};
810	};
811
812	lcd-panel {
813		lcdvcc_en_gpio: lcdvcc-en-gpio {
814			rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
815		};
816
817		panel_en_gpio: panel-en-gpio {
818			rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
819		};
820
821		lcd_panel_reset_gpio: lcd-panel-reset-gpio {
822			rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
823		};
824	};
825
826	leds {
827		pwrled_gpio: pwrled_gpio {
828			rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
829		};
830
831		slpled_gpio: slpled_gpio {
832			rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
833		};
834	};
835
836	pmic {
837		pmic_int_l_gpio: pmic-int-l-gpio {
838			rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>;
839		};
840
841		vsel1_gpio: vsel1-gpio {
842			rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
843		};
844
845		vsel2_gpio: vsel2-gpio {
846			rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
847		};
848	};
849
850	sdcard {
851		sdmmc0_pwr_h_gpio: sdmmc0-pwr-h-gpio {
852			rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
853		};
854
855	};
856
857	sdio-pwrseq {
858		wifi_enable_h_gpio: wifi-enable-h-gpio {
859			rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
860		};
861	};
862
863	usb-typec {
864		vcc5v0_typec0_en_gpio: vcc5v0-typec0-en-gpio {
865			rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
866		};
867	};
868
869	usb2 {
870		pwr_5v_gpio: pwr-5v-gpio {
871			rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
872		};
873
874		vcc5v0_host_en_gpio: vcc5v0-host-en-gpio {
875			rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
876		};
877	};
878
879	wireless-bluetooth {
880		bt_wake_gpio: bt-wake-gpio {
881			rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
882		};
883
884		bt_host_wake_gpio: bt-host-wake-gpio {
885			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
886		};
887
888		bt_reset_gpio: bt-reset-gpio {
889			rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
890		};
891	};
892};
893
894&pmu_io_domains {
895	pmu1830-supply = <&vcc_3v0>;
896	status = "okay";
897};
898
899&pwm0 {
900	status = "okay";
901};
902
903&pwm2 {
904	status = "okay";
905};
906
907&saradc {
908	vref-supply = <&vcca1v8_s3>;
909	status = "okay";
910};
911
912&sdmmc {
913	bus-width = <4>;
914	cap-mmc-highspeed;
915	cap-sd-highspeed;
916	cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
917	disable-wp;
918	pinctrl-names = "default";
919	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
920	sd-uhs-sdr104;
921	vmmc-supply = <&vcc3v0_sd>;
922	vqmmc-supply = <&vcc_sdio>;
923	status = "okay";
924};
925
926&sdio0 {
927	bus-width = <4>;
928	cap-sd-highspeed;
929	cap-sdio-irq;
930	keep-power-in-suspend;
931	mmc-pwrseq = <&sdio_pwrseq>;
932	non-removable;
933	pinctrl-names = "default";
934	pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
935	sd-uhs-sdr104;
936	status = "okay";
937};
938
939&sdhci {
940	bus-width = <8>;
941	mmc-hs200-1_8v;
942	non-removable;
943	status = "okay";
944};
945
946&spi1 {
947	max-freq = <10000000>;
948	status = "okay";
949
950	spiflash: flash@0 {
951		compatible = "jedec,spi-nor";
952		reg = <0>;
953		m25p,fast-read;
954		spi-max-frequency = <10000000>;
955	};
956};
957
958&tcphy0 {
959	status = "okay";
960};
961
962&tcphy0_dp {
963	port {
964		tcphy0_typec_dp: endpoint {
965			remote-endpoint = <&usbc_dp>;
966		};
967	};
968};
969
970&tcphy0_usb3 {
971	port {
972		tcphy0_typec_ss: endpoint {
973			remote-endpoint = <&usbc_ss>;
974		};
975	};
976};
977
978&tcphy1 {
979	status = "okay";
980};
981
982&tsadc {
983	/* tshut mode 0:CRU 1:GPIO */
984	rockchip,hw-tshut-mode = <1>;
985	/* tshut polarity 0:LOW 1:HIGH */
986	rockchip,hw-tshut-polarity = <1>;
987	status = "okay";
988};
989
990&u2phy0 {
991	status = "okay";
992
993	u2phy0_otg: otg-port {
994		status = "okay";
995	};
996
997	u2phy0_host: host-port {
998		phy-supply = <&vcc5v0_otg>;
999		status = "okay";
1000	};
1001
1002	port {
1003		u2phy0_typec_hs: endpoint {
1004			remote-endpoint = <&usbc_hs>;
1005		};
1006	};
1007};
1008
1009&u2phy1 {
1010	status = "okay";
1011
1012	u2phy1_otg: otg-port {
1013		status = "okay";
1014	};
1015
1016	u2phy1_host: host-port {
1017		phy-supply = <&vcc5v0_otg>;
1018		status = "okay";
1019	};
1020};
1021
1022&uart0 {
1023	pinctrl-names = "default";
1024	pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
1025	uart-has-rtscts;
1026	status = "okay";
1027
1028	bluetooth {
1029		compatible = "brcm,bcm4345c5";
1030		clocks = <&rk808 1>;
1031		clock-names = "lpo";
1032		device-wakeup-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
1033		host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
1034		max-speed = <1500000>;
1035		pinctrl-names = "default";
1036		pinctrl-0 = <&bt_host_wake_gpio &bt_wake_gpio &bt_reset_gpio>;
1037		shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
1038		vbat-supply = <&wifi_bat>;
1039		vddio-supply = <&vcc_wl>;
1040	};
1041};
1042
1043&uart2 {
1044	status = "okay";
1045};
1046
1047&usb_host0_ehci {
1048	status = "okay";
1049};
1050
1051&usb_host0_ohci {
1052	status = "okay";
1053};
1054
1055&usb_host1_ehci {
1056	status = "okay";
1057};
1058
1059&usb_host1_ohci {
1060	status = "okay";
1061};
1062
1063&usbdrd3_0 {
1064	status = "okay";
1065};
1066
1067&usbdrd_dwc3_0 {
1068	dr_mode = "host";
1069	status = "okay";
1070};
1071
1072&usbdrd3_1 {
1073	status = "okay";
1074};
1075
1076&usbdrd_dwc3_1 {
1077	dr_mode = "host";
1078	status = "okay";
1079};
1080
1081&vopb {
1082	status = "okay";
1083};
1084
1085&vopb_mmu {
1086	status = "okay";
1087};
1088
1089&vopl {
1090	status = "okay";
1091};
1092
1093&vopl_mmu {
1094	status = "okay";
1095};
1096