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