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