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 0>;
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>;
251 hall_sensor: hall-mh248 {
252 compatible = "hall-mh248";
253 pinctrl-names = "default";
254 pinctrl-0 = <&mh248_irq_gpio>;
255 irq-gpio = <&gpio0 GPIO_A1 IRQ_TYPE_EDGE_BOTH>;
262 compatible = "rockchip,key";
265 io-channels = <&saradc 1>;
270 rockchip,adc_value = <1>;
275 label = "volume down";
276 rockchip,adc_value = <170>;
280 gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
289 rockchip,adc_value = <746>;
295 rockchip,adc_value = <355>;
301 rockchip,adc_value = <560>;
307 rockchip,adc_value = <450>;
312 cpu-supply = <&vdd_cpu_l>;
316 cpu-supply = <&vdd_cpu_l>;
320 cpu-supply = <&vdd_cpu_l>;
324 cpu-supply = <&vdd_cpu_l>;
328 cpu-supply = <&vdd_cpu_b>;
332 cpu-supply = <&vdd_cpu_b>;
341 #address-cells = <1>;
343 edp_out_panel: endpoint@0 {
345 remote-endpoint = <&panel_in_edp>;
357 mali-supply = <&vdd_gpu>;
366 rockchip,i2s-broken-burst-len;
367 rockchip,playback-channels = <8>;
368 rockchip,capture-channels = <8>;
369 #sound-dai-cells = <0>;
373 #sound-dai-cells = <0>;
378 i2c-scl-rising-time-ns = <180>;
379 i2c-scl-falling-time-ns = <30>;
380 clock-frequency = <400000>;
382 vdd_cpu_b: syr837@40 {
383 compatible = "silergy,syr827";
385 vin-supply = <&vcc_sys>;
386 regulator-compatible = "fan53555-reg";
387 pinctrl-0 = <&vsel1_gpio>;
388 vsel-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
389 regulator-name = "vdd_cpu_b";
390 regulator-min-microvolt = <712500>;
391 regulator-max-microvolt = <1500000>;
392 regulator-ramp-delay = <1000>;
393 fcs,suspend-voltage-selector = <1>;
395 regulator-initial-state = <3>;
396 regulator-state-mem {
397 regulator-off-in-suspend;
402 compatible = "silergy,syr828";
405 vin-supply = <&vcc_sys>;
406 regulator-compatible = "fan53555-reg";
407 pinctrl-0 = <&vsel2_gpio>;
408 vsel-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
409 regulator-name = "vdd_gpu";
410 regulator-min-microvolt = <735000>;
411 regulator-max-microvolt = <1400000>;
412 regulator-ramp-delay = <1000>;
413 fcs,suspend-voltage-selector = <1>;
415 regulator-state-mem {
416 regulator-off-in-suspend;
421 compatible = "rockchip,rk808";
423 interrupt-parent = <&gpio1>;
424 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
425 pinctrl-0 = <&pmic_int_l>;
426 rockchip,system-power-controller;
429 clock-output-names = "xin32k", "rk808-clkout2";
431 vcc1-supply = <&vcc3v3_sys>;
432 vcc2-supply = <&vcc3v3_sys>;
433 vcc3-supply = <&vcc3v3_sys>;
434 vcc4-supply = <&vcc3v3_sys>;
435 vcc6-supply = <&vcc3v3_sys>;
436 vcc7-supply = <&vcc3v3_sys>;
437 vcc8-supply = <&vcc3v3_sys>;
438 vcc9-supply = <&vcc3v3_sys>;
439 vcc10-supply = <&vcc3v3_sys>;
440 vcc11-supply = <&vcc3v3_sys>;
441 vcc12-supply = <&vcc3v3_sys>;
442 vddio-supply = <&vcc1v8_pmu>;
445 vdd_center: DCDC_REG1 {
448 regulator-min-microvolt = <750000>;
449 regulator-max-microvolt = <1350000>;
450 regulator-ramp-delay = <6001>;
451 regulator-name = "vdd_center";
452 regulator-state-mem {
453 regulator-off-in-suspend;
457 vdd_cpu_l: DCDC_REG2 {
460 regulator-min-microvolt = <750000>;
461 regulator-max-microvolt = <1350000>;
462 regulator-ramp-delay = <6001>;
463 regulator-name = "vdd_cpu_l";
464 regulator-state-mem {
465 regulator-off-in-suspend;
472 regulator-name = "vcc_ddr";
473 regulator-state-mem {
474 regulator-on-in-suspend;
481 regulator-min-microvolt = <1800000>;
482 regulator-max-microvolt = <1800000>;
483 regulator-name = "vcc_1v8";
484 regulator-state-mem {
485 regulator-on-in-suspend;
486 regulator-suspend-microvolt = <1800000>;
490 vcc1v8_dvp: LDO_REG1 {
493 regulator-min-microvolt = <1800000>;
494 regulator-max-microvolt = <1800000>;
495 regulator-name = "vcc1v8_dvp";
496 regulator-state-mem {
497 regulator-off-in-suspend;
501 vcc3v0_tp: LDO_REG2 {
504 regulator-min-microvolt = <3000000>;
505 regulator-max-microvolt = <3000000>;
506 regulator-name = "vcc3v0_tp";
507 regulator-state-mem {
508 regulator-off-in-suspend;
512 vcc1v8_pmu: LDO_REG3 {
515 regulator-min-microvolt = <1800000>;
516 regulator-max-microvolt = <1800000>;
517 regulator-name = "vcc1v8_pmu";
518 regulator-state-mem {
519 regulator-on-in-suspend;
520 regulator-suspend-microvolt = <1800000>;
527 regulator-min-microvolt = <1800000>;
528 regulator-max-microvolt = <3300000>;
529 regulator-name = "vcc_sd";
530 regulator-state-mem {
531 regulator-on-in-suspend;
532 regulator-suspend-microvolt = <3300000>;
536 vcca3v0_codec: LDO_REG5 {
539 regulator-min-microvolt = <3000000>;
540 regulator-max-microvolt = <3000000>;
541 regulator-name = "vcca3v0_codec";
542 regulator-state-mem {
543 regulator-off-in-suspend;
550 regulator-min-microvolt = <1500000>;
551 regulator-max-microvolt = <1500000>;
552 regulator-name = "vcc_1v5";
553 regulator-state-mem {
554 regulator-on-in-suspend;
555 regulator-suspend-microvolt = <1500000>;
559 vcca1v8_codec: LDO_REG7 {
562 regulator-min-microvolt = <1800000>;
563 regulator-max-microvolt = <1800000>;
564 regulator-name = "vcca1v8_codec";
565 regulator-state-mem {
566 regulator-off-in-suspend;
573 regulator-min-microvolt = <3000000>;
574 regulator-max-microvolt = <3000000>;
575 regulator-name = "vcc_3v0";
576 regulator-state-mem {
577 regulator-on-in-suspend;
578 regulator-suspend-microvolt = <3000000>;
582 vcc3v3_s3: SWITCH_REG1 {
585 regulator-name = "vcc3v3_s3";
586 regulator-state-mem {
587 regulator-off-in-suspend;
591 vcc3v3_s0: SWITCH_REG2 {
594 regulator-name = "vcc3v3_s0";
595 regulator-state-mem {
596 regulator-off-in-suspend;
605 i2c-scl-rising-time-ns = <140>;
606 i2c-scl-falling-time-ns = <30>;
609 #sound-dai-cells = <0>;
610 compatible = "everest,es8316";
612 clocks = <&cru SCLK_I2S_8CH_OUT>;
613 clock-names = "mclk";
614 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
622 clock-frequency = <100000>;
623 compatible = "hid-over-i2c";
624 interrupt-parent = <&gpio0>;
625 interrupts = <GPIO_B0 IRQ_TYPE_LEVEL_LOW>;
626 pinctrl-names = "default";
627 pinctrl-0 = <&hidkey_irq_gpio>;
629 hid-descr-addr = <0x0001>;
633 compatible = "rockchip,ec-battery";
642 i2c-scl-rising-time-ns = <345>;
643 i2c-scl-falling-time-ns = <11>;
644 clock-frequency = <400000>;
646 touchpad: touchpad@2c {
647 compatible = "hid-over-i2c";
648 interrupt-parent = <&gpio1>;
649 interrupts = <GPIO_C2 IRQ_TYPE_LEVEL_LOW>;
650 pinctrl-names = "default";
651 pinctrl-0 = <&touchpad_irq_gpio>;
653 hid-descr-addr = <0x002c>;
659 clock-frequency = <100000>;
660 bq25700: bq25700@09 {//6a
661 compatible = "ti,bq25700";
663 extcon = <&fusb0>, <&fusb1>;
665 interrupt-parent = <&gpio1>;
666 interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
667 pinctrl-names = "default";
668 pinctrl-0 = <&charger_ok>;
669 ti,charge-current = <2500000>;
670 ti,max-input-voltage = <20000000>;
671 ti,max-input-current = <6000000>;
672 ti,max-charge-voltage = <8750000>;
673 ti,input-current = <500000>;
674 ti,input-current-sdp = <500000>;
675 ti,input-current-dcp = <2000000>;
676 ti,input-current-cdp = <2000000>;
677 ti,minimum-sys-voltage = <7400000>;
678 ti,otg-voltage = <5000000>;
679 ti,otg-current = <500000>;
680 pd-charge-only = <1>;
681 typec0-enable-gpios = <&gpio1 GPIO_A3 GPIO_ACTIVE_HIGH>;
682 typec1-enable-gpios = <&gpio1 GPIO_A4 GPIO_ACTIVE_HIGH>;
683 typec0-discharge-gpios = <&gpio0 GPIO_B4 GPIO_ACTIVE_HIGH>;
684 typec1-discharge-gpios = <&gpio0 GPIO_B5 GPIO_ACTIVE_HIGH>;
690 i2c-scl-rising-time-ns = <345>;
691 i2c-scl-falling-time-ns = <11>;
692 clock-frequency = <400000>;
695 compatible = "fairchild,fusb302";
697 pinctrl-names = "default";
698 pinctrl-0 = <&fusb1_int>;
699 vbus-5v-gpios = <&gpio4 GPIO_D6 GPIO_ACTIVE_LOW>;
700 int-n-gpios = <&gpio1 GPIO_B5 GPIO_ACTIVE_HIGH>;
701 charge-dev = <&bq25700>;
708 i2c-scl-rising-time-ns = <345>;
709 i2c-scl-falling-time-ns = <11>;
710 clock-frequency = <400000>;
713 compatible = "fairchild,fusb302";
715 pinctrl-names = "default";
716 pinctrl-0 = <&fusb0_int>;
717 vbus-5v-gpios = <&gpio4 GPIO_D5 GPIO_ACTIVE_LOW>;
718 int-n-gpios = <&gpio1 GPIO_A2 GPIO_ACTIVE_HIGH>;
719 charge-dev = <&bq25700>;
726 bt656-supply = <&vcc_3v0>;
727 audio-supply = <&vcca1v8_codec>;
728 sdmmc-supply = <&vcc_sd>;
729 gpio1830-supply = <&vcc_3v0>;
738 pmu1830-supply = <&vcc_1v8>;
755 logo,mode = "center";
767 clock-frequency = <50000000>;
768 clock-freq-min-max = <400000 150000000>;
776 vqmmc-supply = <&vcc_sd>;
777 pinctrl-names = "default";
778 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
783 clock-frequency = <150000000>;
784 clock-freq-min-max = <200000 150000000>;
790 keep-power-in-suspend;
791 mmc-pwrseq = <&sdio_pwrseq>;
794 pinctrl-names = "default";
795 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
805 keep-power-in-suspend;
806 mmc-hs400-enhanced-strobe;
812 #sound-dai-cells = <0>;
830 rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
831 rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
839 u2phy0_otg: otg-port {
843 u2phy0_host: host-port {
844 phy-supply = <&vcc5v0_host>;
853 u2phy1_otg: otg-port {
857 u2phy1_host: host-port {
858 phy-supply = <&vcc5v0_host>;
864 pinctrl-names = "default";
865 pinctrl-0 = <&uart0_xfer &uart0_cts>;
913 wifi_enable_h: wifi-enable-h {
914 rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
919 uart0_gpios: uart0-gpios {
920 rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
925 pmic_int_l: pmic-int-l {
927 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
929 vsel1_gpio: vsel1-gpio {
931 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
933 vsel2_gpio: vsel2-gpio {
935 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
941 rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_up>;
946 mh248_irq_gpio: mh248-irq-gpio {
947 rockchip,pins = <0 GPIO_A2 RK_FUNC_GPIO &pcfg_pull_up>;
952 hidkey_irq_gpio: hidkey-irq-gpio {
953 rockchip,pins = <0 GPIO_B0 RK_FUNC_GPIO &pcfg_pull_up>;
958 touchpad_irq_gpio: touchpad-irq-gpio {
959 rockchip,pins = <1 GPIO_C2 RK_FUNC_GPIO &pcfg_pull_up>;
964 charger_ok: charge-ok {
966 <1 23 RK_FUNC_GPIO &pcfg_pull_up>;
971 host_vbus_drv: host-vbus-drv {
973 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
978 fusb0_int: fusb0-int {
980 <1 GPIO_A2 RK_FUNC_GPIO &pcfg_pull_up>;
982 fusb1_int: fusb1-int {
984 <1 GPIO_B5 RK_FUNC_GPIO &pcfg_pull_up>;