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