ARM64: dts: rockchip: move rk3399 io-domain nodes to the grf
[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         hall_sensor: hall-mh248 {
55                 compatible = "hall-mh248";
56                 pinctrl-names = "default";
57                 pinctrl-0 = <&mh248_irq_gpio>;
58                 irq-gpio = <&gpio1 2 IRQ_TYPE_EDGE_BOTH>;
59                 hall-active = <1>;
60                 status = "okay";
61         };
62
63         vcc_sys: vcc-sys {
64                 compatible = "regulator-fixed";
65                 regulator-name = "vcc_sys";
66                 regulator-always-on;
67                 regulator-boot-on;
68                 regulator-min-microvolt = <3900000>;
69                 regulator-max-microvolt = <3900000>;
70         };
71
72         vcc3v3_sys: vcc3v3-sys {
73                 compatible = "regulator-fixed";
74                 regulator-name = "vcc3v3_sys";
75                 regulator-always-on;
76                 regulator-boot-on;
77                 regulator-min-microvolt = <3300000>;
78                 regulator-max-microvolt = <3300000>;
79         };
80
81         vcc5v0_host: vcc5v0-host-regulator {
82                 compatible = "regulator-fixed";
83                 enable-active-high;
84                 gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>;
85                 pinctrl-names = "default";
86                 pinctrl-0 = <&host_vbus_drv>;
87                 regulator-name = "vcc5v0_host";
88         };
89
90         vdd_log: vdd-log {
91                 compatible = "pwm-regulator";
92                 pwms = <&pwm2 0 25000 0>;
93                 rockchip,pwm_id= <2>;
94                 rockchip,pwm_voltage = <900000>;
95                 regulator-name = "vdd_log";
96                 regulator-min-microvolt = <750000>;
97                 regulator-max-microvolt = <1350000>;
98                 regulator-always-on;
99                 regulator-boot-on;
100         };
101
102         backlight: backlight {
103                 compatible = "pwm-backlight";
104                 pwms = <&vop0_pwm 0 25000 PWM_POLARITY_INVERTED>;
105                 brightness-levels = <
106                         0   1   51  52  52  53  53  54
107                         54  55  55  56  56  57  57  58
108                         58  59  59  60  61  61  62  63
109                         63  64  65  65  66  67  67  68
110                         69  69  70  71  71  72  73  73
111                         74  75  75  76  77  77  78  79
112                         79  80  80  81  81  82  83  83
113                         84  85  86  86  87  88  89  89
114                         90  91  92  92  93  94  95  95
115                         96  97  98  98  99 100 101  101
116                         102 103 104 104 105 106 107 107
117                         108 109 110 110 111 112 113 113
118                         114 115 116 116 117 118 119 119
119                         120 121 122 122 123 124 125 125
120                         126 127 128 128 129 130 131 131
121                         132 133 134 134 135 136 137 137
122                         138 139 140 140 141 142 143 143
123                         144 145 146 146 147 148 149 149
124                         150 151 152 152 153 154 155 155
125                         156 157 158 158 159 160 161 161
126                         162 163 164 164 165 166 167 167
127                         168 169 170 170 171 172 173 173
128                         174 175 176 176 177 178 179 179
129                         180 181 182 182 183 184 185 185
130                         186 187 188 188 189 190 191 191
131                         216 217 218 218 219 220 221 221
132                         222 223 224 224 225 226 227 227
133                         228 229 230 230 231 232 233 233
134                         234 235 236 236 237 238 239 239
135                         240 241 242 242 243 244 245 245
136                         246 247 248 248 249 250 251 251
137                         252 253 254 254 255 255 255 255>;
138                 default-brightness-level = <200>;
139                 enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
140         };
141
142         vcc_phy: vcc-phy-regulator {
143                 compatible = "regulator-fixed";
144                 regulator-name = "vcc_phy";
145                 regulator-always-on;
146                 regulator-boot-on;
147         };
148
149         pmu-io-domains {
150                 compatible = "rockchip,rk3399-pmu-io-voltage-domain";
151                 rockchip,grf = <&pmugrf>;
152
153                 pmu1830-supply = <&vcc_1v8>;
154         };
155
156         es8316-sound {
157                 compatible = "simple-audio-card";
158                 simple-audio-card,format = "i2s";
159                 simple-audio-card,name = "rockchip,es8316-codec";
160                 simple-audio-card,mclk-fs = <256>;
161                 simple-audio-card,widgets =
162                         "Microphone", "Mic Jack",
163                         "Headphone", "Headphone Jack";
164                 simple-audio-card,routing =
165                         "Mic Jack", "MICBIAS1",
166                         "IN1P", "Mic Jack",
167                         "Headphone Jack", "HPOL",
168                         "Headphone Jack", "HPOR";
169                 simple-audio-card,cpu {
170                         sound-dai = <&i2s0>;
171                 };
172                 simple-audio-card,codec {
173                         sound-dai = <&es8316>;
174                 };
175         };
176
177         spdif-sound {
178                 compatible = "simple-audio-card";
179                 simple-audio-card,name = "rockchip,spdif";
180                 simple-audio-card,cpu {
181                         sound-dai = <&spdif>;
182                 };
183                 simple-audio-card,codec {
184                         sound-dai = <&spdif_out>;
185                 };
186         };
187
188         spdif_out: spdif-out {
189                 compatible = "linux,spdif-dit";
190                 #sound-dai-cells = <0>;
191         };
192
193         sdio_pwrseq: sdio-pwrseq {
194                 compatible = "mmc-pwrseq-simple";
195                 clocks = <&rk818 1>;
196                 clock-names = "ext_clock";
197                 pinctrl-names = "default";
198                 pinctrl-0 = <&wifi_enable_h>;
199
200                 /*
201                  * On the module itself this is one of these (depending
202                  * on the actual card populated):
203                  * - SDIO_RESET_L_WL_REG_ON
204                  * - PDN (power down when low)
205                  */
206                 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
207         };
208
209         wireless-wlan {
210                 compatible = "wlan-platdata";
211                 rockchip,grf = <&grf>;
212                 wifi_chip_type = "ap6354";
213                 sdio_vref = <1800>;
214                 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
215                 status = "okay";
216         };
217
218         wireless-bluetooth {
219                 compatible = "bluetooth-platdata";
220                 clocks = <&rk818 1>;
221                 clock-names = "ext_clock";
222                 //wifi-bt-power-toggle;
223                 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
224                 pinctrl-names = "default", "rts_gpio";
225                 pinctrl-0 = <&uart0_rts>;
226                 pinctrl-1 = <&uart0_gpios>;
227                 //BT,power_gpio  = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */
228                 BT,reset_gpio    = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
229                 BT,wake_gpio     = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
230                 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
231                 status = "okay";
232         };
233
234         uboot-charge {
235                 compatible = "rockchip,uboot-charge";
236                 rockchip,uboot-charge-on = <0>;
237                 rockchip,android-charge-on = <1>;
238         };
239
240         vibrator {
241                 compatible = "rk-vibrator-gpio";
242                 vibrator-gpio = <&gpio4 30 GPIO_ACTIVE_LOW>;
243                 status = "okay";
244         };
245
246         rk_headset {
247                 compatible = "rockchip_headset";
248                 headset_gpio = <&gpio4 28 GPIO_ACTIVE_HIGH>;
249                 pinctrl-names = "default";
250                 pinctrl-0 = <&hp_det>;
251                 io-channels = <&saradc 2>;
252         };
253 };
254
255 &rk_key {
256         compatible = "rockchip,key";
257         status = "okay";
258
259         io-channels = <&saradc 1>;
260
261         vol-up-key {
262                 linux,code = <114>;
263                 label = "volume up";
264                 rockchip,adc_value = <1>;
265         };
266
267         vol-down-key {
268                 linux,code = <115>;
269                 label = "volume down";
270                 rockchip,adc_value = <170>;
271         };
272
273         power-key {
274                 gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
275                 linux,code = <116>;
276                 label = "power";
277                 gpio-key,wakeup;
278         };
279
280         menu-key {
281                 linux,code = <59>;
282                 label = "menu";
283                 rockchip,adc_value = <746>;
284         };
285
286         home-key {
287                 linux,code = <102>;
288                 label = "home";
289                 rockchip,adc_value = <355>;
290         };
291
292         back-key {
293                 linux,code = <158>;
294                 label = "back";
295                 rockchip,adc_value = <560>;
296         };
297
298         camera-key {
299                 linux,code = <212>;
300                 label = "camera";
301                 rockchip,adc_value = <450>;
302         };
303 };
304
305 &sdmmc {
306         clock-frequency = <50000000>;
307         clock-freq-min-max = <400000 150000000>;
308         supports-sd;
309         bus-width = <4>;
310         cap-mmc-highspeed;
311         cap-sd-highspeed;
312         disable-wp;
313         num-slots = <1>;
314         //sd-uhs-sdr104;
315         vqmmc-supply = <&vcc_sd>;
316         pinctrl-names = "default";
317         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
318         status = "okay";
319 };
320
321 &sdio0 {
322         clock-frequency = <150000000>;
323         clock-freq-min-max = <200000 150000000>;
324         supports-sdio;
325         bus-width = <4>;
326         disable-wp;
327         cap-sd-highspeed;
328         cap-sdio-irq;
329         keep-power-in-suspend;
330         mmc-pwrseq = <&sdio_pwrseq>;
331         non-removable;
332         num-slots = <1>;
333         pinctrl-names = "default";
334         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
335         sd-uhs-sdr104;
336         status = "okay";
337 };
338
339 &emmc_phy {
340         status = "okay";
341 };
342
343 &sdhci {
344         bus-width = <8>;
345         mmc-hs400-1_8v;
346         supports-emmc;
347         non-removable;
348         keep-power-in-suspend;
349         mmc-hs400-enhanced-strobe;
350         status = "okay";
351 };
352
353 &i2s0 {
354         status = "okay";
355         rockchip,i2s-broken-burst-len;
356         rockchip,playback-channels = <8>;
357         rockchip,capture-channels = <8>;
358         #sound-dai-cells = <0>;
359 };
360
361 &i2s2 {
362         #sound-dai-cells = <0>;
363 };
364
365 &io_domains {
366         status = "okay";
367
368         bt656-supply = <&vcc1v8_dvp>;
369         audio-supply = <&vcca1v8_codec>;
370         sdmmc-supply = <&vcc_sd>;
371         gpio1830-supply = <&vcc_3v0>;
372 };
373
374 &spdif {
375         status = "okay";
376         #sound-dai-cells = <0>;
377 };
378
379 &i2c0 {
380         status = "okay";
381         i2c-scl-rising-time-ns = <180>;
382         i2c-scl-falling-time-ns = <30>;
383         clock-frequency = <400000>;
384
385         vdd_cpu_b: syr837@40 {
386                 compatible = "silergy,syr827";
387                 reg = <0x40>;
388                 vin-supply = <&vcc_sys>;
389                 regulator-compatible = "fan53555-reg";
390                 pinctrl-0 = <&vsel1_gpio>;
391                 vsel-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
392                 regulator-name = "vdd_cpu_b";
393                 regulator-min-microvolt = <712500>;
394                 regulator-max-microvolt = <1500000>;
395                 regulator-ramp-delay = <1000>;
396                 fcs,suspend-voltage-selector = <1>;
397                 regulator-always-on;
398                 regulator-initial-state = <3>;
399                 regulator-state-mem {
400                         regulator-off-in-suspend;
401                 };
402         };
403
404         vdd_gpu: syr828@41 {
405                 compatible = "silergy,syr828";
406                 status = "okay";
407                 reg = <0x41>;
408                 vin-supply = <&vcc_sys>;
409                 regulator-compatible = "fan53555-reg";
410                 pinctrl-0 = <&vsel2_gpio>;
411                 vsel-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
412                 regulator-name = "vdd_gpu";
413                 regulator-min-microvolt = <735000>;
414                 regulator-max-microvolt = <1400000>;
415                 regulator-ramp-delay = <1000>;
416                 fcs,suspend-voltage-selector = <1>;
417                 regulator-boot-on;
418                 regulator-state-mem {
419                         regulator-off-in-suspend;
420                 };
421         };
422
423         rk818: pmic@1c {
424                 compatible = "rockchip,rk818";
425                 status = "okay";
426                 reg = <0x1c>;
427                 clock-output-names = "xin32k", "wifibt_32kin";
428                 interrupt-parent = <&gpio1>;
429                 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
430                 pinctrl-names = "default";
431                 pinctrl-0 = <&pmic_int_l>;
432                 rockchip,system-power-controller;
433                 rk818,support_dc_chg = <1>;/*1: dc chg; 0:usb chg*/
434                 wakeup-source;
435                 extcon = <&fusb0>;
436                 #clock-cells = <1>;
437
438                 vcc1-supply = <&vcc_sys>;
439                 vcc2-supply = <&vcc_sys>;
440                 vcc3-supply = <&vcc_sys>;
441                 vcc4-supply = <&vcc_sys>;
442                 vcc6-supply = <&vcc_sys>;
443                 vcc7-supply = <&vcc3v3_sys>;
444                 vcc8-supply = <&vcc_sys>;
445                 vcc9-supply = <&vcc3v3_sys>;
446
447                 regulators {
448                         vdd_cpu_l: DCDC_REG1 {
449                                 regulator-name = "vdd_cpu_l";
450                                 regulator-always-on;
451                                 regulator-boot-on;
452                                 regulator-min-microvolt = <750000>;
453                                 regulator-max-microvolt = <1350000>;
454                                 regulator-ramp-delay = <6001>;
455                                 regulator-state-mem {
456                                         regulator-off-in-suspend;
457                                 };
458                         };
459
460                         vdd_center: DCDC_REG2 {
461                                 regulator-name = "vdd_center";
462                                 regulator-always-on;
463                                 regulator-boot-on;
464                                 regulator-min-microvolt = <800000>;
465                                 regulator-max-microvolt = <1350000>;
466                                 regulator-ramp-delay = <6001>;
467                                 regulator-state-mem {
468                                         regulator-off-in-suspend;
469                                 };
470                         };
471
472                         vcc_ddr: DCDC_REG3 {
473                                 regulator-name = "vcc_ddr";
474                                 regulator-always-on;
475                                 regulator-boot-on;
476                                 regulator-state-mem {
477                                         regulator-on-in-suspend;
478                                 };
479                         };
480
481                         vcc_1v8: DCDC_REG4 {
482                                 regulator-name = "vcc_1v8";
483                                 regulator-always-on;
484                                 regulator-boot-on;
485                                 regulator-min-microvolt = <1800000>;
486                                 regulator-max-microvolt = <1800000>;
487                                 regulator-state-mem {
488                                         regulator-on-in-suspend;
489                                         regulator-suspend-microvolt = <1800000>;
490                                 };
491                         };
492
493                         vcca3v0_codec: LDO_REG1 {
494                                 regulator-always-on;
495                                 regulator-boot-on;
496                                 regulator-min-microvolt = <3000000>;
497                                 regulator-max-microvolt = <3000000>;
498                                 regulator-name = "vcca3v0_codec";
499                                 regulator-state-mem {
500                                         regulator-off-in-suspend;
501                                 };
502                         };
503
504                         vcc3v0_tp: LDO_REG2 {
505                                 regulator-always-on;
506                                 regulator-boot-on;
507                                 regulator-min-microvolt = <3000000>;
508                                 regulator-max-microvolt = <3000000>;
509                                 regulator-name = "vcc3v0_tp";
510                                 regulator-state-mem {
511                                         regulator-off-in-suspend;
512                                 };
513                         };
514
515                         vcca1v8_codec: LDO_REG3 {
516                                 regulator-always-on;
517                                 regulator-boot-on;
518                                 regulator-min-microvolt = <1800000>;
519                                 regulator-max-microvolt = <1800000>;
520                                 regulator-name = "vcca1v8_codec";
521                                 regulator-state-mem {
522                                         regulator-off-in-suspend;
523                                 };
524                         };
525
526                         vcc_power_on: LDO_REG4 {
527                                 regulator-always-on;
528                                 regulator-boot-on;
529                                 regulator-min-microvolt = <3300000>;
530                                 regulator-max-microvolt = <3300000>;
531                                 regulator-name = "vcc_power_on";
532                                 regulator-state-mem {
533                                         regulator-on-in-suspend;
534                                         regulator-suspend-microvolt = <3300000>;
535                                 };
536                         };
537
538                         vcc_3v0: LDO_REG5 {
539                                 regulator-always-on;
540                                 regulator-boot-on;
541                                 regulator-min-microvolt = <3000000>;
542                                 regulator-max-microvolt = <3000000>;
543                                 regulator-name = "vcc_3v0";
544                                 regulator-state-mem {
545                                         regulator-on-in-suspend;
546                                         regulator-suspend-microvolt = <3000000>;
547                                 };
548                         };
549
550                         vcc_1v5: LDO_REG6 {
551                                 regulator-always-on;
552                                 regulator-boot-on;
553                                 regulator-min-microvolt = <1500000>;
554                                 regulator-max-microvolt = <1500000>;
555                                 regulator-name = "vcc_1v5";
556                                 regulator-state-mem {
557                                         regulator-on-in-suspend;
558                                         regulator-suspend-microvolt = <1500000>;
559                                 };
560                         };
561
562                         vcc1v8_dvp: LDO_REG7 {
563                                 regulator-always-on;
564                                 regulator-boot-on;
565                                 regulator-min-microvolt = <1800000>;
566                                 regulator-max-microvolt = <1800000>;
567                                 regulator-name = "vcc1v8_dvp";
568                                 regulator-state-mem {
569                                         regulator-off-in-suspend;
570                                 };
571                         };
572
573                         vcc3v3_s3: LDO_REG8 {
574                                 regulator-always-on;
575                                 regulator-boot-on;
576                                 regulator-min-microvolt = <3300000>;
577                                 regulator-max-microvolt = <3300000>;
578                                 regulator-name = "vcc3v3_s3";
579                                 regulator-state-mem {
580                                         regulator-off-in-suspend;
581                                 };
582                         };
583
584                         vcc_sd: LDO_REG9 {
585                                 regulator-always-on;
586                                 regulator-boot-on;
587                                 regulator-min-microvolt = <1800000>;
588                                 regulator-max-microvolt = <3300000>;
589                                 regulator-name = "vcc_sd";
590                                 regulator-state-mem {
591                                         regulator-on-in-suspend;
592                                         regulator-suspend-microvolt = <3300000>;
593                                 };
594                         };
595
596                         vcc3v3_s0: SWITCH_REG {
597                                 regulator-always-on;
598                                 regulator-boot-on;
599                                 regulator-name = "vcc3v3_s0";
600                                 regulator-state-mem {
601                                         regulator-on-in-suspend;
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 &isp0 {
751         status = "okay";
752 };
753
754 &isp1 {
755         status = "okay";
756 };
757
758 &cpu_l0 {
759         cpu-supply = <&vdd_cpu_l>;
760 };
761
762 &cpu_l1 {
763         cpu-supply = <&vdd_cpu_l>;
764 };
765
766 &cpu_l2 {
767         cpu-supply = <&vdd_cpu_l>;
768 };
769
770 &cpu_l3 {
771         cpu-supply = <&vdd_cpu_l>;
772 };
773
774 &cpu_b0 {
775         cpu-supply = <&vdd_cpu_b>;
776 };
777
778 &cpu_b1 {
779         cpu-supply = <&vdd_cpu_b>;
780 };
781
782 &gpu {
783         status = "okay";
784         mali-supply = <&vdd_gpu>;
785 };
786
787 &rga {
788         status = "okay";
789 };
790
791 &spi1 {
792         status = "disabled";
793         max-freq = <50000000>;
794         mpu6500@0 {
795                 status = "disabled";
796                 compatible = "inv-spi,mpu6500";
797                 pinctrl-names = "default";
798                 pinctrl-0 = <&mpu6500_irq_gpio>;
799                 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
800                 reg = <0>;
801                 spi-max-frequency = <1000000>;
802                 spi-cpha;
803                 spi-cpol;
804                 mpu-int_config = <0x00>;
805                 mpu-level_shifter = <0>;
806                 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
807                 orientation-x= <1>;
808                 orientation-y= <0>;
809                 orientation-z= <1>;
810                 support-hw-poweroff = <1>;
811                 mpu-debug = <1>;
812         };
813 };
814
815 &tcphy0 {
816         extcon = <&fusb0>;
817         status = "okay";
818 };
819
820 &tsadc {
821         rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
822         rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
823         status = "okay";
824 };
825
826 &u2phy0 {
827         status = "okay";
828         extcon = <&fusb0>;
829
830         u2phy0_otg: otg-port {
831                 status = "okay";
832         };
833
834         u2phy0_host: host-port {
835                 phy-supply = <&vcc5v0_host>;
836                 status = "okay";
837         };
838 };
839
840 &uart0 {
841         pinctrl-names = "default";
842         pinctrl-0 = <&uart0_xfer &uart0_cts>;
843         status = "okay";
844 };
845
846 &uart2 {
847         status = "okay";
848 };
849
850 &usb_host0_ehci {
851         status = "okay";
852 };
853
854 &usb_host0_ohci {
855         status = "okay";
856 };
857
858 &usbdrd3_0 {
859         extcon = <&fusb0>;
860         status = "okay";
861 };
862
863 &usbdrd_dwc3_0 {
864         status = "okay";
865 };
866
867 &vop0_pwm {
868         assigned-clocks = <&cru SCLK_VOP0_PWM>;
869         assigned-clock-rates = <50000000>;
870         status = "okay";
871 };
872
873 &pwm2 {
874         status = "okay";
875 };
876
877 &saradc {
878         status = "okay";
879 };
880
881 &pinctrl {
882         sdio-pwrseq {
883                 wifi_enable_h: wifi-enable-h {
884                         rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
885                 };
886         };
887
888         wireless-bluetooth {
889                 uart0_gpios: uart0-gpios {
890                         rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
891                 };
892         };
893
894         pmic {
895                 pmic_int_l: pmic-int-l {
896                         rockchip,pins =
897                                 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
898                 };
899
900                 pmic_dvs2: pmic-dvs2 {
901                         rockchip,pins =
902                                 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
903                 };
904                 vsel1_gpio: vsel1-gpio {
905                         rockchip,pins =
906                                 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
907                 };
908                 vsel2_gpio: vsel2-gpio {
909                         rockchip,pins =
910                                 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
911                 };
912         };
913
914         hallsensor {
915                 mh248_irq_gpio: mh248-irq-gpio {
916                         rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>;
917                 };
918         };
919
920         headphone {
921                 hp_det: hp-det {
922                         rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_up>;
923                 };
924         };
925
926         lcdpwr-enable {
927                 lcdpwr_enable_h: lcdpwr-enable-h {
928                         rockchip,pins = <3 8 RK_FUNC_GPIO &pcfg_pull_up>;
929                 };
930         };
931
932         lsm330_a {
933                 lsm330a_irq_gpio: lsm330a-irq-gpio {
934                         rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
935                 };
936         };
937
938         lsm330_g {
939                 lsm330g_irq_gpio: lsm330g-irq-gpio {
940                         rockchip,pins = <1 20 RK_FUNC_GPIO &pcfg_pull_none>;
941                 };
942         };
943
944         mpu6500 {
945                 mpu6500_irq_gpio: mpu6500-irq-gpio {
946                         rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
947                 };
948         };
949
950         ak8963 {
951                 ak8963_irq_gpio: ak8963-irq-gpio {
952                         rockchip,pins = <2 28 RK_FUNC_GPIO &pcfg_pull_none>;
953                 };
954         };
955
956         cm3218 {
957                 cm3218_irq_gpio: cm3218-irq-gpio {
958                         rockchip,pins = <4 24 RK_FUNC_GPIO &pcfg_pull_up>;
959                 };
960         };
961
962         usb2 {
963                 host_vbus_drv: host-vbus-drv {
964                         rockchip,pins =
965                                 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
966                 };
967         };
968
969         fusb30x {
970                 fusb0_int: fusb0-int {
971                         rockchip,pins =
972                                 <1 1 RK_FUNC_GPIO &pcfg_pull_up>;
973                 };
974         };
975 };
976
977 &rk_screen {
978         #include <dt-bindings/display/screen-timing/lcd-LP097Qx2.dtsi>
979 };
980
981 &cdn_dp_sound {
982         status = "okay";
983 };
984
985 &cdn_dp_fb {
986         status = "okay";
987         extcon = <&fusb0>;
988         phys = <&tcphy0_dp>;
989         dp_vop_sel = <DISPLAY_SOURCE_LCDC1>;
990 };
991
992 &vopb_rk_fb {
993         status = "okay";
994         rockchip,cabc_mode = <1>;
995         power_ctr: power_ctr {
996                 rockchip,debug = <0>;
997
998                 lcd_en: lcd-en {
999                         rockchip,power_type = <GPIO>;
1000                         pinctrl-names = "default";
1001                         pinctrl-0 = <&lcdpwr_enable_h>;
1002                         gpios = <&gpio3 8 GPIO_ACTIVE_HIGH>;
1003                         rockchip,delay = <10>;
1004                 };
1005         };
1006 };
1007
1008 &vopl_rk_fb {
1009         status = "okay";
1010 };
1011
1012 &edp_rk_fb {
1013         status = "okay";
1014 };
1015
1016 &pvtm {
1017         status = "okay";
1018 };
1019
1020 &pmu_pvtm {
1021         status = "okay";
1022 };