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