ARM64: dts: rk3399-mid: close gpu power in suspend
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3399-mid-818-android.dts
1 /*
2  * Copyright (c) 2016 Fuzhou Rockchip Electronics Co., Ltd
3  *
4  * This file is dual-licensed: you can use it either under the terms
5  * of the GPL or the X11 license, at your option. Note that this dual
6  * licensing only applies to this file, and not this project as a
7  * whole.
8  *
9  *  a) This file is free software; you can redistribute it and/or
10  *     modify it under the terms of the GNU General Public License as
11  *     published by the Free Software Foundation; either version 2 of the
12  *     License, or (at your option) any later version.
13  *
14  *     This file is distributed in the hope that it will be useful,
15  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *     GNU General Public License for more details.
18  *
19  * Or, alternatively,
20  *
21  *  b) Permission is hereby granted, free of charge, to any person
22  *     obtaining a copy of this software and associated documentation
23  *     files (the "Software"), to deal in the Software without
24  *     restriction, including without limitation the rights to use,
25  *     copy, modify, merge, publish, distribute, sublicense, and/or
26  *     sell copies of the Software, and to permit persons to whom the
27  *     Software is furnished to do so, subject to the following
28  *     conditions:
29  *
30  *     The above copyright notice and this permission notice shall be
31  *     included in all copies or substantial portions of the Software.
32  *
33  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40  *     OTHER DEALINGS IN THE SOFTWARE.
41  */
42
43 /dts-v1/;
44
45 #include "rk3399.dtsi"
46 #include "rk3399-android.dtsi"
47 #include <dt-bindings/sensor-dev.h>
48 #include <dt-bindings/pwm/pwm.h>
49
50 / {
51         compatible = "rockchip,rk3399-mid", "rockchip,rk3399";
52
53         vcc_sys: vcc-sys {
54                 compatible = "regulator-fixed";
55                 regulator-name = "vcc_sys";
56                 regulator-always-on;
57                 regulator-boot-on;
58                 regulator-min-microvolt = <3900000>;
59                 regulator-max-microvolt = <3900000>;
60         };
61
62         vcc3v3_sys: vcc3v3-sys {
63                 compatible = "regulator-fixed";
64                 regulator-name = "vcc3v3_sys";
65                 regulator-always-on;
66                 regulator-boot-on;
67                 regulator-min-microvolt = <3300000>;
68                 regulator-max-microvolt = <3300000>;
69         };
70
71         vcc5v0_host: vcc5v0-host-regulator {
72                 compatible = "regulator-fixed";
73                 enable-active-high;
74                 gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>;
75                 pinctrl-names = "default";
76                 pinctrl-0 = <&host_vbus_drv>;
77                 regulator-name = "vcc5v0_host";
78         };
79
80         vdd_log: vdd-log {
81                 compatible = "pwm-regulator";
82                 pwms = <&pwm2 0 25000 0>;
83                 rockchip,pwm_id= <2>;
84                 rockchip,pwm_voltage = <900000>;
85                 regulator-name = "vdd_log";
86                 regulator-min-microvolt = <750000>;
87                 regulator-max-microvolt = <1350000>;
88                 regulator-always-on;
89                 regulator-boot-on;
90         };
91
92         backlight: backlight {
93                 compatible = "pwm-backlight";
94                 pwms = <&vop0_pwm 0 25000 PWM_POLARITY_INVERTED>;
95                 brightness-levels = <
96                         0  255  51  51  52  53  53  54
97                         54  55  56  56  57  57  58  59
98                         59  60  60  61  62  62  63  63
99                         64  65  65  66  66  67  68  68
100                         69  69  70  71  71  72  72  73
101                         74  74  75  75  76  77  77  78
102                         78  79  80  80  81  81  82  83
103                         83  84  85  85  86  86  87  88
104                         88  89  89  90  91  91  92  92
105                         93  94  94  95  95  96  97  97
106                         98  98  99  100 100 101 101 102
107                         103 103 104 104 105 106 106 107
108                         107 108 109 109 110 110 111 112
109                         112 113 113 114 114 115 116 116
110                         117 118 118 119 119 120 120 121
111                         122 122 123 123 124 125 125 126
112                         126 127 128 128 129 129 130 131
113                         131 132 132 133 133 134 135 135
114                         136 137 138 138 139 140 140 141
115                         141 142 143 143 144 144 145 146
116                         146 147 148 148 149 149 149 150
117                         150 151 151 151 152 152 152 153
118                         153 153 154 154 155 156 156 157
119                         157 158 159 159 160 160 161 161
120                         162 163 163 164 165 165 166 166
121                         167 168 168 169 169 170 171 171
122                         172 172 173 174 174 175 175 176
123                         176 177 178 178 179 179 180 181
124                         181 182 183 183 184 185 185 186
125                         186 187 188 188 189 189 190 190
126                         191 191 192 193 193 194 194 195
127                         196 197 197 198 199 199 200 200>;
128                 default-brightness-level = <200>;
129                 enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
130         };
131
132         vcc_phy: vcc-phy-regulator {
133                 compatible = "regulator-fixed";
134                 regulator-name = "vcc_phy";
135                 regulator-always-on;
136                 regulator-boot-on;
137         };
138
139         io-domains {
140                 compatible = "rockchip,rk3399-io-voltage-domain";
141                 rockchip,grf = <&grf>;
142
143                 bt656-supply = <&vcc1v8_dvp>;
144                 audio-supply = <&vcca1v8_codec>;
145                 sdmmc-supply = <&vcc_sd>;
146                 gpio1830-supply = <&vcc_3v0>;
147         };
148
149         pmu-io-domains {
150                 compatible = "rockchip,rk3399-pmu-io-voltage-domain";
151                 rockchip,grf = <&pmugrf>;
152
153                 pmu1830-supply = <&vcc_1v8>;
154         };
155
156         es8316-sound {
157                 compatible = "simple-audio-card";
158                 simple-audio-card,format = "i2s";
159                 simple-audio-card,name = "rockchip,es8316-codec";
160                 simple-audio-card,mclk-fs = <256>;
161                 simple-audio-card,widgets =
162                         "Microphone", "Mic Jack",
163                         "Headphone", "Headphone Jack";
164                 simple-audio-card,routing =
165                         "Mic Jack", "MICBIAS1",
166                         "IN1P", "Mic Jack",
167                         "Headphone Jack", "HPOL",
168                         "Headphone Jack", "HPOR";
169                 simple-audio-card,cpu {
170                         sound-dai = <&i2s0>;
171                 };
172                 simple-audio-card,codec {
173                         sound-dai = <&es8316>;
174                 };
175         };
176
177         spdif-sound {
178                 compatible = "simple-audio-card";
179                 simple-audio-card,name = "rockchip,spdif";
180                 simple-audio-card,cpu {
181                         sound-dai = <&spdif>;
182                 };
183                 simple-audio-card,codec {
184                         sound-dai = <&spdif_out>;
185                 };
186         };
187
188         spdif_out: spdif-out {
189                 compatible = "linux,spdif-dit";
190                 #sound-dai-cells = <0>;
191         };
192
193         sdio_pwrseq: sdio-pwrseq {
194                 compatible = "mmc-pwrseq-simple";
195                 clocks = <&rk818 1>;
196                 clock-names = "ext_clock";
197                 pinctrl-names = "default";
198                 pinctrl-0 = <&wifi_enable_h>;
199
200                 /*
201                  * On the module itself this is one of these (depending
202                  * on the actual card populated):
203                  * - SDIO_RESET_L_WL_REG_ON
204                  * - PDN (power down when low)
205                  */
206                 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
207         };
208
209         wireless-wlan {
210                 compatible = "wlan-platdata";
211                 rockchip,grf = <&grf>;
212                 wifi_chip_type = "ap6354";
213                 sdio_vref = <1800>;
214                 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
215                 status = "okay";
216         };
217
218         wireless-bluetooth {
219                 compatible = "bluetooth-platdata";
220                 clocks = <&rk818 1>;
221                 clock-names = "ext_clock";
222                 //wifi-bt-power-toggle;
223                 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
224                 pinctrl-names = "default", "rts_gpio";
225                 pinctrl-0 = <&uart0_rts>;
226                 pinctrl-1 = <&uart0_gpios>;
227                 //BT,power_gpio  = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */
228                 BT,reset_gpio    = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
229                 BT,wake_gpio     = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
230                 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
231                 status = "okay";
232         };
233
234         uboot-charge {
235                 compatible = "rockchip,uboot-charge";
236                 rockchip,uboot-charge-on = <0>;
237                 rockchip,android-charge-on = <1>;
238         };
239 };
240
241 &dfi {
242         status = "okay";
243 };
244
245 &dmc {
246         status = "okay";
247         center-supply = <&vdd_center>;
248         upthreshold = <38>;
249         downdifferential = <20>;
250 };
251
252 &dmc_opp_table {
253         opp@300000000 {
254                 opp-hz = /bits/ 64 <300000000>;
255                 opp-microvolt = <900000>;
256         };
257         opp@400000000 {
258                 opp-hz = /bits/ 64 <400000000>;
259                 opp-microvolt = <900000>;
260         };
261         opp@528000000 {
262                 opp-hz = /bits/ 64 <528000000>;
263                 opp-microvolt = <900000>;
264         };
265         opp@600000000 {
266                 opp-hz = /bits/ 64 <600000000>;
267                 opp-microvolt = <900000>;
268         };
269         opp@666000000 {
270                 opp-hz = /bits/ 64 <666000000>;
271                 opp-microvolt = <900000>;
272                 opp-suspend;
273         };
274
275         vibrator {
276                 compatible = "rk-vibrator-gpio";
277                 vibrator-gpio = <&gpio4 30 GPIO_ACTIVE_LOW>;
278                 status = "okay";
279         };
280 };
281
282 &cluster0_opp {
283         opp@408000000 {
284                 opp-hz = /bits/ 64 <408000000>;
285                 opp-microvolt = <800000>;
286                 clock-latency-ns = <40000>;
287         };
288         opp@600000000 {
289                 opp-hz = /bits/ 64 <600000000>;
290                 opp-microvolt = <800000>;
291         };
292         opp@816000000 {
293                 opp-hz = /bits/ 64 <816000000>;
294                 opp-microvolt = <800000>;
295         };
296         opp@1008000000 {
297                 opp-hz = /bits/ 64 <1008000000>;
298                 opp-microvolt = <875000>;
299         };
300         opp@1200000000 {
301                 opp-hz = /bits/ 64 <1200000000>;
302                 opp-microvolt = <925000>;
303         };
304         opp@1416000000 {
305                 opp-hz = /bits/ 64 <1416000000>;
306                 opp-microvolt = <1050000>;
307         };
308         opp@1512000000 {
309                 opp-hz = /bits/ 64 <1512000000>;
310                 opp-microvolt = <1100000>;
311                 status="disabled";
312         };
313 };
314
315 &cluster1_opp {
316         opp@408000000 {
317                 opp-hz = /bits/ 64 <408000000>;
318                 opp-microvolt = <800000>;
319                 clock-latency-ns = <40000>;
320         };
321         opp@600000000 {
322                 opp-hz = /bits/ 64 <600000000>;
323                 opp-microvolt = <800000>;
324         };
325         opp@816000000 {
326                 opp-hz = /bits/ 64 <816000000>;
327                 opp-microvolt = <825000>;
328         };
329         opp@1008000000 {
330                 opp-hz = /bits/ 64 <1008000000>;
331                 opp-microvolt = <875000>;
332         };
333         opp@1200000000 {
334                 opp-hz = /bits/ 64 <1200000000>;
335                 opp-microvolt = <950000>;
336         };
337         opp@1416000000 {
338                 opp-hz = /bits/ 64 <1416000000>;
339                 opp-microvolt = <1025000>;
340         };
341         opp@1608000000 {
342                 opp-hz = /bits/ 64 <1608000000>;
343                 opp-microvolt = <1100000>;
344         };
345         opp@1800000000 {
346                 opp-hz = /bits/ 64 <1800000000>;
347                 opp-microvolt = <1175000>;
348         };
349         opp@1992000000 {
350                 opp-hz = /bits/ 64 <1992000000>;
351                 opp-microvolt = <1250000>;
352         };
353 };
354
355 &CPU_COST_A72 {
356         busy-cost-data = <
357                 210   129       /*  408MHz */
358                 308   184       /*  600MHz */
359                 419   246       /*  816MHz */
360                 518   335       /* 1008MHz */
361                 617   428       /* 1200MHz */
362                 728   573       /* 1416MHz */
363                 827   724       /* 1608MHz */
364                 925   900       /* 1800MHz */
365                 1024  1108      /* 1992MHz */
366         >;
367         idle-cost-data = <
368               15
369               15
370                0
371         >;
372 };
373
374 &CPU_COST_A53 {
375         busy-cost-data = <
376                 108    46       /*  408M */
377                 159    67       /*  600M */
378                 216    90       /*  816M */
379                 267    120      /* 1008M */
380                 318    153      /* 1200M */
381                 375    198      /* 1416M */
382                 401    222      /* 1512M */
383         >;
384         idle-cost-data = <
385               6
386               6
387               0
388         >;
389 };
390
391 &CLUSTER_COST_A72 {
392         busy-cost-data = <
393                 210   129       /*  408MHz */
394                 308   184       /*  600MHz */
395                 419   246       /*  816MHz */
396                 518   335       /* 1008MHz */
397                 617   428       /* 1200MHz */
398                 728   573       /* 1416MHz */
399                 827   724       /* 1608MHz */
400                 925   900       /* 1800MHz */
401                 1024  1108      /* 1992MHz */
402         >;
403         idle-cost-data = <
404                  65
405                  65
406                  65
407         >;
408 };
409
410 &CLUSTER_COST_A53 {
411         busy-cost-data = <
412                 108    46       /*  408M */
413                 159    67       /*  600M */
414                 216    90       /*  816M */
415                 267    120      /* 1008M */
416                 318    153      /* 1200M */
417                 375    198      /* 1416M */
418                 401    222      /* 1512M */
419         >;
420         idle-cost-data = <
421                 56
422                 56
423                 56
424         >;
425 };
426
427 &gpu_opp_table {
428         compatible = "operating-points-v2";
429         opp-shared;
430         opp@200000000 {
431                 opp-hz = /bits/ 64 <200000000>;
432                 opp-microvolt = <825000>;
433         };
434         opp@300000000 {
435                 opp-hz = /bits/ 64 <300000000>;
436                 opp-microvolt = <850000>;
437         };
438         opp@400000000 {
439                 opp-hz = /bits/ 64 <400000000>;
440                 opp-microvolt = <875000>;
441         };
442         opp@500000000 {
443                 opp-hz = /bits/ 64 <500000000>;
444                 opp-microvolt = <950000>;
445         };
446         opp@600000000 {
447                 opp-hz = /bits/ 64 <600000000>;
448                 opp-microvolt = <1025000>;
449         };
450         opp@800000000 {
451                 opp-hz = /bits/ 64 <800000000>;
452                 opp-microvolt = <1125000>;
453         };
454 };
455
456 &rk_key {
457         compatible = "rockchip,key";
458         status = "okay";
459
460         io-channels = <&saradc 1>;
461
462         vol-up-key {
463                 linux,code = <114>;
464                 label = "volume up";
465                 rockchip,adc_value = <1>;
466         };
467
468         vol-down-key {
469                 linux,code = <115>;
470                 label = "volume down";
471                 rockchip,adc_value = <170>;
472         };
473
474         power-key {
475                 gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
476                 linux,code = <116>;
477                 label = "power";
478                 gpio-key,wakeup;
479         };
480
481         menu-key {
482                 linux,code = <59>;
483                 label = "menu";
484                 rockchip,adc_value = <746>;
485         };
486
487         home-key {
488                 linux,code = <102>;
489                 label = "home";
490                 rockchip,adc_value = <355>;
491         };
492
493         back-key {
494                 linux,code = <158>;
495                 label = "back";
496                 rockchip,adc_value = <560>;
497         };
498
499         camera-key {
500                 linux,code = <212>;
501                 label = "camera";
502                 rockchip,adc_value = <450>;
503         };
504 };
505
506 &sdmmc {
507         clock-frequency = <50000000>;
508         clock-freq-min-max = <400000 150000000>;
509         supports-sd;
510         bus-width = <4>;
511         cap-mmc-highspeed;
512         cap-sd-highspeed;
513         disable-wp;
514         num-slots = <1>;
515         sd-uhs-sdr104;
516         vqmmc-supply = <&vcc_sd>;
517         pinctrl-names = "default";
518         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
519         status = "okay";
520 };
521
522 &sdio0 {
523         clock-frequency = <150000000>;
524         clock-freq-min-max = <200000 150000000>;
525         supports-sdio;
526         bus-width = <4>;
527         disable-wp;
528         cap-sd-highspeed;
529         cap-sdio-irq;
530         keep-power-in-suspend;
531         mmc-pwrseq = <&sdio_pwrseq>;
532         non-removable;
533         num-slots = <1>;
534         pinctrl-names = "default";
535         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
536         sd-uhs-sdr104;
537         status = "okay";
538 };
539
540 &emmc_phy {
541         freq-sel = <200000000>;
542         dr-sel = <50>;
543         opdelay = <4>;
544         status = "okay";
545 };
546
547 &sdhci {
548         bus-width = <8>;
549         mmc-hs400-1_8v;
550         supports-emmc;
551         non-removable;
552         mmc-hs400-enhanced-strobe;
553         status = "okay";
554 };
555
556 &i2s0 {
557         status = "okay";
558         rockchip,i2s-broken-burst-len;
559         rockchip,playback-channels = <8>;
560         rockchip,capture-channels = <8>;
561         #sound-dai-cells = <0>;
562 };
563
564 &i2s2 {
565         #sound-dai-cells = <0>;
566 };
567
568 &spdif {
569         status = "okay";
570         #sound-dai-cells = <0>;
571 };
572
573 &i2c0 {
574         status = "okay";
575         i2c-scl-rising-time-ns = <180>;
576         i2c-scl-falling-time-ns = <30>;
577         clock-frequency = <400000>;
578
579         vdd_cpu_b: syr837@40 {
580                 compatible = "silergy,syr827";
581                 reg = <0x40>;
582                 vin-supply = <&vcc_sys>;
583                 regulator-compatible = "fan53555-reg";
584                 pinctrl-0 = <&vsel1_gpio>;
585                 vsel-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
586                 regulator-name = "vdd_cpu_b";
587                 regulator-min-microvolt = <712500>;
588                 regulator-max-microvolt = <1500000>;
589                 regulator-ramp-delay = <1000>;
590                 fcs,suspend-voltage-selector = <1>;
591                 regulator-always-on;
592                 regulator-initial-state = <3>;
593                 regulator-state-mem {
594                         regulator-off-in-suspend;
595                 };
596         };
597
598         vdd_gpu: syr828@41 {
599                 compatible = "silergy,syr828";
600                 status = "okay";
601                 reg = <0x41>;
602                 vin-supply = <&vcc_sys>;
603                 regulator-compatible = "fan53555-reg";
604                 pinctrl-0 = <&vsel2_gpio>;
605                 vsel-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
606                 regulator-name = "vdd_gpu";
607                 regulator-min-microvolt = <735000>;
608                 regulator-max-microvolt = <1400000>;
609                 regulator-ramp-delay = <1000>;
610                 fcs,suspend-voltage-selector = <1>;
611                 regulator-boot-on;
612                 regulator-state-mem {
613                         regulator-off-in-suspend;
614                 };
615         };
616
617         rk818: pmic@1c {
618                 compatible = "rockchip,rk818";
619                 status = "okay";
620                 reg = <0x1c>;
621                 clock-output-names = "xin32k", "wifibt_32kin";
622                 interrupt-parent = <&gpio1>;
623                 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
624                 pinctrl-names = "default";
625                 pinctrl-0 = <&pmic_int_l>;
626                 rockchip,system-power-controller;
627                 rk818,support_dc_chg = <1>;/*1: dc chg; 0:usb chg*/
628                 wakeup-source;
629                 extcon = <&fusb0>;
630                 #clock-cells = <1>;
631
632                 vcc1-supply = <&vcc_sys>;
633                 vcc2-supply = <&vcc_sys>;
634                 vcc3-supply = <&vcc_sys>;
635                 vcc4-supply = <&vcc_sys>;
636                 vcc6-supply = <&vcc_sys>;
637                 vcc7-supply = <&vcc3v3_sys>;
638                 vcc8-supply = <&vcc_sys>;
639                 vcc9-supply = <&vcc3v3_sys>;
640
641                 regulators {
642                         vdd_cpu_l: DCDC_REG1 {
643                                 regulator-name = "vdd_cpu_l";
644                                 regulator-always-on;
645                                 regulator-boot-on;
646                                 regulator-min-microvolt = <750000>;
647                                 regulator-max-microvolt = <1350000>;
648                                 regulator-ramp-delay = <6001>;
649                                 regulator-state-mem {
650                                         regulator-off-in-suspend;
651                                 };
652                         };
653
654                         vdd_center: DCDC_REG2 {
655                                 regulator-name = "vdd_center";
656                                 regulator-always-on;
657                                 regulator-boot-on;
658                                 regulator-min-microvolt = <800000>;
659                                 regulator-max-microvolt = <1350000>;
660                                 regulator-ramp-delay = <6001>;
661                                 regulator-state-mem {
662                                         regulator-off-in-suspend;
663                                 };
664                         };
665
666                         vcc_ddr: DCDC_REG3 {
667                                 regulator-name = "vcc_ddr";
668                                 regulator-always-on;
669                                 regulator-boot-on;
670                                 regulator-state-mem {
671                                         regulator-on-in-suspend;
672                                 };
673                         };
674
675                         vcc_1v8: DCDC_REG4 {
676                                 regulator-name = "vcc_1v8";
677                                 regulator-always-on;
678                                 regulator-boot-on;
679                                 regulator-min-microvolt = <1800000>;
680                                 regulator-max-microvolt = <1800000>;
681                                 regulator-state-mem {
682                                         regulator-on-in-suspend;
683                                         regulator-suspend-microvolt = <1800000>;
684                                 };
685                         };
686
687                         vcca3v0_codec: LDO_REG1 {
688                                 regulator-always-on;
689                                 regulator-boot-on;
690                                 regulator-min-microvolt = <3000000>;
691                                 regulator-max-microvolt = <3000000>;
692                                 regulator-name = "vcca3v0_codec";
693                                 regulator-state-mem {
694                                         regulator-off-in-suspend;
695                                 };
696                         };
697
698                         vcc3v0_tp: LDO_REG2 {
699                                 regulator-always-on;
700                                 regulator-boot-on;
701                                 regulator-min-microvolt = <3000000>;
702                                 regulator-max-microvolt = <3000000>;
703                                 regulator-name = "vcc3v0_tp";
704                                 regulator-state-mem {
705                                         regulator-off-in-suspend;
706                                 };
707                         };
708
709                         vcca1v8_codec: LDO_REG3 {
710                                 regulator-always-on;
711                                 regulator-boot-on;
712                                 regulator-min-microvolt = <1800000>;
713                                 regulator-max-microvolt = <1800000>;
714                                 regulator-name = "vcca1v8_codec";
715                                 regulator-state-mem {
716                                         regulator-off-in-suspend;
717                                 };
718                         };
719
720                         vcc_power_on: LDO_REG4 {
721                                 regulator-always-on;
722                                 regulator-boot-on;
723                                 regulator-min-microvolt = <3300000>;
724                                 regulator-max-microvolt = <3300000>;
725                                 regulator-name = "vcc_power_on";
726                                 regulator-state-mem {
727                                         regulator-on-in-suspend;
728                                         regulator-suspend-microvolt = <3300000>;
729                                 };
730                         };
731
732                         vcc_3v0: LDO_REG5 {
733                                 regulator-always-on;
734                                 regulator-boot-on;
735                                 regulator-min-microvolt = <3000000>;
736                                 regulator-max-microvolt = <3000000>;
737                                 regulator-name = "vcc_3v0";
738                                 regulator-state-mem {
739                                         regulator-off-in-suspend;
740                                 };
741                         };
742
743                         vcc_1v5: LDO_REG6 {
744                                 regulator-always-on;
745                                 regulator-boot-on;
746                                 regulator-min-microvolt = <1500000>;
747                                 regulator-max-microvolt = <1500000>;
748                                 regulator-name = "vcc_1v5";
749                                 regulator-state-mem {
750                                         regulator-off-in-suspend;
751                                 };
752                         };
753
754                         vcc1v8_dvp: LDO_REG7 {
755                                 regulator-always-on;
756                                 regulator-boot-on;
757                                 regulator-min-microvolt = <1800000>;
758                                 regulator-max-microvolt = <1800000>;
759                                 regulator-name = "vcc1v8_dvp";
760                                 regulator-state-mem {
761                                         regulator-off-in-suspend;
762                                 };
763                         };
764
765                         vcc3v3_s3: LDO_REG8 {
766                                 regulator-always-on;
767                                 regulator-boot-on;
768                                 regulator-min-microvolt = <3300000>;
769                                 regulator-max-microvolt = <3300000>;
770                                 regulator-name = "vcc3v3_s3";
771                                 regulator-state-mem {
772                                         regulator-off-in-suspend;
773                                 };
774                         };
775
776                         vcc_sd: LDO_REG9 {
777                                 regulator-always-on;
778                                 regulator-boot-on;
779                                 regulator-min-microvolt = <1800000>;
780                                 regulator-max-microvolt = <3300000>;
781                                 regulator-name = "vcc_sd";
782                                 regulator-state-mem {
783                                         regulator-on-in-suspend;
784                                         regulator-suspend-microvolt = <3300000>;
785                                 };
786                         };
787
788                         vcc3v3_s0: SWITCH_REG {
789                                 regulator-always-on;
790                                 regulator-boot-on;
791                                 regulator-name = "vcc3v3_s0";
792                                 regulator-state-mem {
793                                         regulator-on-in-suspend;
794                                 };
795                         };
796                 };
797
798                 battery {
799                         compatible = "rk818-battery";
800                         ocv_table = <3400 3675 3689 3716 3740 3756 3768 3780
801                                 3793 3807 3827 3853 3896 3937 3974 4007 4066
802                                 4110 4161 4217 4308>;
803                         design_capacity = <7916>;
804                         design_qmax = <8708>;
805                         bat_res = <65>;
806                         max_input_current = <3000>;
807                         max_chrg_current = <3000>;
808                         max_chrg_voltage = <4350>;
809                         sleep_enter_current = <300>;
810                         sleep_exit_current = <300>;
811                         power_off_thresd = <3400>;
812                         zero_algorithm_vol = <3950>;
813                         fb_temperature = <105>;
814                         sample_res = <20>;
815                         max_soc_offset = <60>;
816                         energy_mode = <0>;
817                         monitor_sec = <5>;
818                         virtual_power = <0>;
819                         power_dc2otg = <0>;
820                 };
821         };
822 };
823
824 &i2c1 {
825         status = "okay";
826         i2c-scl-rising-time-ns = <140>;
827         i2c-scl-falling-time-ns = <30>;
828
829         es8316: es8316@10 {
830                 #sound-dai-cells = <0>;
831                 compatible = "everest,es8316";
832                 reg = <0x11>;
833                 pinctrl-names = "default";
834                 pinctrl-0 = <&hp_det>;
835                 clocks = <&cru SCLK_I2S_8CH_OUT>;
836                 clock-names = "mclk";
837                 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
838                 hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_HIGH>;
839         };
840 };
841
842 &i2c4 {
843         status = "okay";
844         i2c-scl-rising-time-ns = <345>;
845         i2c-scl-falling-time-ns = <11>;
846         clock-frequency = <400000>;
847
848         lsm330_accel@1e {
849                 status = "okay";
850                 compatible = "lsm330_acc";
851                 pinctrl-names = "default";
852                 pinctrl-0 = <&lsm330a_irq_gpio>;
853                 reg = <0x1e>;
854                 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
855                 type = <SENSOR_TYPE_ACCEL>;
856                 irq_enable = <1>;
857                 poll_delay_ms = <30>;
858                 layout = <4>;
859         };
860
861         lsm330_gyro@6a {
862                 status = "okay";
863                 compatible = "lsm330_gyro";
864                 pinctrl-names = "default";
865                 pinctrl-0 = <&lsm330g_irq_gpio>;
866                 reg = <0x6a>;
867                 irq-gpio = <&gpio1 20 IRQ_TYPE_EDGE_RISING>;
868                 type = <SENSOR_TYPE_GYROSCOPE>;
869                 irq_enable = <0>;
870                 poll_delay_ms = <30>;
871         };
872
873         mpu6500@68 {
874                 status = "disabled";
875                 compatible = "invensense,mpu6500";
876                 pinctrl-names = "default";
877                 pinctrl-0 = <&mpu6500_irq_gpio>;
878                 reg = <0x68>;
879                 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
880                 mpu-int_config = <0x10>;
881                 mpu-level_shifter = <0>;
882                 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
883                 orientation-x= <1>;
884                 orientation-y= <1>;
885                 orientation-z= <0>;
886                 support-hw-poweroff = <1>;
887                 mpu-debug = <1>;
888         };
889
890         sensor@0d {
891                 status = "okay";
892                 compatible = "ak8963";
893                 pinctrl-names = "default";
894                 pinctrl-0 = <&ak8963_irq_gpio>;
895                 reg = <0x0d>;
896                 type = <SENSOR_TYPE_COMPASS>;
897                 irq-gpio = <&gpio2 28 IRQ_TYPE_EDGE_RISING>;
898                 irq_enable = <0>;
899                 poll_delay_ms = <30>;
900                 layout = <3>;
901         };
902
903         sensor@10 {
904                 status = "okay";
905                 compatible = "capella,light_cm3218";
906                 pinctrl-names = "default";
907                 pinctrl-0 = <&cm3218_irq_gpio>;
908                 reg = <0x10>;
909                 type = <SENSOR_TYPE_LIGHT>;
910                 irq-gpio = <&gpio4 24 IRQ_TYPE_EDGE_FALLING>;
911                 irq_enable = <1>;
912                 poll_delay_ms = <30>;
913         };
914
915         fusb0: fusb30x@22 {
916                 compatible = "fairchild,fusb302";
917                 reg = <0x22>;
918                 pinctrl-names = "default";
919                 pinctrl-0 = <&fusb0_int>;
920                 int-n-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
921                 status = "okay";
922         };
923 };
924
925 &i2c5 {
926         status = "okay";
927         i2c-scl-rising-time-ns = <150>;
928         i2c-scl-falling-time-ns = <30>;
929         clock-frequency = <400000>;
930
931         gt9xx: gt9xx@14 {
932                 compatible = "goodix,gt9xx";
933                 reg = <0x14>;
934                 touch-gpio = <&gpio3 12 IRQ_TYPE_LEVEL_LOW>;
935                 reset-gpio = <&gpio3 13 GPIO_ACTIVE_HIGH>;
936                 max-x = <1536>;
937                 max-y = <2048>;
938                 tp-size = <970>;
939                 tp-supply = <&vcc3v0_tp>;
940         };
941 };
942
943 &isp0 {
944         status = "okay";
945 };
946
947 &isp1 {
948         status = "okay";
949 };
950
951 &cpu_l0 {
952         cpu-supply = <&vdd_cpu_l>;
953 };
954
955 &cpu_l1 {
956         cpu-supply = <&vdd_cpu_l>;
957 };
958
959 &cpu_l2 {
960         cpu-supply = <&vdd_cpu_l>;
961 };
962
963 &cpu_l3 {
964         cpu-supply = <&vdd_cpu_l>;
965 };
966
967 &cpu_b0 {
968         cpu-supply = <&vdd_cpu_b>;
969 };
970
971 &cpu_b1 {
972         cpu-supply = <&vdd_cpu_b>;
973 };
974
975 &gpu {
976         status = "okay";
977         mali-supply = <&vdd_gpu>;
978 };
979
980 &rga {
981         status = "okay";
982 };
983
984 &spi1 {
985         status = "disabled";
986         max-freq = <50000000>;
987         mpu6500@0 {
988                 status = "disabled";
989                 compatible = "inv-spi,mpu6500";
990                 pinctrl-names = "default";
991                 pinctrl-0 = <&mpu6500_irq_gpio>;
992                 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
993                 reg = <0>;
994                 spi-max-frequency = <1000000>;
995                 spi-cpha;
996                 spi-cpol;
997                 mpu-int_config = <0x00>;
998                 mpu-level_shifter = <0>;
999                 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
1000                 orientation-x= <1>;
1001                 orientation-y= <0>;
1002                 orientation-z= <1>;
1003                 support-hw-poweroff = <1>;
1004                 mpu-debug = <1>;
1005         };
1006 };
1007
1008 &tcphy0 {
1009         extcon = <&fusb0>;
1010         status = "okay";
1011 };
1012
1013 &tsadc {
1014         rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
1015         rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
1016         status = "okay";
1017 };
1018
1019 &u2phy0 {
1020         status = "okay";
1021         extcon = <&fusb0>;
1022
1023         u2phy0_otg: otg-port {
1024                 status = "okay";
1025         };
1026
1027         u2phy0_host: host-port {
1028                 phy-supply = <&vcc5v0_host>;
1029                 status = "okay";
1030         };
1031 };
1032
1033 &uart0 {
1034         pinctrl-names = "default";
1035         pinctrl-0 = <&uart0_xfer &uart0_cts>;
1036         status = "okay";
1037 };
1038
1039 &uart2 {
1040         status = "okay";
1041 };
1042
1043 &usb_host0_ehci {
1044         status = "okay";
1045 };
1046
1047 &usb_host0_ohci {
1048         status = "okay";
1049 };
1050
1051 &usbdrd3_0 {
1052         extcon = <&fusb0>;
1053         status = "okay";
1054 };
1055
1056 &usbdrd_dwc3_0 {
1057         status = "okay";
1058 };
1059
1060 &vop0_pwm {
1061         assigned-clocks = <&cru SCLK_VOP0_PWM>;
1062         assigned-clock-rates = <50000000>;
1063         status = "okay";
1064 };
1065
1066 &pwm2 {
1067         status = "okay";
1068 };
1069
1070 &saradc {
1071         status = "okay";
1072 };
1073
1074 &pinctrl {
1075         sdio-pwrseq {
1076                 wifi_enable_h: wifi-enable-h {
1077                         rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
1078                 };
1079         };
1080
1081         wireless-bluetooth {
1082                 uart0_gpios: uart0-gpios {
1083                         rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
1084                 };
1085         };
1086
1087         pmic {
1088                 pmic_int_l: pmic-int-l {
1089                         rockchip,pins =
1090                                 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
1091                 };
1092
1093                 pmic_dvs2: pmic-dvs2 {
1094                         rockchip,pins =
1095                                 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
1096                 };
1097                 vsel1_gpio: vsel1-gpio {
1098                         rockchip,pins =
1099                                 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
1100                 };
1101                 vsel2_gpio: vsel2-gpio {
1102                         rockchip,pins =
1103                                 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
1104                 };
1105         };
1106
1107         headphone {
1108                 hp_det: hp-det {
1109                         rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_up>;
1110                 };
1111         };
1112
1113         lcdpwr-enable {
1114                 lcdpwr_enable_h: lcdpwr-enable-h {
1115                         rockchip,pins = <3 8 RK_FUNC_GPIO &pcfg_pull_up>;
1116                 };
1117         };
1118
1119         lsm330_a {
1120                 lsm330a_irq_gpio: lsm330a-irq-gpio {
1121                         rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
1122                 };
1123         };
1124
1125         lsm330_g {
1126                 lsm330g_irq_gpio: lsm330g-irq-gpio {
1127                         rockchip,pins = <1 20 RK_FUNC_GPIO &pcfg_pull_none>;
1128                 };
1129         };
1130
1131         mpu6500 {
1132                 mpu6500_irq_gpio: mpu6500-irq-gpio {
1133                         rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
1134                 };
1135         };
1136
1137         ak8963 {
1138                 ak8963_irq_gpio: ak8963-irq-gpio {
1139                         rockchip,pins = <2 28 RK_FUNC_GPIO &pcfg_pull_none>;
1140                 };
1141         };
1142
1143         cm3218 {
1144                 cm3218_irq_gpio: cm3218-irq-gpio {
1145                         rockchip,pins = <4 24 RK_FUNC_GPIO &pcfg_pull_up>;
1146                 };
1147         };
1148
1149         usb2 {
1150                 host_vbus_drv: host-vbus-drv {
1151                         rockchip,pins =
1152                                 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
1153                 };
1154         };
1155
1156         fusb30x {
1157                 fusb0_int: fusb0-int {
1158                         rockchip,pins =
1159                                 <1 1 RK_FUNC_GPIO &pcfg_pull_up>;
1160                 };
1161         };
1162 };
1163
1164 &rk_screen {
1165         #include <dt-bindings/display/screen-timing/lcd-LP097Qx2.dtsi>
1166 };
1167
1168 &vopb_rk_fb {
1169         status = "okay";
1170         rockchip,cabc_mode = <1>;
1171         power_ctr: power_ctr {
1172                 rockchip,debug = <0>;
1173
1174                 lcd_en: lcd-en {
1175                         rockchip,power_type = <GPIO>;
1176                         pinctrl-names = "default";
1177                         pinctrl-0 = <&lcdpwr_enable_h>;
1178                         gpios = <&gpio3 8 GPIO_ACTIVE_HIGH>;
1179                         rockchip,delay = <10>;
1180                 };
1181         };
1182 };
1183
1184 &vopl_rk_fb {
1185         status = "okay";
1186 };
1187
1188 &edp_rk_fb {
1189         status = "okay";
1190 };