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