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