ARM64: dts: rockchip: rk3399: vr: add io for syr828/827 sleep off contrl
[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
238 &cluster0_opp {
239         opp@408000000 {
240                 opp-hz = /bits/ 64 <408000000>;
241                 opp-microvolt = <800000>;
242                 clock-latency-ns = <40000>;
243         };
244         opp@600000000 {
245                 opp-hz = /bits/ 64 <600000000>;
246                 opp-microvolt = <800000>;
247         };
248         opp@816000000 {
249                 opp-hz = /bits/ 64 <816000000>;
250                 opp-microvolt = <800000>;
251         };
252         opp@1008000000 {
253                 opp-hz = /bits/ 64 <1008000000>;
254                 opp-microvolt = <875000>;
255         };
256         opp@1200000000 {
257                 opp-hz = /bits/ 64 <1200000000>;
258                 opp-microvolt = <925000>;
259         };
260         opp@1416000000 {
261                 opp-hz = /bits/ 64 <1416000000>;
262                 opp-microvolt = <1050000>;
263         };
264         opp@1512000000 {
265                 opp-hz = /bits/ 64 <1512000000>;
266                 opp-microvolt = <1075000>;
267         };
268 };
269
270 &cluster1_opp {
271         opp@408000000 {
272                 opp-hz = /bits/ 64 <408000000>;
273                 opp-microvolt = <800000>;
274                 clock-latency-ns = <40000>;
275         };
276         opp@600000000 {
277                 opp-hz = /bits/ 64 <600000000>;
278                 opp-microvolt = <800000>;
279         };
280         opp@816000000 {
281                 opp-hz = /bits/ 64 <816000000>;
282                 opp-microvolt = <825000>;
283         };
284         opp@1008000000 {
285                 opp-hz = /bits/ 64 <1008000000>;
286                 opp-microvolt = <875000>;
287         };
288         opp@1200000000 {
289                 opp-hz = /bits/ 64 <1200000000>;
290                 opp-microvolt = <950000>;
291         };
292         opp@1416000000 {
293                 opp-hz = /bits/ 64 <1416000000>;
294                 opp-microvolt = <1025000>;
295         };
296         opp@1608000000 {
297                 opp-hz = /bits/ 64 <1608000000>;
298                 opp-microvolt = <1100000>;
299         };
300         opp@1800000000 {
301                 opp-hz = /bits/ 64 <1800000000>;
302                 opp-microvolt = <1175000>;
303         };
304         opp@1992000000 {
305                 opp-hz = /bits/ 64 <1992000000>;
306                 opp-microvolt = <1250000>;
307         };
308 };
309
310 &CPU_COST_A72 {
311         busy-cost-data = <
312                 210   129       /*  408MHz */
313                 308   184       /*  600MHz */
314                 419   246       /*  816MHz */
315                 518   335       /* 1008MHz */
316                 617   428       /* 1200MHz */
317                 728   573       /* 1416MHz */
318                 827   724       /* 1608MHz */
319                 925   900       /* 1800MHz */
320                 1024  1108      /* 1992MHz */
321         >;
322         idle-cost-data = <
323               15
324               15
325                0
326         >;
327 };
328
329 &CPU_COST_A53 {
330         busy-cost-data = <
331                 108    46       /*  408M */
332                 159    67       /*  600M */
333                 216    90       /*  816M */
334                 267    120      /* 1008M */
335                 318    153      /* 1200M */
336                 375    198      /* 1416M */
337                 401    222      /* 1512M */
338         >;
339         idle-cost-data = <
340               6
341               6
342               0
343         >;
344 };
345
346 &CLUSTER_COST_A72 {
347         busy-cost-data = <
348                 210   129       /*  408MHz */
349                 308   184       /*  600MHz */
350                 419   246       /*  816MHz */
351                 518   335       /* 1008MHz */
352                 617   428       /* 1200MHz */
353                 728   573       /* 1416MHz */
354                 827   724       /* 1608MHz */
355                 925   900       /* 1800MHz */
356                 1024  1108      /* 1992MHz */
357         >;
358         idle-cost-data = <
359                  65
360                  65
361                  65
362         >;
363 };
364
365 &CLUSTER_COST_A53 {
366         busy-cost-data = <
367                 108    46       /*  408M */
368                 159    67       /*  600M */
369                 216    90       /*  816M */
370                 267    120      /* 1008M */
371                 318    153      /* 1200M */
372                 375    198      /* 1416M */
373                 401    222      /* 1512M */
374         >;
375         idle-cost-data = <
376                 56
377                 56
378                 56
379         >;
380 };
381
382 &gpu_opp_table {
383         compatible = "operating-points-v2";
384         opp-shared;
385         opp@200000000 {
386                 opp-hz = /bits/ 64 <200000000>;
387                 opp-microvolt = <825000>;
388         };
389
390         opp@300000000 {
391                 opp-hz = /bits/ 64 <300000000>;
392                 opp-microvolt = <850000>;
393         };
394         opp@400000000 {
395                 opp-hz = /bits/ 64 <400000000>;
396                 opp-microvolt = <875000>;
397         };
398
399         opp@500000000 {
400                 opp-hz = /bits/ 64 <500000000>;
401                 opp-microvolt = <925000>;
402         };
403
404         opp@600000000 {
405                 opp-hz = /bits/ 64 <600000000>;
406                 opp-microvolt = <975000>;
407         };
408
409         opp@800000000 {
410                 opp-hz = /bits/ 64 <800000000>;
411                 opp-microvolt = <1025000>;
412         };
413 };
414
415 &sdmmc {
416         clock-frequency = <150000000>;
417         clock-freq-min-max = <400000 150000000>;
418         supports-sd;
419         bus-width = <4>;
420         cap-mmc-highspeed;
421         cap-sd-highspeed;
422         disable-wp;
423         num-slots = <1>;
424         sd-uhs-sdr104;
425         vqmmc-supply = <&vcc_sd>;
426         pinctrl-names = "default";
427         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
428         status = "okay";
429 };
430
431 &sdio0 {
432         clock-frequency = <50000000>;
433         clock-freq-min-max = <200000 50000000>;
434         supports-sdio;
435         bus-width = <4>;
436         disable-wp;
437         cap-sd-highspeed;
438         cap-sdio-irq;
439         keep-power-in-suspend;
440         mmc-pwrseq = <&sdio_pwrseq>;
441         non-removable;
442         num-slots = <1>;
443         pinctrl-names = "default";
444         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
445         sd-uhs-sdr104;
446         status = "okay";
447 };
448
449 &emmc_phy {
450         freq-sel = <200000000>;
451         dr-sel = <50>;
452         opdelay = <4>;
453         status = "okay";
454 };
455
456 &sdhci {
457         bus-width = <8>;
458         mmc-hs400-1_8v;
459         supports-emmc;
460         non-removable;
461         mmc-hs400-enhanced-strobe;
462         status = "okay";
463 };
464
465 &i2s0 {
466         status = "okay";
467         rockchip,i2s-broken-burst-len;
468         rockchip,playback-channels = <8>;
469         rockchip,capture-channels = <8>;
470         #sound-dai-cells = <0>;
471 };
472
473 &i2s2 {
474         #sound-dai-cells = <0>;
475 };
476
477 &spdif {
478         status = "okay";
479         #sound-dai-cells = <0>;
480 };
481
482 &i2c0 {
483         status = "okay";
484         i2c-scl-rising-time-ns = <219>;
485         i2c-scl-falling-time-ns = <15>;
486         clock-frequency = <400000>;
487
488         vdd_cpu_b: syr827@40 {
489                 compatible = "silergy,syr827";
490                 reg = <0x40>;
491                 vin-supply = <&vcc_sys>;
492                 regulator-compatible = "fan53555-reg";
493                 pinctrl-0 = <&vsel1_gpio>;
494                 vsel-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
495                 regulator-name = "vdd_cpu_b";
496                 regulator-min-microvolt = <712500>;
497                 regulator-max-microvolt = <1500000>;
498                 regulator-ramp-delay = <1000>;
499                 fcs,suspend-voltage-selector = <1>;
500                 regulator-always-on;
501                 regulator-initial-state = <3>;
502                         regulator-state-mem {
503                         regulator-off-in-suspend;
504                 };
505         };
506
507         vdd_gpu: syr828@41 {
508                 compatible = "silergy,syr828";
509                 reg = <0x41>;
510                 vin-supply = <&vcc_sys>;
511                 regulator-compatible = "fan53555-reg";
512                 pinctrl-0 = <&vsel2_gpio>;
513                 vsel-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
514                 regulator-name = "vdd_gpu";
515                 regulator-min-microvolt = <712500>;
516                 regulator-max-microvolt = <1500000>;
517                 regulator-ramp-delay = <1000>;
518                 fcs,suspend-voltage-selector = <1>;
519                 regulator-boot-on;
520                 regulator-initial-state = <3>;
521                         regulator-state-mem {
522                         regulator-off-in-suspend;
523                 };
524         };
525
526         rk818: pmic@1c {
527                 compatible = "rockchip,rk818";
528                 status = "okay";
529                 reg = <0x1c>;
530                 clock-output-names = "xin32k", "wifibt_32kin";
531                 interrupt-parent = <&gpio1>;
532                 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
533                 pinctrl-names = "default";
534                 pinctrl-0 = <&pmic_int_l>;
535                 rockchip,system-power-controller;
536                 wakeup-source;
537                 extcon = <&fusb0>;
538                 #clock-cells = <1>;
539
540                 vcc1-supply = <&vcc_sys>;
541                 vcc2-supply = <&vcc_sys>;
542                 vcc3-supply = <&vcc_sys>;
543                 vcc4-supply = <&vcc_sys>;
544                 vcc6-supply = <&vcc_sys>;
545                 vcc7-supply = <&vcc3v3_sys>;
546                 vcc8-supply = <&vcc_sys>;
547                 vcc9-supply = <&vcc3v3_sys>;
548
549                 regulators {
550                         vdd_cpu_l: DCDC_REG1 {
551                                 regulator-name = "vdd_cpu_l";
552                                 regulator-always-on;
553                                 regulator-boot-on;
554                                 regulator-min-microvolt = <750000>;
555                                 regulator-max-microvolt = <1350000>;
556                                 regulator-ramp-delay = <6001>;
557                                 regulator-state-mem {
558                                         regulator-off-in-suspend;
559                                 };
560                         };
561
562                         vdd_center: DCDC_REG2 {
563                                 regulator-name = "vdd_center";
564                                 regulator-always-on;
565                                 regulator-boot-on;
566                                 regulator-min-microvolt = <800000>;
567                                 regulator-max-microvolt = <1350000>;
568                                 regulator-ramp-delay = <6001>;
569                                 regulator-state-mem {
570                                         regulator-on-in-suspend;
571                                         regulator-suspend-microvolt = <1000000>;
572                                 };
573                         };
574
575                         vcc_ddr: DCDC_REG3 {
576                                 regulator-name = "vcc_ddr";
577                                 regulator-always-on;
578                                 regulator-boot-on;
579                                 regulator-state-mem {
580                                         regulator-on-in-suspend;
581                                 };
582                         };
583
584                         vcc_1v8: DCDC_REG4 {
585                                 regulator-name = "vcc_1v8";
586                                 regulator-always-on;
587                                 regulator-boot-on;
588                                 regulator-min-microvolt = <1800000>;
589                                 regulator-max-microvolt = <1800000>;
590                                 regulator-state-mem {
591                                         regulator-on-in-suspend;
592                                         regulator-suspend-microvolt = <1800000>;
593                                 };
594                         };
595
596                         vcca3v0_codec: LDO_REG1 {
597                                 regulator-always-on;
598                                 regulator-boot-on;
599                                 regulator-min-microvolt = <3000000>;
600                                 regulator-max-microvolt = <3000000>;
601                                 regulator-name = "vcca3v0_codec";
602                                 regulator-state-mem {
603                                         regulator-off-in-suspend;
604                                 };
605                         };
606
607                         vcc3v0_tp: LDO_REG2 {
608                                 regulator-always-on;
609                                 regulator-boot-on;
610                                 regulator-min-microvolt = <3000000>;
611                                 regulator-max-microvolt = <3000000>;
612                                 regulator-name = "vcc3v0_tp";
613                                 regulator-state-mem {
614                                         regulator-off-in-suspend;
615                                 };
616                         };
617
618                         vcca1v8_codec: LDO_REG3 {
619                                 regulator-always-on;
620                                 regulator-boot-on;
621                                 regulator-min-microvolt = <1800000>;
622                                 regulator-max-microvolt = <1800000>;
623                                 regulator-name = "vcca1v8_codec";
624                                 regulator-state-mem {
625                                         regulator-off-in-suspend;
626                                 };
627                         };
628
629                         vcc_power_on: LDO_REG4 {
630                                 regulator-always-on;
631                                 regulator-boot-on;
632                                 regulator-min-microvolt = <3300000>;
633                                 regulator-max-microvolt = <3300000>;
634                                 regulator-name = "vcc_power_on";
635                                 regulator-state-mem {
636                                         regulator-on-in-suspend;
637                                         regulator-suspend-microvolt = <3300000>;
638                                 };
639                         };
640
641                         vcc_3v0: LDO_REG5 {
642                                 regulator-always-on;
643                                 regulator-boot-on;
644                                 regulator-min-microvolt = <3000000>;
645                                 regulator-max-microvolt = <3000000>;
646                                 regulator-name = "vcc_3v0";
647                                 regulator-state-mem {
648                                         regulator-on-in-suspend;
649                                         regulator-suspend-microvolt = <3000000>;
650                                 };
651                         };
652
653                         vcc_1v5: LDO_REG6 {
654                                 regulator-always-on;
655                                 regulator-boot-on;
656                                 regulator-min-microvolt = <1500000>;
657                                 regulator-max-microvolt = <1500000>;
658                                 regulator-name = "vcc_1v5";
659                                 regulator-state-mem {
660                                         regulator-on-in-suspend;
661                                         regulator-suspend-microvolt = <1500000>;
662                                 };
663                         };
664
665                         vcc1v8_dvp: LDO_REG7 {
666                                 regulator-always-on;
667                                 regulator-boot-on;
668                                 regulator-min-microvolt = <1800000>;
669                                 regulator-max-microvolt = <1800000>;
670                                 regulator-name = "vcc1v8_dvp";
671                                 regulator-state-mem {
672                                         regulator-on-in-suspend;
673                                         regulator-suspend-microvolt = <1800000>;
674                                 };
675                         };
676
677                         vcc3v3_s3: LDO_REG8 {
678                                 regulator-always-on;
679                                 regulator-boot-on;
680                                 regulator-min-microvolt = <3300000>;
681                                 regulator-max-microvolt = <3300000>;
682                                 regulator-name = "vcc3v3_s3";
683                                 regulator-state-mem {
684                                         regulator-on-in-suspend;
685                                         regulator-suspend-microvolt = <3300000>;
686                                 };
687                         };
688
689                         vcc_sd: LDO_REG9 {
690                                 regulator-always-on;
691                                 regulator-boot-on;
692                                 regulator-min-microvolt = <1800000>;
693                                 regulator-max-microvolt = <3300000>;
694                                 regulator-name = "vcc_sd";
695                                 regulator-state-mem {
696                                         regulator-on-in-suspend;
697                                         regulator-suspend-microvolt = <3300000>;
698                                 };
699                         };
700
701                         vcc3v3_s0: SWITCH_REG {
702                                 regulator-always-on;
703                                 regulator-boot-on;
704                                 regulator-name = "vcc3v3_s0";
705                                 regulator-state-mem {
706                                         regulator-on-in-suspend;
707                                 };
708                         };
709                 };
710
711                 battery {
712                         compatible = "rk818-battery";
713                         ocv_table = <
714                                 3400 3599 3671 3701 3728 3746 3762
715                                 3772 3781 3792 3816 3836 3866 3910
716                                 3942 3971 4002 4050 4088 4132 4183>;
717                         design_capacity = <4000>;
718                         design_qmax = <4100>;
719                         bat_res = <100>;
720                         max_input_current = <2000>;
721                         max_chrg_current = <1800>;
722                         max_chrg_voltage = <4200>;
723                         sleep_enter_current = <300>;
724                         sleep_exit_current = <300>;
725                         power_off_thresd = <3400>;
726                         zero_algorithm_vol = <3850>;
727                         fb_temperature = <115>;
728                         sample_res = <10>;
729                         max_soc_offset = <60>;
730                         energy_mode = <0>;
731                         monitor_sec = <5>;
732                         virtual_power = <0>;
733                         power_dc2otg = <0>;
734                 };
735         };
736 };
737
738 &i2c1 {
739         status = "okay";
740         i2c-scl-rising-time-ns = <164>;
741         i2c-scl-falling-time-ns = <15>;
742
743         es8316: es8316@10 {
744                 #sound-dai-cells = <0>;
745                 compatible = "everest,es8316";
746                 reg = <0x10>;
747                 clocks = <&cru SCLK_I2S_8CH_OUT>;
748                 clock-names = "mclk";
749                 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
750                 hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_LOW>;
751         };
752 };
753
754 &i2c4 {
755         status = "okay";
756         i2c-scl-rising-time-ns = <345>;
757         i2c-scl-falling-time-ns = <11>;
758         clock-frequency = <400000>;
759
760         sensor@0f {
761                 status = "okay";
762                 compatible = "ak8963";
763                 pinctrl-names = "default";
764                 pinctrl-0 = <&ak8963_irq_gpio>;
765                 reg = <0x0f>;
766                 type = <SENSOR_TYPE_COMPASS>;
767                 irq-gpio = <&gpio1 0 IRQ_TYPE_EDGE_RISING>;
768                 irq_enable = <1>;
769                 poll_delay_ms = <30>;
770                 layout = <1>;
771         };
772
773         fusb0: fusb30x@22 {
774                 compatible = "fairchild,fusb302";
775                 reg = <0x22>;
776                 pinctrl-names = "default";
777                 pinctrl-0 = <&fusb0_int>;
778                 int-n-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
779                 status = "okay";
780         };
781 };
782
783 &i2c5 {
784         status = "okay";
785
786         touch@40 {
787                 compatible = "gslX680";
788                 reg = <0x40>;
789                 touch-gpio = <&gpio1 20 IRQ_TYPE_LEVEL_LOW>;
790                 reset-gpio = <&gpio4 22 GPIO_ACTIVE_LOW>;
791                 max-x = <1280>;
792                 max-y = <600>;
793                 status = "okay";
794         };
795 };
796
797 &spi1 {
798         status = "okay";
799         max-freq = <50000000>;
800         pinctrl-names = "default", "sleep";
801         pinctrl-1 = <&spi1_gpio>;
802         mpu6500@0 {
803                 status = "okay";
804                 compatible = "inv-spi,mpu6500";
805                 pinctrl-names = "default";
806                 pinctrl-0 = <&mpu6500_irq_gpio>;
807                 irq-gpio = <&gpio1 4 IRQ_TYPE_EDGE_RISING>;
808                 reg = <0>;
809                 spi-max-frequency = <1000000>;
810                 spi-cpha;
811                 spi-cpol;
812                 mpu-int_config = <0x00>;
813                 mpu-level_shifter = <0>;
814                 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
815                 orientation-x= <1>;
816                 orientation-y= <0>;
817                 orientation-z= <1>;
818                 mpu-debug = <1>;
819         };
820 };
821
822 &tsadc {
823         rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
824         rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
825         status = "okay";
826 };
827
828 &saradc {
829         status = "okay";
830 };
831
832 &rk_key {
833         compatible = "rockchip,key";
834         status = "okay";
835         io-channels = <&saradc 1>;
836
837         vol-up-key {
838                 linux,code = <115>;
839                 label = "volume up";
840                 rockchip,adc_value = <340>;
841         };
842
843         vol-down-key {
844                 linux,code = <114>;
845                 label = "volume down";
846                 rockchip,adc_value = <170>;
847         };
848
849         power-key {
850                 gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
851                 linux,code = <116>;
852                 label = "power";
853                 gpio-key,wakeup;
854         };
855
856         back-key {
857                 linux,code = <158>;
858                 label = "back";
859                 rockchip,adc_value = <620>;
860         };
861
862         home-key {
863                 linux,code = <102>;
864                 label = "home";
865                 rockchip,adc_value = <700>;
866         };
867 };
868
869 &u2phy0 {
870         extcon = <&fusb0>;
871         status = "okay";
872
873         u2phy0_otg: otg-port {
874                 status = "okay";
875         };
876
877         u2phy0_host: host-port {
878                 phy-supply = <&vcc5v0_host>;
879                 status = "okay";
880         };
881 };
882
883 &u2phy1 {
884         status = "okay";
885
886         u2phy1_otg: otg-port {
887                 status = "okay";
888         };
889
890         u2phy1_host: host-port {
891                 phy-supply = <&vcc5v0_host>;
892                 status = "okay";
893         };
894 };
895
896 &uart0 {
897         pinctrl-names = "default";
898         pinctrl-0 = <&uart0_xfer &uart0_cts>;
899         status = "okay";
900 };
901
902 &uart2 {
903         status = "okay";
904 };
905
906 &usb_host0_ehci {
907         status = "okay";
908 };
909
910 &usb_host0_ohci {
911         status = "okay";
912 };
913
914 &usb_host1_ehci {
915         status = "okay";
916 };
917
918 &usb_host1_ohci {
919         status = "okay";
920 };
921
922 &usbdrd3_0 {
923         extcon = <&fusb0>;
924         status = "okay";
925 };
926
927 &usbdrd_dwc3_0 {
928         status = "okay";
929 };
930
931 &usbdrd3_1 {
932         status = "okay";
933 };
934
935 &usbdrd_dwc3_1 {
936         status = "okay";
937 };
938
939 &tcphy0 {
940         status = "okay";
941         extcon = <&fusb0>;
942 };
943
944 &pwm0 {
945         status = "okay";
946 };
947
948 &pwm2 {
949         status = "okay";
950 };
951
952 &vdd_center {
953         rockchip,pwm_id= <3>;
954         rockchip,pwm_voltage = <900000>;
955 };
956
957 &rk_screen {
958         assigned-clocks = <&cru PLL_VPLL>;
959         assigned-clock-rates = <245000000>;
960         #include <dt-bindings/display/screen-timing/lcd-ls055r1sx04-mipi.dtsi>
961 };
962
963 &fb {
964         rockchip,uboot-logo-on = <1>;
965         rockchip,disp-mode = <NO_DUAL>;
966 };
967
968 &vopb_rk_fb {
969         status = "okay";
970         power_ctr: power_ctr {
971                 lcd_en: lcd-en {
972                         rockchip,power_type = <GPIO>;
973                         gpios = <&gpio3 5 GPIO_ACTIVE_HIGH>;
974                         rockchip,delay = <10>;
975                 };
976                 lcd_rst: lcd-rst {
977                         rockchip,power_type = <GPIO>;
978                         gpios = <&gpio3 4 GPIO_ACTIVE_HIGH>;
979                         rockchip,delay = <10>;
980                 };
981         };
982 };
983
984 &vopl_rk_fb {
985         status = "okay";
986 };
987
988 &mipi0_rk_fb {
989         status = "okay";
990 };
991
992 &mipi1_rk_fb {
993         status = "okay";
994 };
995
996 &cpu_l0 {
997         cpu-supply = <&vdd_cpu_l>;
998 };
999
1000 &cpu_l1 {
1001         cpu-supply = <&vdd_cpu_l>;
1002 };
1003
1004 &cpu_l2 {
1005         cpu-supply = <&vdd_cpu_l>;
1006 };
1007
1008 &cpu_l3 {
1009         cpu-supply = <&vdd_cpu_l>;
1010 };
1011
1012 &cpu_b0 {
1013         cpu-supply = <&vdd_cpu_b>;
1014 };
1015
1016 &cpu_b1 {
1017         cpu-supply = <&vdd_cpu_b>;
1018 };
1019
1020 &gpu {
1021         status = "okay";
1022         mali-supply = <&vdd_gpu>;
1023 };
1024
1025 &pinctrl {
1026         sdio-pwrseq {
1027                 wifi_enable_h: wifi-enable-h {
1028                         rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
1029                 };
1030         };
1031
1032         wireless-bluetooth {
1033                 uart0_gpios: uart0-gpios {
1034                         rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
1035                 };
1036         };
1037
1038         pmic {
1039                 pmic_int_l: pmic-int-l {
1040                         rockchip,pins =
1041                                 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
1042                 };
1043
1044                 pmic_dvs2: pmic-dvs2 {
1045                         rockchip,pins =
1046                                 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
1047                 };
1048
1049                 vsel1_gpio: vsel1-gpio {
1050                         rockchip,pins =
1051                                 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
1052                 };
1053
1054                 vsel2_gpio: vsel2-gpio {
1055                         rockchip,pins =
1056                                 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
1057                 };
1058         };
1059
1060         mpu6500 {
1061                 mpu6500_irq_gpio: mpu6500-irq-gpio {
1062                         rockchip,pins = <1 4 RK_FUNC_GPIO &pcfg_pull_none>;
1063                 };
1064         };
1065
1066         usb2 {
1067                 host_vbus_drv: host-vbus-drv {
1068                         rockchip,pins =
1069                                 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
1070                 };
1071         };
1072
1073         ak8963 {
1074                 ak8963_irq_gpio: ak8963-irq-gpio {
1075                         rockchip,pins = <1 0 RK_FUNC_GPIO &pcfg_pull_none>;
1076                 };
1077         };
1078
1079         spi1 {
1080                 spi1_gpio: spi1-gpio {
1081                         rockchip,pins =
1082                                 <1 7 RK_FUNC_GPIO &pcfg_output_low>,
1083                                 <1 8 RK_FUNC_GPIO &pcfg_output_low>,
1084                                 <1 9 RK_FUNC_GPIO &pcfg_output_low>,
1085                                 <1 10 RK_FUNC_GPIO &pcfg_output_low>;
1086                 };
1087         };
1088
1089         fusb30x {
1090                 fusb0_int: fusb0-int {
1091                         rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>;
1092                 };
1093         };
1094 };