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