ARM64: DTS: Fix Firefly board audio driver
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3399-firefly-mini-linux-mipi.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 = "okay";
57                 compatible = "pwm-backlight";
58                 pwms = <&pwm1 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         hdmi_sound: hdmi-sound {
198                 status = "disabled";
199                 compatible = "simple-audio-card";
200                 simple-audio-card,format = "i2s";
201                 simple-audio-card,mclk-fs = <256>;
202                 simple-audio-card,name = "rockchip,hdmi";
203
204                 simple-audio-card,cpu {
205                         sound-dai = <&i2s2>;
206                 };
207                 simple-audio-card,codec {
208                         sound-dai = <&dw_hdmi_audio>;
209                 };
210         };
211
212         hdmi_codec: hdmi-codec {
213                 compatible = "simple-audio-card";
214                 simple-audio-card,format = "i2s";
215                 simple-audio-card,mclk-fs = <256>;
216                 simple-audio-card,name = "HDMI-CODEC";
217
218                 simple-audio-card,cpu {
219                         sound-dai = <&i2s2>;
220                 };
221                 simple-audio-card,codec {
222                         sound-dai = <&hdmi>;
223                 };
224         };
225
226         sdio_pwrseq: sdio-pwrseq {
227                 compatible = "mmc-pwrseq-simple";
228                 clocks = <&rk808 1>;
229                 clock-names = "ext_clock";
230                 pinctrl-names = "default";
231                 pinctrl-0 = <&wifi_enable_h>;
232
233                 /*
234                  * On the module itself this is one of these (depending
235                  * on the actual card populated):
236                  * - SDIO_RESET_L_WL_REG_ON
237                  * - PDN (power down when low)
238                  */
239                 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
240         };
241
242         vcc3v3_pcie: vcc3v3-pcie-regulator {
243                 status = "disabled";
244                 compatible = "regulator-fixed";
245                 enable-active-high;
246                 regulator-always-on;
247                 regulator-boot-on;
248                 gpio = <&gpio1 17 GPIO_ACTIVE_HIGH>;
249                 pinctrl-names = "default";
250                 pinctrl-0 = <&pcie_drv>;
251                 regulator-name = "vcc3v3_pcie";
252         };
253
254         vcc3v3_sys: vcc3v3-sys {
255                 compatible = "regulator-fixed";
256                 regulator-name = "vcc3v3_sys";
257                 regulator-always-on;
258                 regulator-boot-on;
259                 regulator-min-microvolt = <3300000>;
260                 regulator-max-microvolt = <3300000>;
261         };
262
263         vcc5v0_host: vcc5v0-host-regulator {
264                 compatible = "regulator-fixed";
265                 enable-active-high;
266                 gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>;
267                 pinctrl-names = "default";
268                 pinctrl-0 = <&host_vbus_drv>;
269                 regulator-name = "vcc5v0_host";
270                 regulator-always-on;
271         };
272
273         vbus_5v: vbus-5v-regulator {
274                 compatible = "regulator-fixed";
275                 enable-active-high;
276                 regulator-always-on;
277                 regulator-boot-on;
278                 gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>;
279                 pinctrl-names = "default";
280                 pinctrl-0 = <&vbus_5v_drv>;
281                 regulator-name = "vbus_5v";
282         };
283
284         vcc5v0_sys: vcc5v0-sys {
285                 compatible = "regulator-fixed";
286                 regulator-name = "vcc5v0_sys";
287                 regulator-always-on;
288                 regulator-boot-on;
289                 regulator-min-microvolt = <5000000>;
290                 regulator-max-microvolt = <5000000>;
291         };
292
293         vcc_phy: vcc-phy-regulator {
294                 compatible = "regulator-fixed";
295                 regulator-name = "vcc_phy";
296                 regulator-always-on;
297                 regulator-boot-on;
298         };
299
300         vdd_log: vdd-log {
301                 compatible = "pwm-regulator";
302                 pwms = <&pwm2 0 25000 1>;
303                 regulator-name = "vdd_log";
304                 regulator-min-microvolt = <800000>;
305                 regulator-max-microvolt = <1400000>;
306                 regulator-always-on;
307                 regulator-boot-on;
308
309                 /* for rockchip boot on */
310                 rockchip,pwm_id= <2>;
311                 rockchip,pwm_voltage = <1000000>;
312         };
313
314         vccadc_ref: vccadc-ref {
315                 compatible = "regulator-fixed";
316                 regulator-name = "vcc1v8_sys";
317                 regulator-always-on;
318                 regulator-boot-on;
319                 regulator-min-microvolt = <1800000>;
320                 regulator-max-microvolt = <1800000>;
321         };
322
323         vcc_lcd: vcc-lcd-regulator {
324                 compatible = "regulator-fixed";
325                 regulator-always-on;
326                 regulator-boot-on;
327                 enable-active-high;
328                 gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>;
329                 pinctrl-names = "default";
330                 pinctrl-0 = <&lcd_en>;
331                 regulator-name = "vcc_lcd";
332         };
333
334         wireless-wlan {
335                 compatible = "wlan-platdata";
336                 rockchip,grf = <&grf>;
337                 wifi_chip_type = "ap6212";
338                 sdio_vref = <1800>;
339                 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
340                 status = "okay";
341         };
342
343         wireless-bluetooth {
344                 compatible = "bluetooth-platdata";
345                 //wifi-bt-power-toggle;
346                 clocks = <&rk808 1>;
347         clock-names = "ext_clock";
348                 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
349                 pinctrl-names = "default", "rts_gpio";
350                 pinctrl-0 = <&uart0_rts>;
351                 pinctrl-1 = <&uart0_gpios>;
352                 //BT,power_gpio  = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */
353                 BT,reset_gpio    = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
354                 BT,wake_gpio     = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
355                 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
356                 status = "okay";
357         };
358
359         leds {
360                 compatible = "gpio-leds";
361                 power {
362                         label = "firefly:blue:power";
363                         linux,default-trigger = "ir-power-click";
364                         default-state = "on";
365                         gpios = <&gpio2 27 GPIO_ACTIVE_HIGH>;
366                         pinctrl-names = "default";
367                         pinctrl-0 = <&led_power>;
368                 };
369                 user {
370                         label = "firefly:yellow:user";
371                         linux,default-trigger = "ir-user-click";
372                         default-state = "off";
373                         gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
374                         pinctrl-names = "default";
375                         pinctrl-0 = <&led_user>;
376        };
377    };
378 };
379
380 &dsi {
381         status = "okay";
382         dsi_panel: dsi_panel {
383                 compatible ="simple-panel-dsi";
384                 reg = <0>;
385                 //enable-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
386                 //reset-gpios = <&gpio4 29 GPIO_ACTIVE_LOW>;
387                 dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST)>;
388                 dsi,format = <MIPI_DSI_FMT_RGB888>;
389                 dsi,lanes = <4>;
390                 delay,prepare = <10>;
391                 status = "okay";
392
393                 /*
394                 dsi,channel = <0>;
395
396         delay,enable = <10>;
397         delay,power = <10>;
398         delay,reset = <20>;
399         delay,prepare = <10>;
400
401         delay,unpreapre = <0>;
402         delay,unreset = <0>;
403         delay,unpower = <0>;
404         delay,disable = <0>;
405                 
406         size,width = <120>;
407         size,height = <170>;
408                 */
409
410                 panel-init-sequence = [
411                         05 20 01 29
412                         05 96 01 11
413                 ];
414                 panel-exit-sequence = [
415                                 05 05 01 28
416                                 05 78 01 10
417                 ];
418
419                 disp_timings: display-timings {
420                         native-mode = <&timing0>;
421                         timing0: timing0 {
422                            clock-frequency = <64000000>;
423                            hactive = <768>;
424                            vactive = <1024>;
425                            hsync-len = <5>;   //20, 50
426                            hback-porch = <25>; //50, 56
427                            hfront-porch = <150>;//50, 30
428                            vsync-len = <1>;
429                            vback-porch = <15>;
430                            vfront-porch = <100>;
431                            hsync-active = <0>;
432                            vsync-active = <0>;
433                            de-active = <0>;
434                            pixelclk-active = <0>;
435                         };
436                 };
437         };
438 };      
439
440 &cpu_l0 {
441         cpu-supply = <&vdd_cpu_l>;
442 };
443
444 &cpu_l1 {
445         cpu-supply = <&vdd_cpu_l>;
446 };
447
448 &cpu_l2 {
449         cpu-supply = <&vdd_cpu_l>;
450 };
451
452 &cpu_l3 {
453         cpu-supply = <&vdd_cpu_l>;
454 };
455
456 &cpu_b0 {
457         cpu-supply = <&vdd_cpu_b>;
458 };
459
460 &cpu_b1 {
461         cpu-supply = <&vdd_cpu_b>;
462 };
463
464 &display_subsystem {
465         status = "okay";
466 };
467
468 &edp {
469         status = "disabled";
470
471         ports {
472                 edp_out: port@1 {
473                         reg = <1>;
474                         #address-cells = <1>;
475                         #size-cells = <0>;
476
477                         edp_out_panel: endpoint@0 {
478                                 reg = <0>;
479                                 remote-endpoint = <&panel_in_edp>;
480                         };
481                 };
482         };
483 };
484
485 &emmc_phy {
486         status = "okay";
487 };
488
489 &gmac {
490         phy-supply = <&vcc_phy>;
491         phy-mode = "rgmii";
492         clock_in_out = "input";
493         snps,reset-gpio = <&gpio3 15 GPIO_ACTIVE_LOW>;
494         snps,reset-active-low;
495         snps,reset-delays-us = <0 10000 50000>;
496         assigned-clocks = <&cru SCLK_RMII_SRC>;
497         assigned-clock-parents = <&clkin_gmac>;
498         pinctrl-names = "default";
499         pinctrl-0 = <&rgmii_pins>;
500         tx_delay = <0x28>;
501         rx_delay = <0x11>;
502         status = "okay";
503 };
504
505 &gpu {
506         status = "okay";
507         mali-supply = <&vdd_gpu>;
508 };
509
510 &hdmi {
511         #address-cells = <1>;
512         #size-cells = <0>;
513         #sound-dai-cells = <0>;
514         status = "okay";
515 };
516
517 &i2c0 {
518         status = "okay";
519         i2c-scl-rising-time-ns = <168>;
520         i2c-scl-falling-time-ns = <4>;
521         clock-frequency = <400000>;
522
523         vdd_cpu_b: syr827@40 {
524                 compatible = "silergy,syr827";
525                 reg = <0x40>;
526                 vin-supply = <&vcc5v0_sys>;
527                 regulator-compatible = "fan53555-reg";
528                 regulator-name = "vdd_cpu_b";
529                 regulator-min-microvolt = <712500>;
530                 regulator-max-microvolt = <1500000>;
531                 regulator-ramp-delay = <1000>;
532                 vsel-gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>;
533                 fcs,suspend-voltage-selector = <1>;
534                 regulator-always-on;
535                 regulator-boot-on;
536                 regulator-initial-state = <3>;
537                         regulator-state-mem {
538                         regulator-off-in-suspend;
539                 };
540         };
541
542         vdd_gpu: syr828@41 {
543                 compatible = "silergy,syr828";
544                 reg = <0x41>;
545                 vin-supply = <&vcc5v0_sys>;
546                 regulator-compatible = "fan53555-reg";
547                 regulator-name = "vdd_gpu";
548                 regulator-min-microvolt = <712500>;
549                 regulator-max-microvolt = <1500000>;
550                 regulator-ramp-delay = <1000>;
551                 fcs,suspend-voltage-selector = <1>;
552                 regulator-always-on;
553                 regulator-boot-on;
554                 regulator-initial-state = <3>;
555                         regulator-state-mem {
556                         regulator-off-in-suspend;
557                 };
558         };
559
560         rk808: pmic@1b {
561                 compatible = "rockchip,rk808";
562                 reg = <0x1b>;
563                 interrupt-parent = <&gpio1>;
564                 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
565                 pinctrl-names = "default";
566                 pinctrl-0 = <&pmic_int_l &pmic_dvs2>;
567                 rockchip,system-power-controller;
568                 wakeup-source;
569                 #clock-cells = <1>;
570                 clock-output-names = "xin32k", "rk808-clkout2";
571
572                 vcc1-supply = <&vcc3v3_sys>;
573                 vcc2-supply = <&vcc3v3_sys>;
574                 vcc3-supply = <&vcc3v3_sys>;
575                 vcc4-supply = <&vcc3v3_sys>;
576                 vcc6-supply = <&vcc3v3_sys>;
577                 vcc7-supply = <&vcc3v3_sys>;
578                 vcc8-supply = <&vcc3v3_sys>;
579                 vcc9-supply = <&vcc3v3_sys>;
580                 vcc10-supply = <&vcc3v3_sys>;
581                 vcc11-supply = <&vcc3v3_sys>;
582                 vcc12-supply = <&vcc3v3_sys>;
583                 vddio-supply = <&vcc1v8_pmu>;
584
585                 regulators {
586                         vdd_center: DCDC_REG1 {
587                                 regulator-always-on;
588                                 regulator-boot-on;
589                                 regulator-min-microvolt = <750000>;
590                                 regulator-max-microvolt = <1350000>;
591                                 regulator-ramp-delay = <6001>;
592                                 regulator-name = "vdd_center";
593                                 regulator-state-mem {
594                                         regulator-off-in-suspend;
595                                 };
596                         };
597
598                         vdd_cpu_l: DCDC_REG2 {
599                                 regulator-always-on;
600                                 regulator-boot-on;
601                                 regulator-min-microvolt = <750000>;
602                                 regulator-max-microvolt = <1350000>;
603                                 regulator-ramp-delay = <6001>;
604                                 regulator-name = "vdd_cpu_l";
605                                 regulator-state-mem {
606                                         regulator-off-in-suspend;
607                                 };
608                         };
609
610                         vcc_ddr: DCDC_REG3 {
611                                 regulator-always-on;
612                                 regulator-boot-on;
613                                 regulator-name = "vcc_ddr";
614                                 regulator-state-mem {
615                                         regulator-on-in-suspend;
616                                 };
617                         };
618
619                         vcc_1v8: DCDC_REG4 {
620                                 regulator-always-on;
621                                 regulator-boot-on;
622                                 regulator-min-microvolt = <1800000>;
623                                 regulator-max-microvolt = <1800000>;
624                                 regulator-name = "vcc_1v8";
625                                 regulator-state-mem {
626                                         regulator-on-in-suspend;
627                                         regulator-suspend-microvolt = <1800000>;
628                                 };
629                         };
630
631                         vcc1v8_dvp: LDO_REG1 {
632                                 regulator-always-on;
633                                 regulator-boot-on;
634                                 regulator-min-microvolt = <1800000>;
635                                 regulator-max-microvolt = <1800000>;
636                                 regulator-name = "vcc1v8_dvp";
637                                 regulator-state-mem {
638                                         regulator-off-in-suspend;
639                                 };
640                         };
641
642                         vcc2v8_dvp: LDO_REG2 {
643                                 //regulator-always-on;
644                                 //regulator-boot-on;
645                                 regulator-min-microvolt = <2800000>;
646                                 regulator-max-microvolt = <2800000>;
647                                 regulator-name = "vcc2v8_dvp";
648                                 regulator-state-mem {
649                                         regulator-off-in-suspend;
650                                 };
651                         };
652
653                         vcc1v8_pmu: LDO_REG3 {
654                                 regulator-always-on;
655                                 regulator-boot-on;
656                                 regulator-min-microvolt = <1800000>;
657                                 regulator-max-microvolt = <1800000>;
658                                 regulator-name = "vcc1v8_pmu";
659                                 regulator-state-mem {
660                                         regulator-on-in-suspend;
661                                         regulator-suspend-microvolt = <1800000>;
662                                 };
663                         };
664
665                         vcc_sd: LDO_REG4 {
666                                 regulator-always-on;
667                                 regulator-boot-on;
668                                 regulator-min-microvolt = <1800000>;
669                                 regulator-max-microvolt = <3300000>;
670                                 regulator-name = "vcc_sd";
671                                 regulator-state-mem {
672                                         regulator-on-in-suspend;
673                                         regulator-suspend-microvolt = <3300000>;
674                                 };
675                         };
676
677                         vcca3v0_codec: LDO_REG5 {
678                                 regulator-always-on;
679                                 regulator-boot-on;
680                                 regulator-min-microvolt = <3000000>;
681                                 regulator-max-microvolt = <3000000>;
682                                 regulator-name = "vcca3v0_codec";
683                                 regulator-state-mem {
684                                         regulator-off-in-suspend;
685                                 };
686                         };
687
688                         vcc_1v5: LDO_REG6 {
689                                 regulator-always-on;
690                                 regulator-boot-on;
691                                 regulator-min-microvolt = <1500000>;
692                                 regulator-max-microvolt = <1500000>;
693                                 regulator-name = "vcc_1v5";
694                                 regulator-state-mem {
695                                         regulator-on-in-suspend;
696                                         regulator-suspend-microvolt = <1500000>;
697                                 };
698                         };
699
700                         vcca1v8_codec: LDO_REG7 {
701                                 regulator-always-on;
702                                 regulator-boot-on;
703                                 regulator-min-microvolt = <1800000>;
704                                 regulator-max-microvolt = <1800000>;
705                                 regulator-name = "vcca1v8_codec";
706                                 regulator-state-mem {
707                                         regulator-off-in-suspend;
708                                 };
709                         };
710
711                         vcc_3v0: LDO_REG8 {
712                                 regulator-always-on;
713                                 regulator-boot-on;
714                                 regulator-min-microvolt = <3000000>;
715                                 regulator-max-microvolt = <3000000>;
716                                 regulator-name = "vcc_3v0";
717                                 regulator-state-mem {
718                                         regulator-on-in-suspend;
719                                         regulator-suspend-microvolt = <3000000>;
720                                 };
721                         };
722
723                         vcc3v3_s3: SWITCH_REG1 {
724                                 regulator-always-on;
725                                 regulator-boot-on;
726                                 regulator-name = "vcc3v3_s3";
727                                 regulator-state-mem {
728                                         regulator-off-in-suspend;
729                                 };
730                         };
731
732                         vcc3v3_s0: SWITCH_REG2 {
733                                 regulator-always-on;
734                                 regulator-boot-on;
735                                 regulator-name = "vcc3v3_s0";
736                                 regulator-state-mem {
737                                         regulator-off-in-suspend;
738                                 };
739                         };
740                 };
741         };
742 };
743
744 &i2c1 {
745         status = "okay";
746         i2c-scl-rising-time-ns = <300>;
747         i2c-scl-falling-time-ns = <15>;
748
749     es8323: es8323@10{
750                 compatible = "everest,es8323";
751                 reg = <0x10>;
752                 ear-con-gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
753                 hp-det-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
754                 hp-mic-only = <1>;
755                 #sound-dai-cells = <0>;
756                 system-clock-frequency = <11289600>;
757                 clocks = <&cru SCLK_I2S_8CH_OUT>;
758                 clock-names = "mclk";
759                 pinctrl-names = "default";
760                 pinctrl-0 = <&es8323_earcon &es8323_hpdet>;
761         };
762         rt5640: rt5640@1c {
763                 status = "disabled";
764                 #sound-dai-cells = <0>;
765                 compatible = "realtek,rt5640";
766                 reg = <0x1c>;
767                 clocks = <&cru SCLK_I2S_8CH_OUT>;
768                 clock-names = "mclk";
769                 realtek,in1-differential;
770                 pinctrl-names = "default";
771                 pinctrl-0 = <&rt5640_hpcon>;
772                 hp-con-gpio = <&gpio4 21 GPIO_ACTIVE_HIGH>;
773                 //hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_LOW>;
774                 io-channels = <&saradc 4>;
775                 hp-det-adc-value = <500>;
776         };
777 };
778
779 &i2c3 {
780         status = "okay";
781         i2c-scl-rising-time-ns = <450>;
782         i2c-scl-falling-time-ns = <15>;
783 };
784
785 &i2c4 {
786         status = "okay";
787         i2c-scl-rising-time-ns = <475>;
788         i2c-scl-falling-time-ns = <26>;
789
790         fusb0: fusb30x@22 {
791                 compatible = "fairchild,fusb302";
792                 reg = <0x22>;
793                 pinctrl-names = "default";
794                 pinctrl-0 = <&fusb0_int>;
795                 int-n-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
796                 vbus-5v-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
797                 status = "disabled";
798         };
799
800         gsl3680: gsl3680@40 {
801                 status = "okay";
802                 compatible = "gslX680";
803                 reg = <0x40>;
804                 screen_max_x = <1536>;
805                 screen_max_y = <2048>;
806                 touch-gpio = <&gpio4 28 IRQ_TYPE_LEVEL_LOW>;
807                 reset-gpio = <&gpio4 21 GPIO_ACTIVE_HIGH>;
808         };
809
810         mpu6050: mpu@68 {
811                 status = "disabled";
812                 compatible = "invensense,mpu6050";
813                 reg = <0x68>;
814                 mpu-int_config = <0x10>;
815                 mpu-level_shifter = <0>;
816                 mpu-orientation = <0 1 0 1 0 0 0 0 1>;
817                 orientation-x= <1>;
818                 orientation-y= <1>;
819                 orientation-z= <1>;
820                 irq-gpio = <&gpio1 4 IRQ_TYPE_LEVEL_LOW>;
821                 mpu-debug = <1>;
822         };
823 };
824
825 &i2s0 {
826         status = "okay";
827         rockchip,i2s-broken-burst-len;
828         rockchip,playback-channels = <8>;
829         rockchip,capture-channels = <8>;
830         #sound-dai-cells = <0>;
831 };
832
833 &i2s1 {
834         status = "okay";
835         rockchip,i2s-broken-burst-len;
836         rockchip,playback-channels = <2>;
837         rockchip,capture-channels = <2>;
838         #sound-dai-cells = <0>;
839         assigned-clocks = <&cru SCLK_I2S1_DIV>, <&cru SCLK_I2S_8CH>;
840         assigned-clock-parents = <&cru PLL_GPLL>, <&cru SCLK_I2S1_8CH>;
841 };
842
843 &i2s2 {
844         #sound-dai-cells = <0>;
845         status = "okay";
846 };
847
848 &io_domains {
849         status = "okay";
850
851         bt656-supply = <&vcc_3v0>;              /* bt656_gpio2ab_ms */
852         audio-supply = <&vcca1v8_codec>;        /* audio_gpio3d4a_ms */
853         sdmmc-supply = <&vcc_sd>;               /* sdmmc_gpio4b_ms */
854         gpio1830-supply = <&vcc_3v0>;           /* gpio1833_gpio4cd_ms */
855 };
856
857 &pcie_phy {
858         status = "okay";
859 };
860
861 &pcie0 {
862         ep-gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>;
863         num-lanes = <4>;
864         pinctrl-names = "default";
865         pinctrl-0 = <&pcie_clkreqn_cpm>;
866         status = "okay";
867 };
868
869 &pmu_io_domains {
870         status = "okay";
871         pmu1830-supply = <&vcc_3v0>;
872 };
873
874 &pinctrl {
875         buttons {
876                 pwrbtn: pwrbtn {
877                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
878                 };
879         };
880
881         lcd-panel {
882                 lcd_panel_reset: lcd-panel-reset {
883                         rockchip,pins = <4 29 RK_FUNC_GPIO &pcfg_pull_up>;
884                 };
885
886                 lcd_en: lcd-en {
887                         rockchip,pins = <1 1 RK_FUNC_GPIO &pcfg_pull_up>;
888                 };
889         };
890
891         pcie {
892                 pcie_drv: pcie-drv {
893                         rockchip,pins =
894                                 <1 17 RK_FUNC_GPIO &pcfg_pull_none>;
895                         };
896                         pcie_3g_drv: pcie-3g-drv {
897                         rockchip,pins =
898                                 <0 2 RK_FUNC_GPIO &pcfg_pull_up>;
899                 };
900         };
901
902         pmic {
903                 vsel1_gpio: vsel1-gpio {
904                         rockchip,pins =
905                                 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
906                 };
907
908                 vsel2_gpio: vsel2-gpio {
909                         rockchip,pins =
910                         <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
911                 };
912         };
913
914         sdio-pwrseq {
915                 wifi_enable_h: wifi-enable-h {
916                         rockchip,pins =
917                                 <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
918                 };
919         };
920
921         wireless-bluetooth {
922                 uart0_gpios: uart0-gpios {
923                         rockchip,pins =
924                                 <2 19 RK_FUNC_GPIO &pcfg_pull_none>,
925                                 <0 9 RK_FUNC_GPIO &pcfg_pull_up>;
926                 };
927         };
928
929         leds {
930                 led_power: led-power {
931                         rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
932                 };
933
934                 led_user: led-user {
935                         rockchip,pins = <0 13 RK_FUNC_GPIO &pcfg_pull_none>;
936                 };
937         };
938         rt5640 {
939                 rt5640_hpcon: rt5640-hpcon {
940                         rockchip,pins = <4 21 RK_FUNC_GPIO &pcfg_pull_none>;
941                 };
942         };
943
944         es8223 {
945                 es8323_hpdet: es8323-hpdet {
946                         rockchip,pins = <0 11 RK_FUNC_GPIO &pcfg_pull_up>;
947                 };
948                 es8323_earcon: es8323-earcon {
949                         rockchip,pins = <0 12 RK_FUNC_GPIO &pcfg_pull_none>;
950                 };
951         };
952
953         pmic {
954                 pmic_int_l: pmic-int-l {
955                         rockchip,pins =
956                                 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
957                 };
958
959                 pmic_dvs2: pmic-dvs2 {
960                         rockchip,pins =
961                                 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
962                 };
963         };
964
965         usb2 {
966                 host_vbus_drv: host-vbus-drv {
967                         rockchip,pins =
968                                 <1 0 RK_FUNC_GPIO &pcfg_pull_none>;
969                 };
970         };
971
972         fusb30x {
973                 fusb0_int: fusb0-int {
974                         rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>;
975                 };
976         };
977
978         vbus {
979                 vbus_5v_drv: vbus-5v-drv {
980                         rockchip,pins = <1 3 RK_FUNC_GPIO &pcfg_pull_up>;
981                 };
982         };
983 };
984
985 &pwm0 {
986         status = "okay";
987 };
988
989 &pwm2 {
990         status = "okay";
991 };
992
993 &rkvdec {
994         status = "okay";
995 };
996
997 &rockchip_suspend {
998         rockchip,power-ctrl =
999                 <&gpio1 18 GPIO_ACTIVE_LOW>,
1000                 <&gpio1 14 GPIO_ACTIVE_HIGH>;
1001 };
1002
1003 &route_edp {
1004         status = "disabled";
1005 };
1006
1007 &route_hdmi {
1008         status = "okay";
1009         logo,mode = "center";
1010 };
1011
1012 &cdn_dp {
1013         status = "disabled";
1014         extcon = <&fusb0>;
1015         phys = <&tcphy0_dp>;
1016 };
1017
1018 &dp_in_vopb {
1019         status = "disabled";
1020 };
1021
1022 &saradc {
1023         status = "okay";
1024         vref-supply = <&vccadc_ref>;
1025 };
1026
1027 &sdhci {
1028         bus-width = <8>;
1029         keep-power-in-suspend;
1030         mmc-hs400-1_8v;
1031         mmc-hs400-enhanced-strobe;
1032         non-removable;
1033         status = "okay";
1034         supports-emmc;
1035 };
1036
1037 &sdmmc {
1038         max-frequency = <150000000>;
1039         supports-sd;
1040         bus-width = <4>;
1041         cap-mmc-highspeed;
1042         cap-sd-highspeed;
1043         disable-wp;
1044         num-slots = <1>;
1045         vqmmc-supply = <&vcc_sd>;
1046         pinctrl-names = "default";
1047         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
1048         status = "okay";
1049 };
1050
1051 &sdio0 {
1052         max-frequency = <50000000>;
1053         supports-sdio;
1054         bus-width = <4>;
1055         disable-wp;
1056         cap-sd-highspeed;
1057         keep-power-in-suspend;
1058         mmc-pwrseq = <&sdio_pwrseq>;
1059         non-removable;
1060         num-slots = <1>;
1061         pinctrl-names = "default";
1062         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
1063         sd-uhs-sdr104;
1064         status = "okay";
1065 };
1066
1067 &tcphy0 {
1068         //extcon = <&fusb0>;
1069         status = "okay";
1070 };
1071
1072 &tcphy1 {
1073         status = "okay";
1074 };
1075
1076 &tsadc {
1077         /* tshut mode 0:CRU 1:GPIO */
1078         rockchip,hw-tshut-mode = <1>;
1079         /* tshut polarity 0:LOW 1:HIGH */
1080         rockchip,hw-tshut-polarity = <1>;
1081         status = "okay";
1082 };
1083
1084 &u2phy0 {
1085         status = "okay";
1086         //extcon = <&fusb0>;
1087
1088         u2phy0_otg: otg-port {
1089                 status = "okay";
1090         };
1091
1092         u2phy0_host: host-port {
1093                 phy-supply = <&vcc5v0_host>;
1094                 status = "okay";
1095         };
1096 };
1097
1098 &u2phy1 {
1099         status = "okay";
1100
1101         u2phy1_otg: otg-port {
1102                 status = "okay";
1103         };
1104
1105         u2phy1_host: host-port {
1106                 phy-supply = <&vcc5v0_host>;
1107                 status = "okay";
1108         };
1109 };
1110
1111 &pwm3 {
1112         status = "okay";
1113         interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH 0>;
1114         compatible = "rockchip,remotectl-pwm";
1115         remote_pwm_id = <3>;
1116         handle_cpu_id = <0>;
1117
1118     ir_key1{
1119         rockchip,usercode = <0xff00>;
1120         rockchip,key_table =
1121             <0xeb   KEY_POWER>,
1122             <0xec   KEY_COMPOSE>,
1123             <0xfe   KEY_BACK>,
1124             <0xb7   KEY_HOME>,
1125             <0xa3   KEY_WWW>,
1126             <0xf4   KEY_VOLUMEUP>,
1127             <0xa7   KEY_VOLUMEDOWN>,
1128             <0xf8   KEY_ENTER>,
1129             <0xfc   KEY_UP>,
1130             <0xfd   KEY_DOWN>,
1131             <0xf1   KEY_LEFT>,
1132             <0xe5   KEY_RIGHT>;
1133     };
1134 };
1135
1136 &uart0 {
1137         pinctrl-names = "default";
1138         pinctrl-0 = <&uart0_xfer &uart0_cts>;
1139         status = "okay";
1140 };
1141
1142 &uart2 {
1143         status = "okay";
1144 };
1145
1146 &usbdrd3_0 {
1147         status = "okay";
1148         //extcon = <&fusb0>;
1149 };
1150
1151 &usbdrd3_1 {
1152         status = "okay";
1153 };
1154
1155 &usbdrd_dwc3_0 {
1156         status = "okay";
1157         //dr_mode = "peripheral";
1158         dr_mode = "host";
1159 };
1160
1161 &usbdrd_dwc3_1 {
1162         status = "okay";
1163         dr_mode = "host";
1164 };
1165
1166 &usb_host0_ehci {
1167         status = "okay";
1168 };
1169
1170 &usb_host0_ohci {
1171         status = "okay";
1172 };
1173
1174 &usb_host1_ehci {
1175         status = "okay";
1176 };
1177
1178 &usb_host1_ohci {
1179         status = "okay";
1180 };
1181
1182 &vopb {
1183         status = "okay";
1184 };
1185
1186 &vopb_mmu {
1187         status = "okay";
1188 };
1189
1190 &vopl {
1191         status = "okay";
1192 };
1193
1194 &vopl_mmu {
1195         status = "okay";
1196 };
1197
1198 &vpu {
1199         status = "okay";
1200 };