2 * Copyright (c) 2016 Fuzhou Rockchip Electronics Co., Ltd
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
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.
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.
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
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
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.
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>
52 compatible = "rockchip,rk3399-mid", "rockchip,rk3399";
54 edp_panel: edp-panel {
55 compatible = "simple-panel";
56 backlight = <&backlight>;
57 power-supply = <&vcc3v3_s0>;
58 enable-gpios = <&gpio3 8 GPIO_ACTIVE_HIGH>;
59 bus-format = <MEDIA_BUS_FMT_RGB666_1X18>;
61 panel_in_edp: endpoint {
62 remote-endpoint = <&edp_out_panel>;
68 compatible = "regulator-fixed";
69 regulator-name = "vcc_sys";
72 regulator-min-microvolt = <3900000>;
73 regulator-max-microvolt = <3900000>;
76 vcc3v3_sys: vcc3v3-sys {
77 compatible = "regulator-fixed";
78 regulator-name = "vcc3v3_sys";
81 regulator-min-microvolt = <3300000>;
82 regulator-max-microvolt = <3300000>;
85 vcc5v0_host: vcc5v0-host-regulator {
86 compatible = "regulator-fixed";
88 gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>;
89 pinctrl-names = "default";
90 pinctrl-0 = <&host_vbus_drv>;
91 regulator-name = "vcc5v0_host";
95 compatible = "pwm-regulator";
96 pwms = <&pwm2 0 25000 0>;
98 rockchip,pwm_voltage = <1000000>;
99 regulator-name = "vdd_log";
100 regulator-min-microvolt = <750000>;
101 regulator-max-microvolt = <1350000>;
106 backlight: backlight {
107 compatible = "pwm-backlight";
108 pwms = <&pwm0 0 25000 PWM_POLARITY_INVERTED>;
109 brightness-levels = <
110 0 1 51 52 52 53 53 54
111 54 55 55 56 56 57 57 58
112 58 59 59 60 61 61 62 63
113 63 64 65 65 66 67 67 68
114 69 69 70 71 71 72 73 73
115 74 75 75 76 77 77 78 79
116 79 80 80 81 81 82 83 83
117 84 85 86 86 87 88 89 89
118 90 91 92 92 93 94 95 95
119 96 97 98 98 99 100 101 101
120 102 103 104 104 105 106 107 107
121 108 109 110 110 111 112 113 113
122 114 115 116 116 117 118 119 119
123 120 121 122 122 123 124 125 125
124 126 127 128 128 129 130 131 131
125 132 133 134 134 135 136 137 137
126 138 139 140 140 141 142 143 143
127 144 145 146 146 147 148 149 149
128 150 151 152 152 153 154 155 155
129 156 157 158 158 159 160 161 161
130 162 163 164 164 165 166 167 167
131 168 169 170 170 171 172 173 173
132 174 175 176 176 177 178 179 179
133 180 181 182 182 183 184 185 185
134 186 187 188 188 189 190 191 191
135 216 217 218 218 219 220 221 221
136 222 223 224 224 225 226 227 227
137 228 229 230 230 231 232 233 233
138 234 235 236 236 237 238 239 239
139 240 241 242 242 243 244 245 245
140 246 247 248 248 249 250 251 251
141 252 253 254 254 255 255 255 255>;
142 default-brightness-level = <200>;
143 enable-gpios = <&gpio3 GPIO_A4 GPIO_ACTIVE_HIGH>;
146 vcc_phy: vcc-phy-regulator {
147 compatible = "regulator-fixed";
148 regulator-name = "vcc_phy";
154 compatible = "simple-audio-card";
155 simple-audio-card,format = "i2s";
156 simple-audio-card,name = "rockchip,es8316-codec";
157 simple-audio-card,mclk-fs = <256>;
158 simple-audio-card,widgets =
159 "Microphone", "Mic Jack",
160 "Headphone", "Headphone Jack";
161 simple-audio-card,routing =
162 "Mic Jack", "MICBIAS1",
164 "Headphone Jack", "HPOL",
165 "Headphone Jack", "HPOR";
166 simple-audio-card,cpu {
169 simple-audio-card,codec {
170 sound-dai = <&es8316>;
175 compatible = "simple-audio-card";
176 simple-audio-card,name = "rockchip,spdif";
177 simple-audio-card,cpu {
178 sound-dai = <&spdif>;
180 simple-audio-card,codec {
181 sound-dai = <&spdif_out>;
185 spdif_out: spdif-out {
186 compatible = "linux,spdif-dit";
187 #sound-dai-cells = <0>;
190 sdio_pwrseq: sdio-pwrseq {
191 compatible = "mmc-pwrseq-simple";
193 clock-names = "ext_clock";
194 pinctrl-names = "default";
195 pinctrl-0 = <&wifi_enable_h>;
198 * On the module itself this is one of these (depending
199 * on the actual card populated):
200 * - SDIO_RESET_L_WL_REG_ON
201 * - PDN (power down when low)
203 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
207 compatible = "wlan-platdata";
208 rockchip,grf = <&grf>;
209 wifi_chip_type = "ap6354";
211 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
216 compatible = "bluetooth-platdata";
218 clock-names = "ext_clock";
219 //wifi-bt-power-toggle;
220 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
221 pinctrl-names = "default", "rts_gpio";
222 pinctrl-0 = <&uart0_rts>;
223 pinctrl-1 = <&uart0_gpios>;
224 //BT,power_gpio = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */
225 BT,reset_gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
226 BT,wake_gpio = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
227 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
232 compatible = "rockchip,uboot-charge";
233 rockchip,uboot-charge-on = <0>;
234 rockchip,android-charge-on = <1>;
238 compatible = "rk-vibrator-gpio";
239 vibrator-gpio = <&gpio4 30 GPIO_ACTIVE_LOW>;
244 compatible = "rockchip_headset";
245 headset_gpio = <&gpio4 28 GPIO_ACTIVE_HIGH>;
246 pinctrl-names = "default";
247 pinctrl-0 = <&hp_det>;
248 io-channels = <&saradc 2>;
253 compatible = "rockchip,key";
256 io-channels = <&saradc 1>;
261 rockchip,adc_value = <1>;
266 label = "volume down";
267 rockchip,adc_value = <170>;
271 gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
280 rockchip,adc_value = <746>;
286 rockchip,adc_value = <355>;
292 rockchip,adc_value = <560>;
298 rockchip,adc_value = <450>;
303 cpu-supply = <&vdd_cpu_l>;
307 cpu-supply = <&vdd_cpu_l>;
311 cpu-supply = <&vdd_cpu_l>;
315 cpu-supply = <&vdd_cpu_l>;
319 cpu-supply = <&vdd_cpu_b>;
323 cpu-supply = <&vdd_cpu_b>;
332 #address-cells = <1>;
334 edp_out_panel: endpoint@0 {
336 remote-endpoint = <&panel_in_edp>;
348 mali-supply = <&vdd_gpu>;
353 rockchip,i2s-broken-burst-len;
354 rockchip,playback-channels = <8>;
355 rockchip,capture-channels = <8>;
356 #sound-dai-cells = <0>;
360 #sound-dai-cells = <0>;
365 i2c-scl-rising-time-ns = <180>;
366 i2c-scl-falling-time-ns = <30>;
367 clock-frequency = <400000>;
369 vdd_cpu_b: syr837@40 {
370 compatible = "silergy,syr827";
372 vin-supply = <&vcc_sys>;
373 regulator-compatible = "fan53555-reg";
374 pinctrl-0 = <&vsel1_gpio>;
375 vsel-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
376 regulator-name = "vdd_cpu_b";
377 regulator-min-microvolt = <712500>;
378 regulator-max-microvolt = <1500000>;
379 regulator-ramp-delay = <1000>;
380 fcs,suspend-voltage-selector = <1>;
382 regulator-initial-state = <3>;
383 regulator-state-mem {
384 regulator-off-in-suspend;
389 compatible = "silergy,syr828";
392 vin-supply = <&vcc_sys>;
393 regulator-compatible = "fan53555-reg";
394 pinctrl-0 = <&vsel2_gpio>;
395 vsel-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
396 regulator-name = "vdd_gpu";
397 regulator-min-microvolt = <735000>;
398 regulator-max-microvolt = <1400000>;
399 regulator-ramp-delay = <1000>;
400 fcs,suspend-voltage-selector = <1>;
402 regulator-state-mem {
403 regulator-off-in-suspend;
408 compatible = "rockchip,rk808";
410 interrupt-parent = <&gpio1>;
411 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
412 pinctrl-0 = <&pmic_int_l>;
413 rockchip,system-power-controller;
416 clock-output-names = "xin32k", "rk808-clkout2";
418 vcc1-supply = <&vcc3v3_sys>;
419 vcc2-supply = <&vcc3v3_sys>;
420 vcc3-supply = <&vcc3v3_sys>;
421 vcc4-supply = <&vcc3v3_sys>;
422 vcc6-supply = <&vcc3v3_sys>;
423 vcc7-supply = <&vcc3v3_sys>;
424 vcc8-supply = <&vcc3v3_sys>;
425 vcc9-supply = <&vcc3v3_sys>;
426 vcc10-supply = <&vcc3v3_sys>;
427 vcc11-supply = <&vcc3v3_sys>;
428 vcc12-supply = <&vcc3v3_sys>;
429 vddio-supply = <&vcc1v8_pmu>;
432 vdd_center: DCDC_REG1 {
435 regulator-min-microvolt = <750000>;
436 regulator-max-microvolt = <1350000>;
437 regulator-ramp-delay = <6001>;
438 regulator-name = "vdd_center";
439 regulator-state-mem {
440 regulator-off-in-suspend;
444 vdd_cpu_l: DCDC_REG2 {
447 regulator-min-microvolt = <750000>;
448 regulator-max-microvolt = <1350000>;
449 regulator-ramp-delay = <6001>;
450 regulator-name = "vdd_cpu_l";
451 regulator-state-mem {
452 regulator-off-in-suspend;
459 regulator-name = "vcc_ddr";
460 regulator-state-mem {
461 regulator-on-in-suspend;
468 regulator-min-microvolt = <1800000>;
469 regulator-max-microvolt = <1800000>;
470 regulator-name = "vcc_1v8";
471 regulator-state-mem {
472 regulator-on-in-suspend;
473 regulator-suspend-microvolt = <1800000>;
477 vcc1v8_dvp: LDO_REG1 {
480 regulator-min-microvolt = <1800000>;
481 regulator-max-microvolt = <1800000>;
482 regulator-name = "vcc1v8_dvp";
483 regulator-state-mem {
484 regulator-off-in-suspend;
488 vcc3v0_tp: LDO_REG2 {
491 regulator-min-microvolt = <3000000>;
492 regulator-max-microvolt = <3000000>;
493 regulator-name = "vcc3v0_tp";
494 regulator-state-mem {
495 regulator-off-in-suspend;
499 vcc1v8_pmu: LDO_REG3 {
502 regulator-min-microvolt = <1800000>;
503 regulator-max-microvolt = <1800000>;
504 regulator-name = "vcc1v8_pmu";
505 regulator-state-mem {
506 regulator-on-in-suspend;
507 regulator-suspend-microvolt = <1800000>;
514 regulator-min-microvolt = <1800000>;
515 regulator-max-microvolt = <3300000>;
516 regulator-name = "vcc_sd";
517 regulator-state-mem {
518 regulator-on-in-suspend;
519 regulator-suspend-microvolt = <3300000>;
523 vcca3v0_codec: LDO_REG5 {
526 regulator-min-microvolt = <3000000>;
527 regulator-max-microvolt = <3000000>;
528 regulator-name = "vcca3v0_codec";
529 regulator-state-mem {
530 regulator-off-in-suspend;
537 regulator-min-microvolt = <1500000>;
538 regulator-max-microvolt = <1500000>;
539 regulator-name = "vcc_1v5";
540 regulator-state-mem {
541 regulator-on-in-suspend;
542 regulator-suspend-microvolt = <1500000>;
546 vcca1v8_codec: LDO_REG7 {
549 regulator-min-microvolt = <1800000>;
550 regulator-max-microvolt = <1800000>;
551 regulator-name = "vcca1v8_codec";
552 regulator-state-mem {
553 regulator-off-in-suspend;
560 regulator-min-microvolt = <3000000>;
561 regulator-max-microvolt = <3000000>;
562 regulator-name = "vcc_3v0";
563 regulator-state-mem {
564 regulator-on-in-suspend;
565 regulator-suspend-microvolt = <3000000>;
569 vcc3v3_s3: SWITCH_REG1 {
572 regulator-name = "vcc3v3_s3";
573 regulator-state-mem {
574 regulator-off-in-suspend;
578 vcc3v3_s0: SWITCH_REG2 {
581 regulator-name = "vcc3v3_s0";
582 regulator-state-mem {
583 regulator-off-in-suspend;
592 i2c-scl-rising-time-ns = <140>;
593 i2c-scl-falling-time-ns = <30>;
596 #sound-dai-cells = <0>;
597 compatible = "everest,es8316";
599 clocks = <&cru SCLK_I2S_8CH_OUT>;
600 clock-names = "mclk";
601 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
607 i2c-scl-rising-time-ns = <345>;
608 i2c-scl-falling-time-ns = <11>;
609 clock-frequency = <400000>;
611 touchpad: touchpad@2c {
612 compatible = "hid-over-i2c";
613 interrupt-parent = <&gpio1>;
614 interrupts = <GPIO_C2 IRQ_TYPE_LEVEL_LOW>;
615 pinctrl-names = "default";
616 pinctrl-0 = <&touchpad_irq_gpio>;
618 hid-descr-addr = <0x002c>;
624 i2c-scl-rising-time-ns = <345>;
625 i2c-scl-falling-time-ns = <11>;
626 clock-frequency = <400000>;
629 compatible = "fairchild,fusb302";
631 pinctrl-names = "default";
632 pinctrl-0 = <&fusb1_int>;
633 vbus-5v-gpios = <&gpio4 GPIO_D6 GPIO_ACTIVE_LOW>;
634 int-n-gpios = <&gpio1 GPIO_B5 GPIO_ACTIVE_HIGH>;
641 i2c-scl-rising-time-ns = <345>;
642 i2c-scl-falling-time-ns = <11>;
643 clock-frequency = <400000>;
646 compatible = "fairchild,fusb302";
648 pinctrl-names = "default";
649 pinctrl-0 = <&fusb0_int>;
650 vbus-5v-gpios = <&gpio4 GPIO_D5 GPIO_ACTIVE_LOW>;
651 int-n-gpios = <&gpio1 GPIO_A2 GPIO_ACTIVE_HIGH>;
658 bt656-supply = <&vcc_3v0>;
659 audio-supply = <&vcca1v8_codec>;
660 sdmmc-supply = <&vcc_sd>;
661 gpio1830-supply = <&vcc_3v0>;
670 pmu1830-supply = <&vcc_1v8>;
687 logo,mode = "center";
699 clock-frequency = <50000000>;
700 clock-freq-min-max = <400000 150000000>;
708 vqmmc-supply = <&vcc_sd>;
709 pinctrl-names = "default";
710 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
715 clock-frequency = <150000000>;
716 clock-freq-min-max = <200000 150000000>;
722 keep-power-in-suspend;
723 mmc-pwrseq = <&sdio_pwrseq>;
726 pinctrl-names = "default";
727 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
737 keep-power-in-suspend;
738 mmc-hs400-enhanced-strobe;
744 #sound-dai-cells = <0>;
762 rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
763 rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
771 u2phy0_otg: otg-port {
775 u2phy0_host: host-port {
776 phy-supply = <&vcc5v0_host>;
785 u2phy1_otg: otg-port {
789 u2phy1_host: host-port {
790 phy-supply = <&vcc5v0_host>;
796 pinctrl-names = "default";
797 pinctrl-0 = <&uart0_xfer &uart0_cts>;
845 wifi_enable_h: wifi-enable-h {
846 rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
851 uart0_gpios: uart0-gpios {
852 rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
857 pmic_int_l: pmic-int-l {
859 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
861 vsel1_gpio: vsel1-gpio {
863 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
865 vsel2_gpio: vsel2-gpio {
867 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
873 rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_up>;
878 touchpad_irq_gpio: touchpad-irq-gpio {
879 rockchip,pins = <1 GPIO_C2 RK_FUNC_GPIO &pcfg_pull_up>;
884 host_vbus_drv: host-vbus-drv {
886 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
891 fusb0_int: fusb0-int {
893 <1 GPIO_A2 RK_FUNC_GPIO &pcfg_pull_up>;
895 fusb1_int: fusb1-int {
897 <1 GPIO_B5 RK_FUNC_GPIO &pcfg_pull_up>;