ARM64: dts: rk3399-box-rev2: enable hdmi uboot logo display
[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
594                 battery {
595                         compatible = "rk818-battery";
596                         ocv_table = <3400 3675 3689 3716 3740 3756 3768 3780
597                                 3793 3807 3827 3853 3896 3937 3974 4007 4066
598                                 4110 4161 4217 4308>;
599                         design_capacity = <7916>;
600                         design_qmax = <8708>;
601                         bat_res = <65>;
602                         max_input_current = <3000>;
603                         max_chrg_current = <3000>;
604                         max_chrg_voltage = <4350>;
605                         sleep_enter_current = <300>;
606                         sleep_exit_current = <300>;
607                         power_off_thresd = <3400>;
608                         zero_algorithm_vol = <3950>;
609                         fb_temperature = <105>;
610                         sample_res = <20>;
611                         max_soc_offset = <60>;
612                         energy_mode = <0>;
613                         monitor_sec = <5>;
614                         virtual_power = <0>;
615                         power_dc2otg = <0>;
616                 };
617         };
618 };
619
620 &i2c1 {
621         status = "okay";
622         i2c-scl-rising-time-ns = <140>;
623         i2c-scl-falling-time-ns = <30>;
624
625         es8316: es8316@10 {
626                 #sound-dai-cells = <0>;
627                 compatible = "everest,es8316";
628                 reg = <0x11>;
629                 clocks = <&cru SCLK_I2S_8CH_OUT>;
630                 clock-names = "mclk";
631                 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
632         };
633 };
634
635 &i2c4 {
636         status = "okay";
637         i2c-scl-rising-time-ns = <345>;
638         i2c-scl-falling-time-ns = <11>;
639         clock-frequency = <400000>;
640
641         lsm330_accel@1e {
642                 status = "okay";
643                 compatible = "lsm330_acc";
644                 pinctrl-names = "default";
645                 pinctrl-0 = <&lsm330a_irq_gpio>;
646                 reg = <0x1e>;
647                 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
648                 type = <SENSOR_TYPE_ACCEL>;
649                 irq_enable = <1>;
650                 poll_delay_ms = <30>;
651                 power-off-in-suspend = <1>;
652                 layout = <4>;
653         };
654
655         lsm330_gyro@6a {
656                 status = "okay";
657                 compatible = "lsm330_gyro";
658                 pinctrl-names = "default";
659                 pinctrl-0 = <&lsm330g_irq_gpio>;
660                 reg = <0x6a>;
661                 irq-gpio = <&gpio1 20 IRQ_TYPE_EDGE_RISING>;
662                 type = <SENSOR_TYPE_GYROSCOPE>;
663                 irq_enable = <0>;
664                 power-off-in-suspend = <1>;
665                 poll_delay_ms = <30>;
666         };
667
668         mpu6500@68 {
669                 status = "disabled";
670                 compatible = "invensense,mpu6500";
671                 pinctrl-names = "default";
672                 pinctrl-0 = <&mpu6500_irq_gpio>;
673                 reg = <0x68>;
674                 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
675                 mpu-int_config = <0x10>;
676                 mpu-level_shifter = <0>;
677                 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
678                 orientation-x= <1>;
679                 orientation-y= <1>;
680                 orientation-z= <0>;
681                 support-hw-poweroff = <1>;
682                 mpu-debug = <1>;
683         };
684
685         sensor@0d {
686                 status = "okay";
687                 compatible = "ak8963";
688                 pinctrl-names = "default";
689                 pinctrl-0 = <&ak8963_irq_gpio>;
690                 reg = <0x0d>;
691                 type = <SENSOR_TYPE_COMPASS>;
692                 irq-gpio = <&gpio2 28 IRQ_TYPE_EDGE_RISING>;
693                 irq_enable = <0>;
694                 poll_delay_ms = <30>;
695                 layout = <3>;
696         };
697
698         sensor@10 {
699                 status = "okay";
700                 compatible = "capella,light_cm3218";
701                 pinctrl-names = "default";
702                 pinctrl-0 = <&cm3218_irq_gpio>;
703                 reg = <0x10>;
704                 type = <SENSOR_TYPE_LIGHT>;
705                 irq-gpio = <&gpio4 24 IRQ_TYPE_EDGE_FALLING>;
706                 irq_enable = <1>;
707                 poll_delay_ms = <30>;
708         };
709
710         fusb0: fusb30x@22 {
711                 compatible = "fairchild,fusb302";
712                 reg = <0x22>;
713                 pinctrl-names = "default";
714                 pinctrl-0 = <&fusb0_int>;
715                 int-n-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
716                 status = "okay";
717         };
718 };
719
720 &i2c5 {
721         status = "okay";
722         i2c-scl-rising-time-ns = <150>;
723         i2c-scl-falling-time-ns = <30>;
724         clock-frequency = <400000>;
725
726         gt9xx: gt9xx@14 {
727                 compatible = "goodix,gt9xx";
728                 reg = <0x14>;
729                 touch-gpio = <&gpio3 12 IRQ_TYPE_LEVEL_LOW>;
730                 reset-gpio = <&gpio3 13 GPIO_ACTIVE_HIGH>;
731                 max-x = <1536>;
732                 max-y = <2048>;
733                 tp-size = <970>;
734                 tp-supply = <&vcc3v0_tp>;
735         };
736 };
737
738 &io_domains {
739         status = "okay";
740
741         bt656-supply = <&vcc1v8_dvp>;
742         audio-supply = <&vcca1v8_codec>;
743         sdmmc-supply = <&vcc_sd>;
744         gpio1830-supply = <&vcc_3v0>;
745 };
746
747 &isp0 {
748         status = "okay";
749 };
750
751 &isp1 {
752         status = "okay";
753 };
754
755 &isp0_mmu {
756         status = "okay";
757 };
758
759 &isp1_mmu {
760         status = "okay";
761 };
762
763 &cpu_l0 {
764         cpu-supply = <&vdd_cpu_l>;
765 };
766
767 &cpu_l1 {
768         cpu-supply = <&vdd_cpu_l>;
769 };
770
771 &cpu_l2 {
772         cpu-supply = <&vdd_cpu_l>;
773 };
774
775 &cpu_l3 {
776         cpu-supply = <&vdd_cpu_l>;
777 };
778
779 &cpu_b0 {
780         cpu-supply = <&vdd_cpu_b>;
781 };
782
783 &cpu_b1 {
784         cpu-supply = <&vdd_cpu_b>;
785 };
786
787 &gpu {
788         status = "okay";
789         mali-supply = <&vdd_gpu>;
790 };
791
792 &spi1 {
793         status = "disabled";
794         max-freq = <50000000>;
795         mpu6500@0 {
796                 status = "disabled";
797                 compatible = "inv-spi,mpu6500";
798                 pinctrl-names = "default";
799                 pinctrl-0 = <&mpu6500_irq_gpio>;
800                 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
801                 reg = <0>;
802                 spi-max-frequency = <1000000>;
803                 spi-cpha;
804                 spi-cpol;
805                 mpu-int_config = <0x00>;
806                 mpu-level_shifter = <0>;
807                 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
808                 orientation-x= <1>;
809                 orientation-y= <0>;
810                 orientation-z= <1>;
811                 support-hw-poweroff = <1>;
812                 mpu-debug = <1>;
813         };
814 };
815
816 &tcphy0 {
817         extcon = <&fusb0>;
818         status = "okay";
819 };
820
821 &tsadc {
822         rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
823         rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
824         status = "okay";
825 };
826
827 &u2phy0 {
828         status = "okay";
829         extcon = <&fusb0>;
830
831         u2phy0_otg: otg-port {
832                 status = "okay";
833         };
834
835         u2phy0_host: host-port {
836                 phy-supply = <&vcc5v0_host>;
837                 status = "okay";
838         };
839 };
840
841 &uart0 {
842         pinctrl-names = "default";
843         pinctrl-0 = <&uart0_xfer &uart0_cts>;
844         status = "okay";
845 };
846
847 &uart2 {
848         status = "okay";
849 };
850
851 &usb_host0_ehci {
852         status = "okay";
853 };
854
855 &usb_host0_ohci {
856         status = "okay";
857 };
858
859 &usbdrd3_0 {
860         extcon = <&fusb0>;
861         status = "okay";
862 };
863
864 &usbdrd_dwc3_0 {
865         status = "okay";
866 };
867
868 &pwm0 {
869         status = "okay";
870 };
871
872 &pwm2 {
873         status = "okay";
874 };
875
876 &saradc {
877         status = "okay";
878 };
879
880 &rockchip_suspend {
881         status = "okay";
882         rockchip,sleep-debug-en = <1>;
883         rockchip,sleep-mode-config = <
884                 (0
885                 | RKPM_SLP_ARMPD
886                 | RKPM_SLP_PERILPPD
887                 | RKPM_SLP_DDR_RET
888                 | RKPM_SLP_PLLPD
889                 | RKPM_SLP_CENTER_PD
890                 | RKPM_SLP_AP_PWROFF
891                 )
892         >;
893         rockchip,wakeup-config = <
894                 (0
895                 | RKPM_GPIO_WKUP_EN
896                 | RKPM_PWM_WKUP_EN
897                 )
898         >;
899         rockchip,pwm-regulator-config = <
900                 (0
901                 | PWM2_REGULATOR_EN
902                 )
903         >;
904         rockchip,power-ctrl =
905                 <&gpio1 17 GPIO_ACTIVE_HIGH>,
906                 <&gpio1 14 GPIO_ACTIVE_HIGH>;
907 };
908
909 &pinctrl {
910         sdio-pwrseq {
911                 wifi_enable_h: wifi-enable-h {
912                         rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
913                 };
914         };
915
916         wireless-bluetooth {
917                 uart0_gpios: uart0-gpios {
918                         rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
919                 };
920         };
921
922         pmic {
923                 pmic_int_l: pmic-int-l {
924                         rockchip,pins =
925                                 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
926                 };
927
928                 pmic_dvs2: pmic-dvs2 {
929                         rockchip,pins =
930                                 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
931                 };
932                 vsel1_gpio: vsel1-gpio {
933                         rockchip,pins =
934                                 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
935                 };
936                 vsel2_gpio: vsel2-gpio {
937                         rockchip,pins =
938                                 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
939                 };
940         };
941
942         hallsensor {
943                 mh248_irq_gpio: mh248-irq-gpio {
944                         rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>;
945                 };
946         };
947
948         headphone {
949                 hp_det: hp-det {
950                         rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_up>;
951                 };
952         };
953
954         lsm330_a {
955                 lsm330a_irq_gpio: lsm330a-irq-gpio {
956                         rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
957                 };
958         };
959
960         lsm330_g {
961                 lsm330g_irq_gpio: lsm330g-irq-gpio {
962                         rockchip,pins = <1 20 RK_FUNC_GPIO &pcfg_pull_none>;
963                 };
964         };
965
966         mpu6500 {
967                 mpu6500_irq_gpio: mpu6500-irq-gpio {
968                         rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
969                 };
970         };
971
972         ak8963 {
973                 ak8963_irq_gpio: ak8963-irq-gpio {
974                         rockchip,pins = <2 28 RK_FUNC_GPIO &pcfg_pull_none>;
975                 };
976         };
977
978         cm3218 {
979                 cm3218_irq_gpio: cm3218-irq-gpio {
980                         rockchip,pins = <4 24 RK_FUNC_GPIO &pcfg_pull_up>;
981                 };
982         };
983
984         usb2 {
985                 host_vbus_drv: host-vbus-drv {
986                         rockchip,pins =
987                                 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
988                 };
989         };
990
991         fusb30x {
992                 fusb0_int: fusb0-int {
993                         rockchip,pins =
994                                 <1 1 RK_FUNC_GPIO &pcfg_pull_up>;
995                 };
996         };
997 };
998
999 &edp {
1000         status = "okay";
1001         ports {
1002                 edp_out: port@1 {
1003                         reg = <1>;
1004                         #address-cells = <1>;
1005                         #size-cells = <0>;
1006                         edp_out_panel: endpoint@0 {
1007                                 reg = <0>;
1008                                 remote-endpoint = <&panel_in_edp>;
1009                         };
1010                 };
1011         };
1012 };
1013
1014 &edp_in_vopl {
1015         status = "disabled";
1016 };
1017
1018 &hdmi {
1019         status = "okay";
1020 };
1021
1022 &hdmi_in_vopb {
1023         status = "disabled";
1024 };
1025
1026 &cdn_dp {
1027         status = "okay";
1028         extcon = <&fusb0>;
1029         phys = <&tcphy0_dp>;
1030 };
1031
1032 &dp_in_vopb {
1033         status = "disabled";
1034 };
1035
1036 &pmu_io_domains {
1037         status = "okay";
1038         pmu1830-supply = <&vcc_1v8>;
1039 };
1040
1041 &route_edp {
1042         status = "okay";
1043         logo,mode = "center";
1044 };