88931fec436a2170ba2e587d7935b30d57e9a0b9
[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                 status = "disabled";
446         };
447         opp@300000000 {
448                 opp-hz = /bits/ 64 <300000000>;
449                 opp-microvolt = <850000>;
450         };
451         opp@400000000 {
452                 opp-hz = /bits/ 64 <400000000>;
453                 opp-microvolt = <875000>;
454         };
455         opp@500000000 {
456                 opp-hz = /bits/ 64 <500000000>;
457                 opp-microvolt = <950000>;
458         };
459         opp@600000000 {
460                 opp-hz = /bits/ 64 <600000000>;
461                 opp-microvolt = <1025000>;
462         };
463         opp@800000000 {
464                 opp-hz = /bits/ 64 <800000000>;
465                 opp-microvolt = <1125000>;
466         };
467 };
468
469 &sdmmc {
470         clock-frequency = <150000000>;
471         clock-freq-min-max = <400000 150000000>;
472         supports-sd;
473         bus-width = <4>;
474         cap-mmc-highspeed;
475         cap-sd-highspeed;
476         disable-wp;
477         num-slots = <1>;
478         sd-uhs-sdr104;
479         vqmmc-supply = <&vcc_sd>;
480         pinctrl-names = "default";
481         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
482         status = "okay";
483 };
484
485 &sdio0 {
486         clock-frequency = <50000000>;
487         clock-freq-min-max = <200000 50000000>;
488         supports-sdio;
489         bus-width = <4>;
490         disable-wp;
491         cap-sd-highspeed;
492         cap-sdio-irq;
493         keep-power-in-suspend;
494         mmc-pwrseq = <&sdio_pwrseq>;
495         non-removable;
496         num-slots = <1>;
497         pinctrl-names = "default";
498         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
499         sd-uhs-sdr104;
500         status = "okay";
501 };
502
503 &emmc_phy {
504         status = "okay";
505 };
506
507 &sdhci {
508         bus-width = <8>;
509         mmc-hs400-1_8v;
510         supports-emmc;
511         non-removable;
512         keep-power-in-suspend;
513         mmc-hs400-enhanced-strobe;
514         status = "okay";
515 };
516
517 &i2s0 {
518         status = "okay";
519         rockchip,i2s-broken-burst-len;
520         rockchip,playback-channels = <8>;
521         rockchip,capture-channels = <8>;
522         #sound-dai-cells = <0>;
523 };
524
525 &i2s2 {
526         #sound-dai-cells = <0>;
527 };
528
529 &spdif {
530         status = "okay";
531         #sound-dai-cells = <0>;
532 };
533
534 &i2c0 {
535         status = "okay";
536         i2c-scl-rising-time-ns = <219>;
537         i2c-scl-falling-time-ns = <15>;
538         clock-frequency = <400000>;
539
540         vdd_cpu_b: syr827@40 {
541                 compatible = "silergy,syr827";
542                 reg = <0x40>;
543                 vin-supply = <&vcc_sys>;
544                 regulator-compatible = "fan53555-reg";
545                 pinctrl-0 = <&vsel1_gpio>;
546                 vsel-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
547                 regulator-name = "vdd_cpu_b";
548                 regulator-min-microvolt = <712500>;
549                 regulator-max-microvolt = <1500000>;
550                 regulator-ramp-delay = <1000>;
551                 fcs,suspend-voltage-selector = <1>;
552                 regulator-always-on;
553                 regulator-initial-state = <3>;
554                         regulator-state-mem {
555                         regulator-off-in-suspend;
556                 };
557         };
558
559         vdd_gpu: syr828@41 {
560                 compatible = "silergy,syr828";
561                 reg = <0x41>;
562                 vin-supply = <&vcc_sys>;
563                 regulator-compatible = "fan53555-reg";
564                 pinctrl-0 = <&vsel2_gpio>;
565                 vsel-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
566                 regulator-name = "vdd_gpu";
567                 regulator-min-microvolt = <712500>;
568                 regulator-max-microvolt = <1500000>;
569                 regulator-ramp-delay = <1000>;
570                 fcs,suspend-voltage-selector = <1>;
571                 regulator-boot-on;
572                 regulator-initial-state = <3>;
573                 regulator-initial-mode = <1>;/*1:pwm 2: auto mode*/
574                         regulator-state-mem {
575                         regulator-off-in-suspend;
576                 };
577         };
578
579         rk818: pmic@1c {
580                 compatible = "rockchip,rk818";
581                 status = "okay";
582                 reg = <0x1c>;
583                 clock-output-names = "xin32k", "wifibt_32kin";
584                 interrupt-parent = <&gpio1>;
585                 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
586                 pinctrl-names = "default";
587                 pinctrl-0 = <&pmic_int_l>;
588                 rockchip,system-power-controller;
589                 wakeup-source;
590                 extcon = <&fusb0>;
591                 #clock-cells = <1>;
592
593                 vcc1-supply = <&vcc_sys>;
594                 vcc2-supply = <&vcc_sys>;
595                 vcc3-supply = <&vcc_sys>;
596                 vcc4-supply = <&vcc_sys>;
597                 vcc6-supply = <&vcc_sys>;
598                 vcc7-supply = <&vcc3v3_sys>;
599                 vcc8-supply = <&vcc_sys>;
600                 vcc9-supply = <&vcc3v3_sys>;
601
602                 regulators {
603                         vdd_cpu_l: DCDC_REG1 {
604                                 regulator-name = "vdd_cpu_l";
605                                 regulator-always-on;
606                                 regulator-boot-on;
607                                 regulator-min-microvolt = <750000>;
608                                 regulator-max-microvolt = <1350000>;
609                                 regulator-ramp-delay = <6001>;
610                                 regulator-state-mem {
611                                         regulator-off-in-suspend;
612                                 };
613                         };
614
615                         vdd_center: DCDC_REG2 {
616                                 regulator-name = "vdd_center";
617                                 regulator-always-on;
618                                 regulator-boot-on;
619                                 regulator-min-microvolt = <800000>;
620                                 regulator-max-microvolt = <1350000>;
621                                 regulator-ramp-delay = <6001>;
622                                 regulator-state-mem {
623                                         regulator-off-in-suspend;
624                                 };
625                         };
626
627                         vcc_ddr: DCDC_REG3 {
628                                 regulator-name = "vcc_ddr";
629                                 regulator-always-on;
630                                 regulator-boot-on;
631                                 regulator-state-mem {
632                                         regulator-on-in-suspend;
633                                 };
634                         };
635
636                         vcc_1v8: DCDC_REG4 {
637                                 regulator-name = "vcc_1v8";
638                                 regulator-always-on;
639                                 regulator-boot-on;
640                                 regulator-min-microvolt = <1800000>;
641                                 regulator-max-microvolt = <1800000>;
642                                 regulator-state-mem {
643                                         regulator-on-in-suspend;
644                                         regulator-suspend-microvolt = <1800000>;
645                                 };
646                         };
647
648                         vcca3v0_codec: LDO_REG1 {
649                                 regulator-always-on;
650                                 regulator-boot-on;
651                                 regulator-min-microvolt = <3000000>;
652                                 regulator-max-microvolt = <3000000>;
653                                 regulator-name = "vcca3v0_codec";
654                                 regulator-state-mem {
655                                         regulator-off-in-suspend;
656                                 };
657                         };
658
659                         vcc3v0_tp: LDO_REG2 {
660                                 regulator-always-on;
661                                 regulator-boot-on;
662                                 regulator-min-microvolt = <3000000>;
663                                 regulator-max-microvolt = <3000000>;
664                                 regulator-name = "vcc3v0_tp";
665                                 regulator-state-mem {
666                                         regulator-off-in-suspend;
667                                 };
668                         };
669
670                         vcca1v8_codec: LDO_REG3 {
671                                 regulator-always-on;
672                                 regulator-boot-on;
673                                 regulator-min-microvolt = <1800000>;
674                                 regulator-max-microvolt = <1800000>;
675                                 regulator-name = "vcca1v8_codec";
676                                 regulator-state-mem {
677                                         regulator-off-in-suspend;
678                                 };
679                         };
680
681                         vcc_power_on: LDO_REG4 {
682                                 regulator-always-on;
683                                 regulator-boot-on;
684                                 regulator-min-microvolt = <3300000>;
685                                 regulator-max-microvolt = <3300000>;
686                                 regulator-name = "vcc_power_on";
687                                 regulator-state-mem {
688                                         regulator-on-in-suspend;
689                                         regulator-suspend-microvolt = <3300000>;
690                                 };
691                         };
692
693                         vcc_3v0: LDO_REG5 {
694                                 regulator-always-on;
695                                 regulator-boot-on;
696                                 regulator-min-microvolt = <3000000>;
697                                 regulator-max-microvolt = <3000000>;
698                                 regulator-name = "vcc_3v0";
699                                 regulator-state-mem {
700                                         regulator-on-in-suspend;
701                                         regulator-suspend-microvolt = <3000000>;
702                                 };
703                         };
704
705                         vcc_1v5: LDO_REG6 {
706                                 regulator-always-on;
707                                 regulator-boot-on;
708                                 regulator-min-microvolt = <1500000>;
709                                 regulator-max-microvolt = <1500000>;
710                                 regulator-name = "vcc_1v5";
711                                 regulator-state-mem {
712                                         regulator-on-in-suspend;
713                                         regulator-suspend-microvolt = <1500000>;
714                                 };
715                         };
716
717                         vcc1v8_dvp: LDO_REG7 {
718                                 regulator-always-on;
719                                 regulator-boot-on;
720                                 regulator-min-microvolt = <1800000>;
721                                 regulator-max-microvolt = <1800000>;
722                                 regulator-name = "vcc1v8_dvp";
723                                 regulator-state-mem {
724                                         regulator-on-in-suspend;
725                                         regulator-suspend-microvolt = <1800000>;
726                                 };
727                         };
728
729                         vcc3v3_s3: LDO_REG8 {
730                                 regulator-always-on;
731                                 regulator-boot-on;
732                                 regulator-min-microvolt = <3300000>;
733                                 regulator-max-microvolt = <3300000>;
734                                 regulator-name = "vcc3v3_s3";
735                                 regulator-state-mem {
736                                         regulator-on-in-suspend;
737                                         regulator-suspend-microvolt = <3300000>;
738                                 };
739                         };
740
741                         vcc_sd: LDO_REG9 {
742                                 regulator-always-on;
743                                 regulator-boot-on;
744                                 regulator-min-microvolt = <1800000>;
745                                 regulator-max-microvolt = <3300000>;
746                                 regulator-name = "vcc_sd";
747                                 regulator-state-mem {
748                                         regulator-on-in-suspend;
749                                         regulator-suspend-microvolt = <3300000>;
750                                 };
751                         };
752
753                         vcc3v3_s0: SWITCH_REG {
754                                 regulator-always-on;
755                                 regulator-boot-on;
756                                 regulator-name = "vcc3v3_s0";
757                                 regulator-state-mem {
758                                         regulator-on-in-suspend;
759                                 };
760                         };
761                 };
762
763                 battery {
764                         compatible = "rk818-battery";
765                         ocv_table = <
766                                 3400 3599 3671 3701 3728 3746 3762
767                                 3772 3781 3792 3816 3836 3866 3910
768                                 3942 3971 4002 4050 4088 4132 4183>;
769                         design_capacity = <4000>;
770                         design_qmax = <4100>;
771                         bat_res = <100>;
772                         max_input_current = <2000>;
773                         max_chrg_current = <1800>;
774                         max_chrg_voltage = <4200>;
775                         sleep_enter_current = <300>;
776                         sleep_exit_current = <300>;
777                         power_off_thresd = <3400>;
778                         zero_algorithm_vol = <3850>;
779                         fb_temperature = <115>;
780                         sample_res = <10>;
781                         max_soc_offset = <60>;
782                         energy_mode = <0>;
783                         monitor_sec = <5>;
784                         virtual_power = <0>;
785                         power_dc2otg = <0>;
786                 };
787         };
788 };
789
790 &i2c1 {
791         status = "okay";
792         i2c-scl-rising-time-ns = <164>;
793         i2c-scl-falling-time-ns = <15>;
794
795         es8316: es8316@10 {
796                 #sound-dai-cells = <0>;
797                 compatible = "everest,es8316";
798                 reg = <0x10>;
799                 clocks = <&cru SCLK_I2S_8CH_OUT>;
800                 clock-names = "mclk";
801                 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
802                 hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_LOW>;
803         };
804 };
805
806 &i2c4 {
807         status = "okay";
808         i2c-scl-rising-time-ns = <345>;
809         i2c-scl-falling-time-ns = <11>;
810         clock-frequency = <400000>;
811
812         sensor@0f {
813                 status = "okay";
814                 compatible = "ak8963";
815                 pinctrl-names = "default";
816                 pinctrl-0 = <&ak8963_irq_gpio>;
817                 reg = <0x0f>;
818                 type = <SENSOR_TYPE_COMPASS>;
819                 irq-gpio = <&gpio1 0 IRQ_TYPE_EDGE_RISING>;
820                 irq_enable = <1>;
821                 poll_delay_ms = <30>;
822                 layout = <1>;
823         };
824
825         fusb0: fusb30x@22 {
826                 compatible = "fairchild,fusb302";
827                 reg = <0x22>;
828                 pinctrl-names = "default";
829                 pinctrl-0 = <&fusb0_int>;
830                 int-n-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
831                 status = "okay";
832         };
833 };
834
835 &i2c5 {
836         status = "okay";
837
838         touch@40 {
839                 compatible = "gslX680";
840                 reg = <0x40>;
841                 touch-gpio = <&gpio1 20 IRQ_TYPE_LEVEL_LOW>;
842                 reset-gpio = <&gpio4 22 GPIO_ACTIVE_LOW>;
843                 max-x = <1280>;
844                 max-y = <600>;
845                 status = "okay";
846         };
847 };
848
849 &spi1 {
850         status = "okay";
851         max-freq = <50000000>;
852         pinctrl-names = "default", "sleep";
853         pinctrl-1 = <&spi1_gpio>;
854         mpu6500@0 {
855                 status = "okay";
856                 compatible = "inv-spi,mpu6500";
857                 pinctrl-names = "default";
858                 pinctrl-0 = <&mpu6500_irq_gpio>;
859                 irq-gpio = <&gpio1 4 IRQ_TYPE_EDGE_RISING>;
860                 reg = <0>;
861                 spi-max-frequency = <1000000>;
862                 spi-cpha;
863                 spi-cpol;
864                 mpu-int_config = <0x00>;
865                 mpu-level_shifter = <0>;
866                 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
867                 orientation-x= <1>;
868                 orientation-y= <0>;
869                 orientation-z= <1>;
870                 support-hw-poweroff = <1>;
871                 mpu-debug = <1>;
872         };
873 };
874
875 &threshold {
876         temperature = <70000>; /* millicelsius */
877 };
878
879 &target {
880         temperature = <85000>; /* millicelsius */
881 };
882
883 &soc_crit {
884         temperature = <100000>; /* millicelsius */
885 };
886
887 &tsadc {
888         rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
889         rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
890         rockchip,hw-tshut-temp = <110000>;
891         status = "okay";
892 };
893
894 &saradc {
895         status = "okay";
896 };
897
898 &u2phy0 {
899         extcon = <&fusb0>;
900         status = "okay";
901
902         u2phy0_otg: otg-port {
903                 status = "okay";
904         };
905
906         u2phy0_host: host-port {
907                 phy-supply = <&vcc5v0_host>;
908                 status = "okay";
909         };
910 };
911
912 &u2phy1 {
913         status = "okay";
914
915         u2phy1_otg: otg-port {
916                 status = "okay";
917         };
918
919         u2phy1_host: host-port {
920                 phy-supply = <&vcc5v0_host>;
921                 status = "okay";
922         };
923 };
924
925 &uart0 {
926         pinctrl-names = "default";
927         pinctrl-0 = <&uart0_xfer &uart0_cts>;
928         status = "okay";
929 };
930
931 &uart2 {
932         status = "okay";
933 };
934
935 &usb_host0_ehci {
936         status = "okay";
937 };
938
939 &usb_host0_ohci {
940         status = "okay";
941 };
942
943 &usb_host1_ehci {
944         status = "okay";
945 };
946
947 &usb_host1_ohci {
948         status = "okay";
949 };
950
951 &usbdrd3_0 {
952         extcon = <&fusb0>;
953         status = "okay";
954 };
955
956 &usbdrd_dwc3_0 {
957         status = "okay";
958 };
959
960 &usbdrd3_1 {
961         status = "okay";
962 };
963
964 &usbdrd_dwc3_1 {
965         status = "okay";
966 };
967
968 &tcphy0 {
969         status = "okay";
970         extcon = <&fusb0>;
971 };
972
973 &pwm0 {
974         status = "okay";
975 };
976
977 &pwm2 {
978         status = "okay";
979 };
980
981 &vdd_center {
982         rockchip,pwm_id= <3>;
983         rockchip,pwm_voltage = <900000>;
984 };
985
986 &rk_key {
987         status = "disabled";
988 };
989
990 &rk_screen {
991         assigned-clocks = <&cru PLL_VPLL>;
992         assigned-clock-rates = <245000000>;
993         #include <dt-bindings/display/screen-timing/lcd-ls055r1sx04-mipi.dtsi>
994 };
995
996 &fb {
997         rockchip,uboot-logo-on = <1>;
998         rockchip,disp-mode = <NO_DUAL>;
999 };
1000
1001 &vopb_rk_fb {
1002         status = "okay";
1003         power_ctr: power_ctr {
1004                 lcd_en: lcd-en {
1005                         rockchip,power_type = <GPIO>;
1006                         gpios = <&gpio3 5 GPIO_ACTIVE_HIGH>;
1007                         rockchip,delay = <10>;
1008                 };
1009                 lcd_rst: lcd-rst {
1010                         rockchip,power_type = <GPIO>;
1011                         gpios = <&gpio3 4 GPIO_ACTIVE_HIGH>;
1012                         rockchip,delay = <10>;
1013                 };
1014         };
1015 };
1016
1017 &vopl_rk_fb {
1018         status = "okay";
1019 };
1020
1021 &mipi0_rk_fb {
1022         status = "okay";
1023 };
1024
1025 &mipi1_rk_fb {
1026         status = "okay";
1027 };
1028
1029 &cpu_l0 {
1030         cpu-supply = <&vdd_cpu_l>;
1031 };
1032
1033 &cpu_l1 {
1034         cpu-supply = <&vdd_cpu_l>;
1035 };
1036
1037 &cpu_l2 {
1038         cpu-supply = <&vdd_cpu_l>;
1039 };
1040
1041 &cpu_l3 {
1042         cpu-supply = <&vdd_cpu_l>;
1043 };
1044
1045 &cpu_b0 {
1046         cpu-supply = <&vdd_cpu_b>;
1047 };
1048
1049 &cpu_b1 {
1050         cpu-supply = <&vdd_cpu_b>;
1051 };
1052
1053 &gpu {
1054         status = "okay";
1055         mali-supply = <&vdd_gpu>;
1056 };
1057
1058 &pinctrl {
1059         sdio-pwrseq {
1060                 wifi_enable_h: wifi-enable-h {
1061                         rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
1062                 };
1063         };
1064
1065         wireless-bluetooth {
1066                 uart0_gpios: uart0-gpios {
1067                         rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
1068                 };
1069         };
1070
1071         pmic {
1072                 pmic_int_l: pmic-int-l {
1073                         rockchip,pins =
1074                                 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
1075                 };
1076
1077                 pmic_dvs2: pmic-dvs2 {
1078                         rockchip,pins =
1079                                 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
1080                 };
1081
1082                 vsel1_gpio: vsel1-gpio {
1083                         rockchip,pins =
1084                                 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
1085                 };
1086
1087                 vsel2_gpio: vsel2-gpio {
1088                         rockchip,pins =
1089                                 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
1090                 };
1091         };
1092
1093         mpu6500 {
1094                 mpu6500_irq_gpio: mpu6500-irq-gpio {
1095                         rockchip,pins = <1 4 RK_FUNC_GPIO &pcfg_pull_none>;
1096                 };
1097         };
1098
1099         usb2 {
1100                 host_vbus_drv: host-vbus-drv {
1101                         rockchip,pins =
1102                                 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
1103                 };
1104         };
1105
1106         ak8963 {
1107                 ak8963_irq_gpio: ak8963-irq-gpio {
1108                         rockchip,pins = <1 0 RK_FUNC_GPIO &pcfg_pull_none>;
1109                 };
1110         };
1111
1112         spi1 {
1113                 spi1_gpio: spi1-gpio {
1114                         rockchip,pins =
1115                                 <1 7 RK_FUNC_GPIO &pcfg_output_low>,
1116                                 <1 8 RK_FUNC_GPIO &pcfg_output_low>,
1117                                 <1 9 RK_FUNC_GPIO &pcfg_output_low>,
1118                                 <1 10 RK_FUNC_GPIO &pcfg_output_low>;
1119                 };
1120         };
1121
1122         fusb30x {
1123                 fusb0_int: fusb0-int {
1124                         rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>;
1125                 };
1126         };
1127 };