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