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