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