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