ARM64: DTS: Fix Firefly board audio driver
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3399-firefly-mini-linux.dts
1 /*
2  * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd
3  *
4  * This file is dual-licensed: you can use it either under the terms
5  * of the GPL or the X11 license, at your option. Note that this dual
6  * licensing only applies to this file, and not this project as a
7  * whole.
8  *
9  *  a) This file is free software; you can redistribute it and/or
10  *     modify it under the terms of the GNU General Public License as
11  *     published by the Free Software Foundation; either version 2 of the
12  *     License, or (at your option) any later version.
13  *
14  *     This file is distributed in the hope that it will be useful,
15  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *     GNU General Public License for more details.
18  *
19  * Or, alternatively,
20  *
21  *  b) Permission is hereby granted, free of charge, to any person
22  *     obtaining a copy of this software and associated documentation
23  *     files (the "Software"), to deal in the Software without
24  *     restriction, including without limitation the rights to use,
25  *     copy, modify, merge, publish, distribute, sublicense, and/or
26  *     sell copies of the Software, and to permit persons to whom the
27  *     Software is furnished to do so, subject to the following
28  *     conditions:
29  *
30  *     The above copyright notice and this permission notice shall be
31  *     included in all copies or substantial portions of the Software.
32  *
33  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40  *     OTHER DEALINGS IN THE SOFTWARE.
41  */
42
43 /dts-v1/;
44
45 #include "dt-bindings/pwm/pwm.h"
46 #include "rk3399.dtsi"
47 #include "rk3399-opp.dtsi"
48 #include "rk3399-linux.dtsi"
49 #include <dt-bindings/input/input.h>
50
51 / {
52         model = "Rockchip RK3399 Firefly Board (Linux Opensource)";
53         compatible = "rockchip,rk3399-firefly-mini-linux", "rockchip,rk3399";
54
55         backlight: backlight {
56                 status = "disabled";
57                 compatible = "pwm-backlight";
58                 pwms = <&pwm0 0 25000 0>;
59                 brightness-levels = <
60                           0   1   2   3   4   5   6   7
61                           8   9  10  11  12  13  14  15
62                          16  17  18  19  20  21  22  23
63                          24  25  26  27  28  29  30  31
64                          32  33  34  35  36  37  38  39
65                          40  41  42  43  44  45  46  47
66                          48  49  50  51  52  53  54  55
67                          56  57  58  59  60  61  62  63
68                          64  65  66  67  68  69  70  71
69                          72  73  74  75  76  77  78  79
70                          80  81  82  83  84  85  86  87
71                          88  89  90  91  92  93  94  95
72                          96  97  98  99 100 101 102 103
73                         104 105 106 107 108 109 110 111
74                         112 113 114 115 116 117 118 119
75                         120 121 122 123 124 125 126 127
76                         128 129 130 131 132 133 134 135
77                         136 137 138 139 140 141 142 143
78                         144 145 146 147 148 149 150 151
79                         152 153 154 155 156 157 158 159
80                         160 161 162 163 164 165 166 167
81                         168 169 170 171 172 173 174 175
82                         176 177 178 179 180 181 182 183
83                         184 185 186 187 188 189 190 191
84                         192 193 194 195 196 197 198 199
85                         200 201 202 203 204 205 206 207
86                         208 209 210 211 212 213 214 215
87                         216 217 218 219 220 221 222 223
88                         224 225 226 227 228 229 230 231
89                         232 233 234 235 236 237 238 239
90                         240 241 242 243 244 245 246 247
91                         248 249 250 251 252 253 254 255>;
92                 default-brightness-level = <200>;
93         };
94
95         clkin_gmac: external-gmac-clock {
96                 compatible = "fixed-clock";
97                 clock-frequency = <125000000>;
98                 clock-output-names = "clkin_gmac";
99                 #clock-cells = <0>;
100         };
101
102         dw_hdmi_audio: dw-hdmi-audio {
103                 status = "disabled";
104                 compatible = "rockchip,dw-hdmi-audio";
105                 #sound-dai-cells = <0>;
106         };
107
108         edp_panel: edp-panel {  
109                 status = "disabled";
110                 compatible = "sharp,lcd-f402", "panel-simple";
111                 backlight = <&backlight>;
112                 power-supply = <&vcc_lcd>;
113                 enable-gpios = <&gpio4 29 GPIO_ACTIVE_HIGH>;
114                 pinctrl-names = "default";
115                 pinctrl-0 = <&lcd_panel_reset>;
116
117                 ports {
118                         panel_in_edp: endpoint {
119                                 remote-endpoint = <&edp_out_panel>;
120                         };
121                 };
122         };
123
124         fiq_debugger: fiq-debugger {     
125                 compatible = "rockchip,fiq-debugger";
126                 rockchip,serial-id = <2>;
127                 rockchip,signal-irq = <182>;
128                 rockchip,wake-irq = <0>;
129                 rockchip,irq-mode-enable = <1>;  /* If enable uart uses irq instead of fiq */
130                 rockchip,baudrate = <1500000>;  /* Only 115200 and 1500000 */
131                 pinctrl-names = "default";
132                 pinctrl-0 = <&uart2c_xfer>;
133         };
134
135         gpio-keys {
136                 compatible = "gpio-keys";
137                 #address-cells = <1>;
138                 #size-cells = <0>;
139                 autorepeat;
140
141                 pinctrl-names = "default";
142                 pinctrl-0 = <&pwrbtn>;
143
144                 button@0 {
145                         gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
146                         linux,code = <KEY_POWER>;
147                         label = "GPIO Key Power";
148                         linux,input-type = <1>;
149                         gpio-key,wakeup = <1>;
150                         debounce-interval = <100>;
151                 };
152         };
153
154         rt5640-sound {
155                 status = "disabled";
156                 compatible = "simple-audio-card";
157                 simple-audio-card,format = "i2s";
158                 simple-audio-card,name = "rockchip,rt5640-codec";
159                 simple-audio-card,mclk-fs = <256>;
160                 simple-audio-card,widgets =
161                         "Microphone", "Mic Jack",
162                         "Headphone", "Headphone Jack";
163                 simple-audio-card,routing =
164                         "Mic Jack", "MICBIAS1",
165                         "IN1P", "Mic Jack",
166                         "Headphone Jack", "HPOL",
167                         "Headphone Jack", "HPOR";
168                 simple-audio-card,cpu {
169                         sound-dai = <&i2s1>;
170                 };
171                 simple-audio-card,codec {
172                         sound-dai = <&rt5640>;
173                 };
174         };
175
176         es8323-sound {
177                 compatible = "simple-audio-card";
178                 simple-audio-card,format = "i2s";
179                 simple-audio-card,name = "rockchip,es8323-codec";
180                 simple-audio-card,mclk-fs = <256>;
181                 simple-audio-card,widgets = 
182                                 "Microphone","Mic Jack",
183                                 "Headphone","Headphone Jack";
184                 simple-audio-card,routing = 
185                                 "Mic Jack","MICBIAS1",
186                                 "IN1P","Mic Jack",
187                                 "Headphone Jack","HPOL",
188                                 "Headphone Jack","HPOR";
189                 simple-audio-card,cpu {
190                                 sound-dai = <&i2s1>;
191                 };
192                 simple-audio-card,codec {
193                                 sound-dai = <&es8323>;
194                 };
195
196         };
197
198         hdmi_sound: hdmi-sound {
199                 status = "disabled";
200                 compatible = "simple-audio-card";
201                 simple-audio-card,format = "i2s";
202                 simple-audio-card,mclk-fs = <256>;
203                 simple-audio-card,name = "rockchip,hdmi";
204
205                 simple-audio-card,cpu {
206                         sound-dai = <&i2s2>;
207                 };
208                 simple-audio-card,codec {
209                         sound-dai = <&dw_hdmi_audio>;
210                 };
211         };
212
213         hdmi_codec: hdmi-codec {
214                 compatible = "simple-audio-card";
215                 simple-audio-card,format = "i2s";
216                 simple-audio-card,mclk-fs = <256>;
217                 simple-audio-card,name = "HDMI-CODEC";
218
219                 simple-audio-card,cpu {
220                         sound-dai = <&i2s2>;
221                 };
222
223                 simple-audio-card,codec {
224                         sound-dai = <&hdmi>;
225                 };
226         };
227
228         sdio_pwrseq: sdio-pwrseq {
229                 compatible = "mmc-pwrseq-simple";
230                 clocks = <&rk808 1>;
231                 clock-names = "ext_clock";
232                 pinctrl-names = "default";
233                 pinctrl-0 = <&wifi_enable_h>;
234
235                 /*
236                  * On the module itself this is one of these (depending
237                  * on the actual card populated):
238                  * - SDIO_RESET_L_WL_REG_ON
239                  * - PDN (power down when low)
240                  */
241                 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
242         };
243
244         vcc3v3_pcie: vcc3v3-pcie-regulator {
245                 status = "disabled";
246                 compatible = "regulator-fixed";
247                 enable-active-high;
248                 regulator-always-on;
249                 regulator-boot-on;
250                 gpio = <&gpio1 17 GPIO_ACTIVE_HIGH>;
251                 pinctrl-names = "default";
252                 pinctrl-0 = <&pcie_drv>;
253                 regulator-name = "vcc3v3_pcie";
254         };
255
256         vcc3v3_sys: vcc3v3-sys {
257                 compatible = "regulator-fixed";
258                 regulator-name = "vcc3v3_sys";
259                 regulator-always-on;
260                 regulator-boot-on;
261                 regulator-min-microvolt = <3300000>;
262                 regulator-max-microvolt = <3300000>;
263         };
264
265         vcc5v0_host: vcc5v0-host-regulator {
266                 compatible = "regulator-fixed";
267                 enable-active-high;
268                 gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>;
269                 pinctrl-names = "default";
270                 pinctrl-0 = <&host_vbus_drv>;
271                 regulator-name = "vcc5v0_host";
272                 regulator-always-on;
273         };
274
275         vbus_5v: vbus-5v-regulator {
276                 compatible = "regulator-fixed";
277                 enable-active-high;
278                 regulator-always-on;
279                 regulator-boot-on;
280                 gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>;
281                 pinctrl-names = "default";
282                 pinctrl-0 = <&vbus_5v_drv>;
283                 regulator-name = "vbus_5v";
284         };
285
286         vcc5v0_sys: vcc5v0-sys {
287                 compatible = "regulator-fixed";
288                 regulator-name = "vcc5v0_sys";
289                 regulator-always-on;
290                 regulator-boot-on;
291                 regulator-min-microvolt = <5000000>;
292                 regulator-max-microvolt = <5000000>;
293         };
294
295         vcc_phy: vcc-phy-regulator {
296                 compatible = "regulator-fixed";
297                 regulator-name = "vcc_phy";
298                 regulator-always-on;
299                 regulator-boot-on;
300         };
301
302         vdd_log: vdd-log {
303                 compatible = "pwm-regulator";
304                 pwms = <&pwm2 0 25000 1>;
305                 regulator-name = "vdd_log";
306                 regulator-min-microvolt = <800000>;
307                 regulator-max-microvolt = <1400000>;
308                 regulator-always-on;
309                 regulator-boot-on;
310
311                 /* for rockchip boot on */
312                 rockchip,pwm_id= <2>;
313                 rockchip,pwm_voltage = <1000000>;
314         };
315
316         vccadc_ref: vccadc-ref {
317                 compatible = "regulator-fixed";
318                 regulator-name = "vcc1v8_sys";
319                 regulator-always-on;
320                 regulator-boot-on;
321                 regulator-min-microvolt = <1800000>;
322                 regulator-max-microvolt = <1800000>;
323         };
324
325         vcc_lcd: vcc-lcd-regulator {
326                 compatible = "regulator-fixed";
327                 regulator-always-on;
328                 regulator-boot-on;
329                 enable-active-high;
330                 gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>;
331                 pinctrl-names = "default";
332                 pinctrl-0 = <&lcd_en>;
333                 regulator-name = "vcc_lcd";
334         };
335
336         wireless-wlan {
337                 compatible = "wlan-platdata";
338                 rockchip,grf = <&grf>;
339                 wifi_chip_type = "ap6212";
340                 sdio_vref = <1800>;
341                 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
342                 status = "okay";
343         };
344
345         wireless-bluetooth {
346                 compatible = "bluetooth-platdata";
347                 //wifi-bt-power-toggle;
348                 clocks = <&rk808 1>;
349         clock-names = "ext_clock";
350                 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
351                 pinctrl-names = "default", "rts_gpio";
352                 pinctrl-0 = <&uart0_rts>;
353                 pinctrl-1 = <&uart0_gpios>;
354                 //BT,power_gpio  = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */
355                 BT,reset_gpio    = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
356                 BT,wake_gpio     = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
357                 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
358                 status = "okay";
359         };
360
361     leds {
362        compatible = "gpio-leds";
363        power {
364            label = "firefly:blue:power";
365            linux,default-trigger = "ir-power-click";
366            default-state = "on";
367            gpios = <&gpio2 27 GPIO_ACTIVE_HIGH>;
368            pinctrl-names = "default";
369            pinctrl-0 = <&led_power>;
370        };
371        user {
372            label = "firefly:yellow:user";
373            linux,default-trigger = "ir-user-click";
374            default-state = "off";
375            gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
376            pinctrl-names = "default";
377            pinctrl-0 = <&led_user>;
378        };
379    };
380 };
381
382 &cpu_l0 {
383         cpu-supply = <&vdd_cpu_l>;
384 };
385
386 &cpu_l1 {
387         cpu-supply = <&vdd_cpu_l>;
388 };
389
390 &cpu_l2 {
391         cpu-supply = <&vdd_cpu_l>;
392 };
393
394 &cpu_l3 {
395         cpu-supply = <&vdd_cpu_l>;
396 };
397
398 &cpu_b0 {
399         cpu-supply = <&vdd_cpu_b>;
400 };
401
402 &cpu_b1 {
403         cpu-supply = <&vdd_cpu_b>;
404 };
405
406 &display_subsystem {
407         status = "okay";
408 };
409
410 &edp {  
411         status = "disabled";
412
413         ports {
414                 edp_out: port@1 {
415                         reg = <1>;
416                         #address-cells = <1>;
417                         #size-cells = <0>;
418
419                         edp_out_panel: endpoint@0 {
420                                 reg = <0>;
421                                 remote-endpoint = <&panel_in_edp>;
422                         };
423                 };
424         };
425 };
426
427 &emmc_phy {
428         status = "okay";
429 };
430
431 &gmac {
432         phy-supply = <&vcc_phy>;
433         phy-mode = "rgmii";
434         clock_in_out = "input";
435         snps,reset-gpio = <&gpio3 15 GPIO_ACTIVE_LOW>;
436         snps,reset-active-low;
437         snps,reset-delays-us = <0 10000 50000>;
438         assigned-clocks = <&cru SCLK_RMII_SRC>;
439         assigned-clock-parents = <&clkin_gmac>;
440         pinctrl-names = "default";
441         pinctrl-0 = <&rgmii_pins>;
442         tx_delay = <0x28>;
443         rx_delay = <0x11>;
444         status = "okay";
445 };
446
447 &gpu {
448         status = "okay";
449         mali-supply = <&vdd_gpu>;
450 };
451
452 &hdmi {
453         #address-cells = <1>;
454         #size-cells = <0>;
455         #sound-dai-cells = <0>;
456         status = "okay";
457 };
458
459 &i2c0 {
460         status = "okay";
461         i2c-scl-rising-time-ns = <168>;
462         i2c-scl-falling-time-ns = <4>;
463         clock-frequency = <400000>;
464
465         vdd_cpu_b: syr827@40 {
466                 compatible = "silergy,syr827";
467                 reg = <0x40>;
468                 vin-supply = <&vcc5v0_sys>;
469                 regulator-compatible = "fan53555-reg";
470                 regulator-name = "vdd_cpu_b";
471                 regulator-min-microvolt = <712500>;
472                 regulator-max-microvolt = <1500000>;
473                 regulator-ramp-delay = <1000>;
474                 vsel-gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>;
475                 fcs,suspend-voltage-selector = <1>;
476                 regulator-always-on;
477                 regulator-boot-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                 reg = <0x41>;
487                 vin-supply = <&vcc5v0_sys>;
488                 regulator-compatible = "fan53555-reg";
489                 regulator-name = "vdd_gpu";
490                 regulator-min-microvolt = <712500>;
491                 regulator-max-microvolt = <1500000>;
492                 regulator-ramp-delay = <1000>;
493                 fcs,suspend-voltage-selector = <1>;
494                 regulator-always-on;
495                 regulator-boot-on;
496                 regulator-initial-state = <3>;
497                         regulator-state-mem {
498                         regulator-off-in-suspend;
499                 };
500         };
501
502         rk808: pmic@1b {
503                 compatible = "rockchip,rk808";
504                 reg = <0x1b>;
505                 interrupt-parent = <&gpio1>;
506                 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
507                 pinctrl-names = "default";
508                 pinctrl-0 = <&pmic_int_l &pmic_dvs2>;
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                         vcc2v8_dvp: LDO_REG2 {
585                                 //regulator-always-on;
586                                 //regulator-boot-on;
587                                 regulator-min-microvolt = <2800000>;
588                                 regulator-max-microvolt = <2800000>;
589                                 regulator-name = "vcc2v8_dvp";
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-off-in-suspend;
627                                 };
628                         };
629
630                         vcc_1v5: LDO_REG6 {
631                                 regulator-always-on;
632                                 regulator-boot-on;
633                                 regulator-min-microvolt = <1500000>;
634                                 regulator-max-microvolt = <1500000>;
635                                 regulator-name = "vcc_1v5";
636                                 regulator-state-mem {
637                                         regulator-on-in-suspend;
638                                         regulator-suspend-microvolt = <1500000>;
639                                 };
640                         };
641
642                         vcca1v8_codec: LDO_REG7 {
643                                 regulator-always-on;
644                                 regulator-boot-on;
645                                 regulator-min-microvolt = <1800000>;
646                                 regulator-max-microvolt = <1800000>;
647                                 regulator-name = "vcca1v8_codec";
648                                 regulator-state-mem {
649                                         regulator-off-in-suspend;
650                                 };
651                         };
652
653                         vcc_3v0: LDO_REG8 {
654                                 regulator-always-on;
655                                 regulator-boot-on;
656                                 regulator-min-microvolt = <3000000>;
657                                 regulator-max-microvolt = <3000000>;
658                                 regulator-name = "vcc_3v0";
659                                 regulator-state-mem {
660                                         regulator-on-in-suspend;
661                                         regulator-suspend-microvolt = <3000000>;
662                                 };
663                         };
664
665                         vcc3v3_s3: SWITCH_REG1 {
666                                 regulator-always-on;
667                                 regulator-boot-on;
668                                 regulator-name = "vcc3v3_s3";
669                                 regulator-state-mem {
670                                         regulator-off-in-suspend;
671                                 };
672                         };
673
674                         vcc3v3_s0: SWITCH_REG2 {
675                                 regulator-always-on;
676                                 regulator-boot-on;
677                                 regulator-name = "vcc3v3_s0";
678                                 regulator-state-mem {
679                                         regulator-off-in-suspend;
680                                 };
681                         };
682                 };
683         };
684 };
685
686 &i2c1 {
687         status = "okay";
688         i2c-scl-rising-time-ns = <300>;
689         i2c-scl-falling-time-ns = <15>;
690
691     es8323: es8323@10{
692                 compatible = "everest,es8323";
693                 reg = <0x10>;
694                 ear-con-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
695                 hp-det-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
696                 hp-mic-only = <1>;
697                 #sound-dai-cells = <0>;
698                 system-clock-frequency = <11289600>;
699                 clocks = <&cru SCLK_I2S_8CH_OUT>;
700                 clock-names = "mclk";
701                 pinctrl-names = "default";
702                 pinctrl-0 = <&es8323_earcon &es8323_hpdet>;
703         };
704         rt5640: rt5640@1c {
705                 status = "disabled";
706                 #sound-dai-cells = <0>;
707                 compatible = "realtek,rt5640";
708                 reg = <0x1c>;
709                 clocks = <&cru SCLK_I2S_8CH_OUT>;
710                 clock-names = "mclk";
711                 realtek,in1-differential;
712                 pinctrl-names = "default";
713                 pinctrl-0 = <&rt5640_hpcon>;
714                 hp-con-gpio = <&gpio4 21 GPIO_ACTIVE_HIGH>;
715                 //hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_LOW>;
716                 io-channels = <&saradc 4>;
717                 hp-det-adc-value = <500>;
718         };
719 };
720
721 &i2c3 { 
722         status = "okay";
723         i2c-scl-rising-time-ns = <450>;
724         i2c-scl-falling-time-ns = <15>;
725 };
726
727 &i2c4 {
728         status = "okay";
729         i2c-scl-rising-time-ns = <475>;
730         i2c-scl-falling-time-ns = <26>;
731
732         fusb0: fusb30x@22 {
733                 compatible = "fairchild,fusb302";
734                 reg = <0x22>;
735                 pinctrl-names = "default";
736                 pinctrl-0 = <&fusb0_int>;
737                 int-n-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
738                 vbus-5v-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
739                 status = "disabled";
740         };
741
742     gsl3680: gsl3680@41 {
743                         status = "disabled";
744                         compatible = "gslX680-pad";
745                         reg = <0x41>;
746                         screen_max_x = <1536>;
747                         screen_max_y = <2048>;
748                         touch-gpio = <&gpio1 20 IRQ_TYPE_LEVEL_LOW>;
749                         reset-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
750       };
751
752         mpu6050:mpu@68{
753                         status = "disabled";
754             compatible = "invensense,mpu6050";
755             reg = <0x68>;
756             mpu-int_config = <0x10>;
757             mpu-level_shifter = <0>;
758             mpu-orientation = <0 1 0 1 0 0 0 0 1>;
759             orientation-x= <1>;
760             orientation-y= <1>;
761             orientation-z= <1>;
762             irq-gpio = <&gpio1 4 IRQ_TYPE_LEVEL_LOW>;
763             mpu-debug = <1>;
764         };
765 };
766
767 &i2s0 {
768         status = "okay";
769         rockchip,i2s-broken-burst-len;
770         rockchip,playback-channels = <8>;
771         rockchip,capture-channels = <8>;
772         #sound-dai-cells = <0>;
773 };
774
775 &i2s1 {
776         status = "okay";
777         rockchip,i2s-broken-burst-len;
778         rockchip,playback-channels = <2>;
779         rockchip,capture-channels = <2>;
780         #sound-dai-cells = <0>;
781         assigned-clocks = <&cru SCLK_I2S1_DIV>, <&cru SCLK_I2S_8CH>;
782         assigned-clock-parents = <&cru PLL_GPLL>, <&cru SCLK_I2S1_8CH>;
783 };
784
785 &i2s2 {
786
787         #sound-dai-cells = <0>;
788         status = "okay";
789 };
790
791 &io_domains {
792         status = "okay";
793
794         bt656-supply = <&vcc_3v0>;              /* bt656_gpio2ab_ms */
795         audio-supply = <&vcca1v8_codec>;        /* audio_gpio3d4a_ms */
796         sdmmc-supply = <&vcc_sd>;               /* sdmmc_gpio4b_ms */
797         gpio1830-supply = <&vcc_3v0>;           /* gpio1833_gpio4cd_ms */
798 };
799
800 &pcie_phy {
801         status = "okay";
802 };
803
804 &pcie0 {
805         ep-gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>;
806         num-lanes = <4>;
807         pinctrl-names = "default";
808         pinctrl-0 = <&pcie_clkreqn_cpm>;
809         status = "okay";
810 };
811
812 &pmu_io_domains {
813         status = "okay";
814         pmu1830-supply = <&vcc_3v0>;
815 };
816
817 &pinctrl {
818         buttons {   
819                 pwrbtn: pwrbtn {
820                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
821                 };
822         };
823
824         lcd-panel {
825                 lcd_panel_reset: lcd-panel-reset {
826                         rockchip,pins = <4 29 RK_FUNC_GPIO &pcfg_pull_up>;
827                 };
828
829                 lcd_en: lcd-en {
830                         rockchip,pins = <1 1 RK_FUNC_GPIO &pcfg_pull_up>;
831                 };
832         };
833
834         pcie {  
835                 pcie_drv: pcie-drv {
836                         rockchip,pins =
837                                 <1 17 RK_FUNC_GPIO &pcfg_pull_none>;
838                         };
839                         pcie_3g_drv: pcie-3g-drv {
840                         rockchip,pins =
841                                 <0 2 RK_FUNC_GPIO &pcfg_pull_up>;
842                 };
843
844         };
845
846         pmic {
847                 vsel1_gpio: vsel1-gpio {
848                         rockchip,pins =
849                                 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
850                 };
851
852                 vsel2_gpio: vsel2-gpio {
853                         rockchip,pins =
854                         <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
855                 };
856         };
857
858         sdio-pwrseq {
859                 wifi_enable_h: wifi-enable-h {
860                         rockchip,pins =
861                                 <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
862                 };
863         };
864
865         wireless-bluetooth {
866                 uart0_gpios: uart0-gpios {
867                         rockchip,pins =
868                                 <2 19 RK_FUNC_GPIO &pcfg_pull_none>,
869                                 <0 9 RK_FUNC_GPIO &pcfg_pull_up>;
870                 };
871         };
872
873         leds {
874                 led_power: led-power {
875                         rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
876                 };
877
878                 led_user: led-user {
879                         rockchip,pins = <0 13 RK_FUNC_GPIO &pcfg_pull_none>;
880                 };
881         };
882
883         rt5640 {
884                 rt5640_hpcon: rt5640-hpcon {
885                         rockchip,pins = <4 21 RK_FUNC_GPIO &pcfg_pull_none>;
886                 };
887         };
888
889         es8223 {
890                 es8323_hpdet: es8323-hpdet {
891                         rockchip,pins = <0 11 RK_FUNC_GPIO &pcfg_pull_up>;
892                 };
893                 es8323_earcon: es8323-earcon {
894                         rockchip,pins = <0 12 RK_FUNC_GPIO &pcfg_pull_none>;
895                 };
896         };
897
898         pmic {
899                 pmic_int_l: pmic-int-l {
900                         rockchip,pins =
901                                 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
902                 };
903
904                 pmic_dvs2: pmic-dvs2 {
905                         rockchip,pins =
906                                 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
907                 };
908
909         };
910
911         usb2 {
912                 host_vbus_drv: host-vbus-drv {
913                         rockchip,pins =
914                                 <1 0 RK_FUNC_GPIO &pcfg_pull_none>;
915                 };
916         };
917
918
919         fusb30x {
920                 fusb0_int: fusb0-int {
921                         rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>;
922                 };
923         };
924
925         vbus {
926                 vbus_5v_drv: vbus-5v-drv {
927                         rockchip,pins = <1 3 RK_FUNC_GPIO &pcfg_pull_up>;
928                 };
929         };
930 };
931
932 &pwm0 {
933         status = "okay";
934 };
935
936 &pwm2 {
937         status = "okay";
938 };
939
940 &rkvdec {
941         status = "okay";
942 };
943
944 &rockchip_suspend { 
945         rockchip,power-ctrl =
946                 <&gpio1 18 GPIO_ACTIVE_LOW>,
947                 <&gpio1 14 GPIO_ACTIVE_HIGH>;
948 };
949
950 &route_edp {
951         status = "disabled";
952 };
953
954 &route_hdmi {
955         status = "okay";
956         logo,mode = "center";
957 };
958
959 &cdn_dp {
960         status = "disabled";
961         extcon = <&fusb0>;
962         phys = <&tcphy0_dp>;
963 };
964
965 &dp_in_vopb {
966         status = "disabled";
967 };
968
969 &saradc {
970         status = "okay";
971         vref-supply = <&vccadc_ref>;
972 };
973
974 &sdhci {
975         bus-width = <8>;
976         keep-power-in-suspend;
977         mmc-hs400-1_8v;
978         mmc-hs400-enhanced-strobe;
979         non-removable;
980         status = "okay";
981         supports-emmc;
982 };
983
984 &sdmmc {
985         max-frequency = <150000000>;
986         supports-sd;
987         bus-width = <4>;
988         cap-mmc-highspeed;
989         cap-sd-highspeed;
990         disable-wp;
991         num-slots = <1>;
992         vqmmc-supply = <&vcc_sd>;
993         pinctrl-names = "default";
994         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
995         status = "okay";
996 };
997
998 &sdio0 {
999         max-frequency = <50000000>;
1000         supports-sdio;
1001         bus-width = <4>;
1002         disable-wp;
1003         cap-sd-highspeed;
1004         keep-power-in-suspend;
1005         mmc-pwrseq = <&sdio_pwrseq>;
1006         non-removable;
1007         num-slots = <1>;
1008         pinctrl-names = "default";
1009         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
1010         sd-uhs-sdr104;
1011         status = "okay";
1012 };
1013
1014 &tcphy0 {  
1015         //extcon = <&fusb0>;
1016         status = "okay";
1017 };
1018
1019 &tcphy1 {   
1020         status = "okay";
1021 };
1022
1023 &tsadc {
1024         /* tshut mode 0:CRU 1:GPIO */
1025         rockchip,hw-tshut-mode = <1>;
1026         /* tshut polarity 0:LOW 1:HIGH */
1027         rockchip,hw-tshut-polarity = <1>;
1028         status = "okay";
1029 };
1030
1031 &u2phy0 {   
1032         status = "okay";
1033         //extcon = <&fusb0>;
1034
1035         u2phy0_otg: otg-port {
1036                 status = "okay";
1037         };
1038
1039         u2phy0_host: host-port {
1040                 phy-supply = <&vcc5v0_host>;
1041                 status = "okay";
1042         };
1043 };
1044
1045 &u2phy1 {
1046         status = "okay";
1047
1048         u2phy1_otg: otg-port {
1049                 status = "okay";
1050         };
1051
1052         u2phy1_host: host-port {
1053                 phy-supply = <&vcc5v0_host>;
1054                 status = "okay";
1055         };
1056 };
1057
1058 &pwm3 { 
1059         status = "okay";
1060         interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH 0>;
1061         compatible = "rockchip,remotectl-pwm";
1062         remote_pwm_id = <3>;
1063         handle_cpu_id = <0>;
1064
1065     ir_key1{
1066         rockchip,usercode = <0xff00>;
1067         rockchip,key_table =
1068             <0xeb   KEY_POWER>,
1069             <0xec   KEY_COMPOSE>,
1070             <0xfe   KEY_BACK>,
1071             <0xb7   KEY_HOME>,
1072             <0xa3   KEY_WWW>,
1073             <0xf4   KEY_VOLUMEUP>,
1074             <0xa7   KEY_VOLUMEDOWN>,
1075             <0xf8   KEY_ENTER>,
1076             <0xfc   KEY_UP>,
1077             <0xfd   KEY_DOWN>,
1078             <0xf1   KEY_LEFT>,
1079             <0xe5   KEY_RIGHT>;
1080     };
1081 };
1082
1083 &uart0 {
1084         pinctrl-names = "default";
1085         pinctrl-0 = <&uart0_xfer &uart0_cts>;
1086         status = "okay";
1087 };
1088
1089 &uart2 {  
1090         status = "okay";
1091 };
1092
1093 &uart4 {
1094        current-speed = <9600>;
1095        no-loopback-test;
1096        status = "okay";
1097 };
1098
1099 &usbdrd3_0 {   
1100         status = "okay";
1101         //extcon = <&fusb0>;
1102 };
1103
1104 &usbdrd3_1 {   
1105         status = "okay";
1106 };
1107
1108 &usbdrd_dwc3_0 {
1109         status = "okay";
1110         //dr_mode = "peripheral";
1111         dr_mode = "host";
1112 };
1113
1114 &usbdrd_dwc3_1 {   
1115         status = "okay";
1116         dr_mode = "host";
1117 };
1118  
1119 &usb_host0_ehci { 
1120         status = "okay";
1121 };
1122
1123 &usb_host0_ohci { 
1124         status = "okay";
1125 };
1126
1127 &usb_host1_ehci {  
1128         status = "okay";
1129 };
1130
1131 &usb_host1_ohci {  
1132         status = "okay";
1133 };
1134
1135 &vopb { 
1136         status = "okay";
1137 };
1138
1139 &vopb_mmu { 
1140         status = "okay";
1141 };
1142
1143 &vopl {
1144         status = "okay";
1145 };
1146
1147 &vopl_mmu {
1148         status = "okay";
1149 };
1150
1151 &vpu {
1152         status = "okay";
1153         /* 0 means ion, 1 means drm */
1154         //allocator = <0>;
1155 };