ARM64: dts: rk3399-tve1205g: host state notify ec module through gpio
[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                 hid-support-wakeup;
673         };
674
675         ec_battery@76 {
676                 compatible = "rockchip,ec-battery";
677                 reg = <0x76>;
678                 virtual_power = <0>;
679                 monitor_sec = <5>;
680                 ec-notify-gpios = <&gpio1 GPIO_C4 GPIO_ACTIVE_HIGH>;
681         };
682 };
683
684 &i2c2 {
685         status = "okay";
686         i2c-scl-rising-time-ns = <345>;
687         i2c-scl-falling-time-ns = <11>;
688         clock-frequency = <400000>;
689
690         touchpad: touchpad@2c {
691                 compatible = "hid-over-i2c";
692                 interrupt-parent = <&gpio1>;
693                 interrupts = <GPIO_C2 IRQ_TYPE_LEVEL_LOW>;
694                 pinctrl-names = "default";
695                 pinctrl-0 = <&touchpad_irq_gpio>;
696                 reg = <0x2c>;
697                 hid-descr-addr = <0x002c>;
698         };
699 };
700
701 &i2c4 {
702         status = "okay";
703         clock-frequency = <100000>;
704         bq25700: bq25700@09 {//6a
705                 compatible = "ti,bq25700";
706                 reg = <0x09>;
707                 extcon = <&fusb0>, <&fusb1>;
708
709                 interrupt-parent = <&gpio1>;
710                 interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
711                 pinctrl-names = "default";
712                 pinctrl-0 = <&charger_ok>;
713                 ti,charge-current = <2500000>;
714                 ti,max-input-voltage = <20000000>;
715                 ti,max-input-current = <6000000>;
716                 ti,max-charge-voltage = <8750000>;
717                 ti,input-current = <500000>;
718                 ti,input-current-sdp = <500000>;
719                 ti,input-current-dcp = <2000000>;
720                 ti,input-current-cdp = <2000000>;
721                 ti,minimum-sys-voltage = <7400000>;
722                 ti,otg-voltage = <5000000>;
723                 ti,otg-current = <500000>;
724                 pd-charge-only = <1>;
725                 typec0-enable-gpios = <&gpio1 GPIO_A3 GPIO_ACTIVE_HIGH>;
726                 typec1-enable-gpios = <&gpio1 GPIO_A4 GPIO_ACTIVE_HIGH>;
727                 typec0-discharge-gpios = <&gpio0 GPIO_B4 GPIO_ACTIVE_HIGH>;
728                 typec1-discharge-gpios = <&gpio0 GPIO_B5 GPIO_ACTIVE_HIGH>;
729         };
730 };
731
732 &i2c6 {
733         status = "okay";
734         i2c-scl-rising-time-ns = <345>;
735         i2c-scl-falling-time-ns = <11>;
736         clock-frequency = <400000>;
737
738         fusb1: fusb30x@22 {
739                 compatible = "fairchild,fusb302";
740                 reg = <0x22>;
741                 pinctrl-names = "default";
742                 pinctrl-0 = <&fusb1_int>;
743                 vbus-5v-gpios = <&gpio4 GPIO_D6 GPIO_ACTIVE_LOW>;
744                 int-n-gpios = <&gpio1 GPIO_B5 GPIO_ACTIVE_HIGH>;
745                 charge-dev = <&bq25700>;
746                 status = "okay";
747         };
748 };
749
750 &i2c7 {
751         status = "okay";
752         i2c-scl-rising-time-ns = <345>;
753         i2c-scl-falling-time-ns = <11>;
754         clock-frequency = <400000>;
755
756         fusb0: fusb30x@22 {
757                 compatible = "fairchild,fusb302";
758                 reg = <0x22>;
759                 pinctrl-names = "default";
760                 pinctrl-0 = <&fusb0_int>;
761                 vbus-5v-gpios = <&gpio4 GPIO_D5 GPIO_ACTIVE_LOW>;
762                 int-n-gpios = <&gpio1 GPIO_A2 GPIO_ACTIVE_HIGH>;
763                 charge-dev = <&bq25700>;
764                 status = "okay";
765         };
766 };
767
768 &io_domains {
769         status = "okay";
770         bt656-supply = <&vcc_3v0>;
771         audio-supply = <&vcca1v8_codec>;
772         sdmmc-supply = <&vcc_sd>;
773         gpio1830-supply = <&vcc_3v0>;
774 };
775
776 &mipi_dsi {
777         status = "disabled";
778 };
779
780 &pmu_io_domains {
781         status = "okay";
782         pmu1830-supply = <&vcc_1v8>;
783 };
784
785 &pwm0 {
786         status = "okay";
787 };
788
789 &pwm2 {
790         status = "okay";
791 };
792
793 &rkvdec {
794         status = "okay";
795 };
796
797 &route_edp {
798         status = "okay";
799         logo,mode = "center";
800 };
801
802 &rga {
803         status = "okay";
804 };
805
806 &saradc {
807         status = "okay";
808 };
809
810 &sdmmc {
811         clock-frequency = <50000000>;
812         clock-freq-min-max = <400000 150000000>;
813         supports-sd;
814         bus-width = <4>;
815         cap-mmc-highspeed;
816         cap-sd-highspeed;
817         disable-wp;
818         num-slots = <1>;
819         //sd-uhs-sdr104;
820         vqmmc-supply = <&vcc_sd>;
821         pinctrl-names = "default";
822         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
823         status = "okay";
824 };
825
826 &sdio0 {
827         clock-frequency = <150000000>;
828         clock-freq-min-max = <200000 150000000>;
829         supports-sdio;
830         bus-width = <4>;
831         disable-wp;
832         cap-sd-highspeed;
833         cap-sdio-irq;
834         keep-power-in-suspend;
835         mmc-pwrseq = <&sdio_pwrseq>;
836         non-removable;
837         num-slots = <1>;
838         pinctrl-names = "default";
839         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
840         sd-uhs-sdr104;
841         status = "okay";
842 };
843
844 &sdhci {
845         bus-width = <8>;
846         mmc-hs400-1_8v;
847         supports-emmc;
848         non-removable;
849         keep-power-in-suspend;
850         mmc-hs400-enhanced-strobe;
851         status = "okay";
852 };
853
854 &spdif {
855         status = "okay";
856         #sound-dai-cells = <0>;
857 };
858
859 &spi1 {
860         status = "disabled";
861 };
862
863 &tcphy0 {
864         extcon = <&fusb0>;
865         status = "okay";
866 };
867
868 &tcphy1 {
869         extcon = <&fusb1>;
870         status = "okay";
871 };
872
873 &tsadc {
874         rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
875         rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
876         status = "okay";
877 };
878
879 &u2phy0 {
880         status = "okay";
881         extcon = <&fusb0>;
882
883         u2phy0_otg: otg-port {
884                 status = "okay";
885         };
886
887         u2phy0_host: host-port {
888                 phy-supply = <&vcc5v0_host>;
889                 status = "okay";
890         };
891 };
892
893 &u2phy1 {
894         status = "okay";
895         extcon = <&fusb1>;
896
897         u2phy1_otg: otg-port {
898                 status = "okay";
899         };
900
901         u2phy1_host: host-port {
902                 phy-supply = <&vcc5v0_host>;
903                 status = "okay";
904         };
905 };
906
907 &uart0 {
908         pinctrl-names = "default";
909         pinctrl-0 = <&uart0_xfer &uart0_cts>;
910         status = "okay";
911 };
912
913 &uart2 {
914         status = "okay";
915 };
916
917 &usb_host0_ehci {
918         status = "okay";
919 };
920
921 &usb_host0_ohci {
922         status = "okay";
923 };
924
925 &usbdrd3_0 {
926         extcon = <&fusb0>;
927         status = "okay";
928 };
929
930 &usbdrd_dwc3_0 {
931         status = "okay";
932 };
933
934 &usb_host1_ehci {
935         status = "okay";
936 };
937
938 &usb_host1_ohci {
939         status = "okay";
940 };
941
942 &usbdrd3_1 {
943         extcon = <&fusb1>;
944         status = "okay";
945 };
946
947 &usbdrd_dwc3_1 {
948         status = "okay";
949 };
950
951 &vpu {
952         status = "okay";
953 };
954
955 &pinctrl {
956         sdio-pwrseq {
957                 wifi_enable_h: wifi-enable-h {
958                         rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
959                 };
960         };
961
962         wireless-bluetooth {
963                 uart0_gpios: uart0-gpios {
964                         rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
965                 };
966         };
967
968         pmic {
969                 pmic_int_l: pmic-int-l {
970                         rockchip,pins =
971                                 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
972                 };
973                 vsel1_gpio: vsel1-gpio {
974                         rockchip,pins =
975                                 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
976                 };
977                 vsel2_gpio: vsel2-gpio {
978                         rockchip,pins =
979                                 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
980                 };
981         };
982
983         headphone {
984                 hp_det: hp-det {
985                         rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_up>;
986                 };
987         };
988
989         hallsensor {
990                 mh248_irq_gpio: mh248-irq-gpio {
991                         rockchip,pins = <0 GPIO_A2 RK_FUNC_GPIO &pcfg_pull_up>;
992                 };
993         };
994
995         hidkey {
996                 hidkey_irq_gpio: hidkey-irq-gpio {
997                         rockchip,pins = <0 GPIO_B0 RK_FUNC_GPIO &pcfg_pull_up>;
998                 };
999         };
1000
1001         touchpad {
1002                 touchpad_irq_gpio: touchpad-irq-gpio {
1003                         rockchip,pins = <1 GPIO_C2 RK_FUNC_GPIO &pcfg_pull_up>;
1004                 };
1005         };
1006
1007         charger {
1008                 charger_ok: charge-ok {
1009                         rockchip,pins =
1010                                 <1 23 RK_FUNC_GPIO &pcfg_pull_up>;
1011                 };
1012         };
1013
1014         gpio-leds {
1015                 leds_gpio: leds-gpio {
1016                         rockchip,pins =
1017                                 <1 GPIO_C6 RK_FUNC_GPIO &pcfg_pull_up>,
1018                                 <1 GPIO_D0 RK_FUNC_GPIO &pcfg_pull_up>,
1019                                 <3 GPIO_A5 RK_FUNC_GPIO &pcfg_pull_up>,
1020                                 <3 GPIO_B1 RK_FUNC_GPIO &pcfg_pull_up>,
1021                                 <2 GPIO_D3 RK_FUNC_GPIO &pcfg_pull_up>,
1022                                 <2 GPIO_D4 RK_FUNC_GPIO &pcfg_pull_up>,
1023                                 <4 GPIO_D2 RK_FUNC_GPIO &pcfg_pull_up>;
1024                 };
1025         };
1026
1027         usb2 {
1028                 host_vbus_drv: host-vbus-drv {
1029                         rockchip,pins =
1030                                 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
1031                 };
1032         };
1033
1034         fusb30x {
1035                 fusb0_int: fusb0-int {
1036                         rockchip,pins =
1037                                 <1 GPIO_A2 RK_FUNC_GPIO &pcfg_pull_up>;
1038                 };
1039                 fusb1_int: fusb1-int {
1040                         rockchip,pins =
1041                                 <1 GPIO_B5 RK_FUNC_GPIO &pcfg_pull_up>;
1042                 };
1043         };
1044 };