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