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