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 = "auo,b125han03", "panel-simple";
56 backlight = <&backlight>;
57 power-supply = <&vcc3v3_s0>;
58 enable-gpios = <&gpio3 8 GPIO_ACTIVE_HIGH>;
60 panel_in_edp: endpoint {
61 remote-endpoint = <&edp_out_panel>;
67 compatible = "regulator-fixed";
68 regulator-name = "vcc_sys";
71 regulator-min-microvolt = <3900000>;
72 regulator-max-microvolt = <3900000>;
75 vcc3v3_sys: vcc3v3-sys {
76 compatible = "regulator-fixed";
77 regulator-name = "vcc3v3_sys";
80 regulator-min-microvolt = <3300000>;
81 regulator-max-microvolt = <3300000>;
84 vcc5v0_host: vcc5v0-host-regulator {
85 compatible = "regulator-fixed";
87 gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>;
88 pinctrl-names = "default";
89 pinctrl-0 = <&host_vbus_drv>;
90 regulator-name = "vcc5v0_host";
94 compatible = "pwm-regulator";
95 pwms = <&pwm2 0 25000 0>;
97 rockchip,pwm_voltage = <1000000>;
98 regulator-name = "vdd_log";
99 regulator-min-microvolt = <750000>;
100 regulator-max-microvolt = <1350000>;
105 backlight: backlight {
106 compatible = "pwm-backlight";
107 pwms = <&pwm0 0 25000 PWM_POLARITY_INVERTED>;
108 brightness-levels = <
109 0 1 51 52 52 53 53 54
110 54 55 55 56 56 57 57 58
111 58 59 59 60 61 61 62 63
112 63 64 65 65 66 67 67 68
113 69 69 70 71 71 72 73 73
114 74 75 75 76 77 77 78 79
115 79 80 80 81 81 82 83 83
116 84 85 86 86 87 88 89 89
117 90 91 92 92 93 94 95 95
118 96 97 98 98 99 100 101 101
119 102 103 104 104 105 106 107 107
120 108 109 110 110 111 112 113 113
121 114 115 116 116 117 118 119 119
122 120 121 122 122 123 124 125 125
123 126 127 128 128 129 130 131 131
124 132 133 134 134 135 136 137 137
125 138 139 140 140 141 142 143 143
126 144 145 146 146 147 148 149 149
127 150 151 152 152 153 154 155 155
128 156 157 158 158 159 160 161 161
129 162 163 164 164 165 166 167 167
130 168 169 170 170 171 172 173 173
131 174 175 176 176 177 178 179 179
132 180 181 182 182 183 184 185 185
133 186 187 188 188 189 190 191 191
134 216 217 218 218 219 220 221 221
135 222 223 224 224 225 226 227 227
136 228 229 230 230 231 232 233 233
137 234 235 236 236 237 238 239 239
138 240 241 242 242 243 244 245 245
139 246 247 248 248 249 250 251 251
140 252 253 254 254 255 255 255 255>;
141 default-brightness-level = <200>;
142 enable-gpios = <&gpio3 GPIO_A4 GPIO_ACTIVE_HIGH>;
145 vcc_phy: vcc-phy-regulator {
146 compatible = "regulator-fixed";
147 regulator-name = "vcc_phy";
153 compatible = "simple-audio-card";
154 simple-audio-card,format = "i2s";
155 simple-audio-card,name = "rockchip,es8316-codec";
156 simple-audio-card,mclk-fs = <256>;
157 simple-audio-card,widgets =
158 "Microphone", "Mic Jack",
159 "Headphone", "Headphone Jack";
160 simple-audio-card,routing =
161 "Mic Jack", "MICBIAS1",
163 "Headphone Jack", "HPOL",
164 "Headphone Jack", "HPOR";
165 simple-audio-card,cpu {
168 simple-audio-card,codec {
169 sound-dai = <&es8316>;
174 compatible = "simple-audio-card";
175 simple-audio-card,name = "rockchip,spdif";
176 simple-audio-card,cpu {
177 sound-dai = <&spdif>;
179 simple-audio-card,codec {
180 sound-dai = <&spdif_out>;
184 spdif_out: spdif-out {
185 compatible = "linux,spdif-dit";
186 #sound-dai-cells = <0>;
189 sdio_pwrseq: sdio-pwrseq {
190 compatible = "mmc-pwrseq-simple";
192 clock-names = "ext_clock";
193 pinctrl-names = "default";
194 pinctrl-0 = <&wifi_enable_h>;
197 * On the module itself this is one of these (depending
198 * on the actual card populated):
199 * - SDIO_RESET_L_WL_REG_ON
200 * - PDN (power down when low)
202 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
206 compatible = "wlan-platdata";
207 rockchip,grf = <&grf>;
208 wifi_chip_type = "ap6354";
210 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
215 compatible = "bluetooth-platdata";
217 clock-names = "ext_clock";
218 //wifi-bt-power-toggle;
219 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
220 pinctrl-names = "default", "rts_gpio";
221 pinctrl-0 = <&uart0_rts>;
222 pinctrl-1 = <&uart0_gpios>;
223 //BT,power_gpio = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */
224 BT,reset_gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
225 BT,wake_gpio = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
226 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
231 compatible = "rockchip,uboot-charge";
232 rockchip,uboot-charge-on = <0>;
233 rockchip,android-charge-on = <1>;
237 compatible = "rk-vibrator-gpio";
238 vibrator-gpio = <&gpio4 30 GPIO_ACTIVE_LOW>;
243 compatible = "rockchip_headset";
244 headset_gpio = <&gpio4 28 GPIO_ACTIVE_HIGH>;
245 pinctrl-names = "default";
246 pinctrl-0 = <&hp_det>;
247 io-channels = <&saradc 2>;
252 compatible = "rockchip,key";
255 io-channels = <&saradc 1>;
260 rockchip,adc_value = <1>;
265 label = "volume down";
266 rockchip,adc_value = <170>;
270 gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
279 rockchip,adc_value = <746>;
285 rockchip,adc_value = <355>;
291 rockchip,adc_value = <560>;
297 rockchip,adc_value = <450>;
302 clock-frequency = <50000000>;
303 clock-freq-min-max = <400000 150000000>;
311 vqmmc-supply = <&vcc_sd>;
312 pinctrl-names = "default";
313 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
318 clock-frequency = <150000000>;
319 clock-freq-min-max = <200000 150000000>;
325 keep-power-in-suspend;
326 mmc-pwrseq = <&sdio_pwrseq>;
329 pinctrl-names = "default";
330 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
344 keep-power-in-suspend;
345 mmc-hs400-enhanced-strobe;
351 rockchip,i2s-broken-burst-len;
352 rockchip,playback-channels = <8>;
353 rockchip,capture-channels = <8>;
354 #sound-dai-cells = <0>;
358 #sound-dai-cells = <0>;
363 #sound-dai-cells = <0>;
368 i2c-scl-rising-time-ns = <180>;
369 i2c-scl-falling-time-ns = <30>;
370 clock-frequency = <400000>;
372 vdd_cpu_b: syr837@40 {
373 compatible = "silergy,syr827";
375 vin-supply = <&vcc_sys>;
376 regulator-compatible = "fan53555-reg";
377 pinctrl-0 = <&vsel1_gpio>;
378 vsel-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
379 regulator-name = "vdd_cpu_b";
380 regulator-min-microvolt = <712500>;
381 regulator-max-microvolt = <1500000>;
382 regulator-ramp-delay = <1000>;
383 fcs,suspend-voltage-selector = <1>;
385 regulator-initial-state = <3>;
386 regulator-state-mem {
387 regulator-off-in-suspend;
392 compatible = "silergy,syr828";
395 vin-supply = <&vcc_sys>;
396 regulator-compatible = "fan53555-reg";
397 pinctrl-0 = <&vsel2_gpio>;
398 vsel-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
399 regulator-name = "vdd_gpu";
400 regulator-min-microvolt = <735000>;
401 regulator-max-microvolt = <1400000>;
402 regulator-ramp-delay = <1000>;
403 fcs,suspend-voltage-selector = <1>;
405 regulator-state-mem {
406 regulator-off-in-suspend;
411 compatible = "rockchip,rk808";
413 interrupt-parent = <&gpio1>;
414 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
415 pinctrl-0 = <&pmic_int_l>;
416 rockchip,system-power-controller;
419 clock-output-names = "xin32k", "rk808-clkout2";
421 vcc1-supply = <&vcc3v3_sys>;
422 vcc2-supply = <&vcc3v3_sys>;
423 vcc3-supply = <&vcc3v3_sys>;
424 vcc4-supply = <&vcc3v3_sys>;
425 vcc6-supply = <&vcc3v3_sys>;
426 vcc7-supply = <&vcc3v3_sys>;
427 vcc8-supply = <&vcc3v3_sys>;
428 vcc9-supply = <&vcc3v3_sys>;
429 vcc10-supply = <&vcc3v3_sys>;
430 vcc11-supply = <&vcc3v3_sys>;
431 vcc12-supply = <&vcc3v3_sys>;
432 vddio-supply = <&vcc1v8_pmu>;
435 vdd_center: DCDC_REG1 {
438 regulator-min-microvolt = <750000>;
439 regulator-max-microvolt = <1350000>;
440 regulator-ramp-delay = <6001>;
441 regulator-name = "vdd_center";
442 regulator-state-mem {
443 regulator-off-in-suspend;
447 vdd_cpu_l: DCDC_REG2 {
450 regulator-min-microvolt = <750000>;
451 regulator-max-microvolt = <1350000>;
452 regulator-ramp-delay = <6001>;
453 regulator-name = "vdd_cpu_l";
454 regulator-state-mem {
455 regulator-off-in-suspend;
462 regulator-name = "vcc_ddr";
463 regulator-state-mem {
464 regulator-on-in-suspend;
471 regulator-min-microvolt = <1800000>;
472 regulator-max-microvolt = <1800000>;
473 regulator-name = "vcc_1v8";
474 regulator-state-mem {
475 regulator-on-in-suspend;
476 regulator-suspend-microvolt = <1800000>;
480 vcc1v8_dvp: LDO_REG1 {
483 regulator-min-microvolt = <1800000>;
484 regulator-max-microvolt = <1800000>;
485 regulator-name = "vcc1v8_dvp";
486 regulator-state-mem {
487 regulator-off-in-suspend;
491 vcc3v0_tp: LDO_REG2 {
494 regulator-min-microvolt = <3000000>;
495 regulator-max-microvolt = <3000000>;
496 regulator-name = "vcc3v0_tp";
497 regulator-state-mem {
498 regulator-off-in-suspend;
502 vcc1v8_pmu: LDO_REG3 {
505 regulator-min-microvolt = <1800000>;
506 regulator-max-microvolt = <1800000>;
507 regulator-name = "vcc1v8_pmu";
508 regulator-state-mem {
509 regulator-on-in-suspend;
510 regulator-suspend-microvolt = <1800000>;
517 regulator-min-microvolt = <1800000>;
518 regulator-max-microvolt = <3300000>;
519 regulator-name = "vcc_sd";
520 regulator-state-mem {
521 regulator-on-in-suspend;
522 regulator-suspend-microvolt = <3300000>;
526 vcca3v0_codec: LDO_REG5 {
529 regulator-min-microvolt = <3000000>;
530 regulator-max-microvolt = <3000000>;
531 regulator-name = "vcca3v0_codec";
532 regulator-state-mem {
533 regulator-off-in-suspend;
540 regulator-min-microvolt = <1500000>;
541 regulator-max-microvolt = <1500000>;
542 regulator-name = "vcc_1v5";
543 regulator-state-mem {
544 regulator-on-in-suspend;
545 regulator-suspend-microvolt = <1500000>;
549 vcca1v8_codec: LDO_REG7 {
552 regulator-min-microvolt = <1800000>;
553 regulator-max-microvolt = <1800000>;
554 regulator-name = "vcca1v8_codec";
555 regulator-state-mem {
556 regulator-off-in-suspend;
563 regulator-min-microvolt = <3000000>;
564 regulator-max-microvolt = <3000000>;
565 regulator-name = "vcc_3v0";
566 regulator-state-mem {
567 regulator-on-in-suspend;
568 regulator-suspend-microvolt = <3000000>;
572 vcc3v3_s3: SWITCH_REG1 {
575 regulator-name = "vcc3v3_s3";
576 regulator-state-mem {
577 regulator-off-in-suspend;
581 vcc3v3_s0: SWITCH_REG2 {
584 regulator-name = "vcc3v3_s0";
585 regulator-state-mem {
586 regulator-off-in-suspend;
595 i2c-scl-rising-time-ns = <140>;
596 i2c-scl-falling-time-ns = <30>;
599 #sound-dai-cells = <0>;
600 compatible = "everest,es8316";
602 clocks = <&cru SCLK_I2S_8CH_OUT>;
603 clock-names = "mclk";
604 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
610 i2c-scl-rising-time-ns = <345>;
611 i2c-scl-falling-time-ns = <11>;
612 clock-frequency = <400000>;
614 touchpad: touchpad@2c {
615 compatible = "hid-over-i2c";
616 interrupt-parent = <&gpio1>;
617 interrupts = <GPIO_C2 IRQ_TYPE_LEVEL_LOW>;
618 pinctrl-names = "default";
619 pinctrl-0 = <&touchpad_irq_gpio>;
621 hid-descr-addr = <0x002c>;
627 i2c-scl-rising-time-ns = <345>;
628 i2c-scl-falling-time-ns = <11>;
629 clock-frequency = <400000>;
632 compatible = "fairchild,fusb302";
634 pinctrl-names = "default";
635 pinctrl-0 = <&fusb1_int>;
636 vbus-5v-gpios = <&gpio4 GPIO_D6 GPIO_ACTIVE_LOW>;
637 int-n-gpios = <&gpio1 GPIO_B5 GPIO_ACTIVE_HIGH>;
644 i2c-scl-rising-time-ns = <345>;
645 i2c-scl-falling-time-ns = <11>;
646 clock-frequency = <400000>;
649 compatible = "fairchild,fusb302";
651 pinctrl-names = "default";
652 pinctrl-0 = <&fusb0_int>;
653 vbus-5v-gpios = <&gpio4 GPIO_D5 GPIO_ACTIVE_LOW>;
654 int-n-gpios = <&gpio1 GPIO_A2 GPIO_ACTIVE_HIGH>;
661 bt656-supply = <&vcc_3v0>;
662 audio-supply = <&vcca1v8_codec>;
663 sdmmc-supply = <&vcc_sd>;
664 gpio1830-supply = <&vcc_3v0>;
668 cpu-supply = <&vdd_cpu_l>;
672 cpu-supply = <&vdd_cpu_l>;
676 cpu-supply = <&vdd_cpu_l>;
680 cpu-supply = <&vdd_cpu_l>;
684 cpu-supply = <&vdd_cpu_b>;
688 cpu-supply = <&vdd_cpu_b>;
693 mali-supply = <&vdd_gpu>;
715 rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
716 rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
724 u2phy0_otg: otg-port {
728 u2phy0_host: host-port {
729 phy-supply = <&vcc5v0_host>;
738 u2phy1_otg: otg-port {
742 u2phy1_host: host-port {
743 phy-supply = <&vcc5v0_host>;
749 pinctrl-names = "default";
750 pinctrl-0 = <&uart0_xfer &uart0_cts>;
794 pmu1830-supply = <&vcc_1v8>;
811 wifi_enable_h: wifi-enable-h {
812 rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
817 uart0_gpios: uart0-gpios {
818 rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
823 pmic_int_l: pmic-int-l {
825 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
827 vsel1_gpio: vsel1-gpio {
829 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
831 vsel2_gpio: vsel2-gpio {
833 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
839 rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_up>;
844 touchpad_irq_gpio: touchpad-irq-gpio {
845 rockchip,pins = <1 GPIO_C2 RK_FUNC_GPIO &pcfg_pull_up>;
850 host_vbus_drv: host-vbus-drv {
852 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
857 fusb0_int: fusb0-int {
859 <1 GPIO_A2 RK_FUNC_GPIO &pcfg_pull_up>;
861 fusb1_int: fusb1-int {
863 <1 GPIO_B5 RK_FUNC_GPIO &pcfg_pull_up>;
874 #address-cells = <1>;
876 edp_out_panel: endpoint@0 {
878 remote-endpoint = <&panel_in_edp>;
898 logo,mode = "center";