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";
96 compatible = "pwm-regulator";
97 pwms = <&pwm2 0 25000 0>;
99 rockchip,pwm_voltage = <1000000>;
100 regulator-name = "vdd_log";
101 regulator-min-microvolt = <750000>;
102 regulator-max-microvolt = <1350000>;
107 backlight: backlight {
108 compatible = "pwm-backlight";
109 pwms = <&pwm0 0 25000 0>;
110 brightness-levels = <
111 0 1 51 52 52 53 53 54
112 54 55 55 56 56 57 57 58
113 58 59 59 60 61 61 62 63
114 63 64 65 65 66 67 67 68
115 69 69 70 71 71 72 73 73
116 74 75 75 76 77 77 78 79
117 79 80 80 81 81 82 83 83
118 84 85 86 86 87 88 89 89
119 90 91 92 92 93 94 95 95
120 96 97 98 98 99 100 101 101
121 102 103 104 104 105 106 107 107
122 108 109 110 110 111 112 113 113
123 114 115 116 116 117 118 119 119
124 120 121 122 122 123 124 125 125
125 126 127 128 128 129 130 131 131
126 132 133 134 134 135 136 137 137
127 138 139 140 140 141 142 143 143
128 144 145 146 146 147 148 149 149
129 150 151 152 152 153 154 155 155
130 156 157 158 158 159 160 161 161
131 162 163 164 164 165 166 167 167
132 168 169 170 170 171 172 173 173
133 174 175 176 176 177 178 179 179
134 180 181 182 182 183 184 185 185
135 186 187 188 188 189 190 191 191
136 216 217 218 218 219 220 221 221
137 222 223 224 224 225 226 227 227
138 228 229 230 230 231 232 233 233
139 234 235 236 236 237 238 239 239
140 240 241 242 242 243 244 245 245
141 246 247 248 248 249 250 251 251
142 252 253 254 254 255 255 255 255>;
143 default-brightness-level = <200>;
144 enable-gpios = <&gpio3 GPIO_A4 GPIO_ACTIVE_HIGH>;
147 vcc_phy: vcc-phy-regulator {
148 compatible = "regulator-fixed";
149 regulator-name = "vcc_phy";
155 compatible = "simple-audio-card";
156 simple-audio-card,format = "i2s";
157 simple-audio-card,name = "rockchip,es8316-codec";
158 simple-audio-card,mclk-fs = <256>;
159 simple-audio-card,widgets =
160 "Microphone", "Mic Jack",
161 "Headphone", "Headphone Jack";
162 simple-audio-card,routing =
163 "Mic Jack", "MICBIAS1",
165 "Headphone Jack", "HPOL",
166 "Headphone Jack", "HPOR";
167 simple-audio-card,cpu {
170 simple-audio-card,codec {
171 sound-dai = <&es8316>;
176 compatible = "simple-audio-card";
177 simple-audio-card,name = "rockchip,spdif";
178 simple-audio-card,cpu {
179 sound-dai = <&spdif>;
181 simple-audio-card,codec {
182 sound-dai = <&spdif_out>;
186 spdif_out: spdif-out {
187 compatible = "linux,spdif-dit";
188 #sound-dai-cells = <0>;
191 sdio_pwrseq: sdio-pwrseq {
192 compatible = "mmc-pwrseq-simple";
194 clock-names = "ext_clock";
195 pinctrl-names = "default";
196 pinctrl-0 = <&wifi_enable_h>;
199 * On the module itself this is one of these (depending
200 * on the actual card populated):
201 * - SDIO_RESET_L_WL_REG_ON
202 * - PDN (power down when low)
204 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
208 compatible = "wlan-platdata";
209 rockchip,grf = <&grf>;
210 wifi_chip_type = "ap6354";
212 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
217 compatible = "bluetooth-platdata";
219 clock-names = "ext_clock";
220 //wifi-bt-power-toggle;
221 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
222 pinctrl-names = "default", "rts_gpio";
223 pinctrl-0 = <&uart0_rts>;
224 pinctrl-1 = <&uart0_gpios>;
225 //BT,power_gpio = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */
226 BT,reset_gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
227 BT,wake_gpio = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
228 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
233 compatible = "rockchip,uboot-charge";
234 rockchip,uboot-charge-on = <0>;
235 rockchip,android-charge-on = <1>;
239 compatible = "rk-vibrator-gpio";
240 vibrator-gpio = <&gpio4 30 GPIO_ACTIVE_LOW>;
245 compatible = "rockchip_headset";
246 headset_gpio = <&gpio4 28 GPIO_ACTIVE_HIGH>;
247 pinctrl-names = "default";
248 pinctrl-0 = <&hp_det>;
249 io-channels = <&saradc 2>;
252 hall_sensor: hall-mh248 {
253 compatible = "hall-mh248";
254 pinctrl-names = "default";
255 pinctrl-0 = <&mh248_irq_gpio>;
256 irq-gpio = <&gpio0 GPIO_A1 IRQ_TYPE_EDGE_BOTH>;
263 compatible = "rockchip,key";
266 io-channels = <&saradc 1>;
271 rockchip,adc_value = <1>;
276 label = "volume down";
277 rockchip,adc_value = <170>;
281 gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
290 rockchip,adc_value = <746>;
296 rockchip,adc_value = <355>;
302 rockchip,adc_value = <560>;
308 rockchip,adc_value = <450>;
313 cpu-supply = <&vdd_cpu_l>;
317 cpu-supply = <&vdd_cpu_l>;
321 cpu-supply = <&vdd_cpu_l>;
325 cpu-supply = <&vdd_cpu_l>;
329 cpu-supply = <&vdd_cpu_b>;
333 cpu-supply = <&vdd_cpu_b>;
342 #address-cells = <1>;
344 edp_out_panel: endpoint@0 {
346 remote-endpoint = <&panel_in_edp>;
358 mali-supply = <&vdd_gpu>;
367 rockchip,i2s-broken-burst-len;
368 rockchip,playback-channels = <8>;
369 rockchip,capture-channels = <8>;
370 #sound-dai-cells = <0>;
374 #sound-dai-cells = <0>;
379 i2c-scl-rising-time-ns = <180>;
380 i2c-scl-falling-time-ns = <30>;
381 clock-frequency = <400000>;
383 vdd_cpu_b: syr837@40 {
384 compatible = "silergy,syr827";
386 vin-supply = <&vcc_sys>;
387 regulator-compatible = "fan53555-reg";
388 pinctrl-0 = <&vsel1_gpio>;
389 vsel-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
390 regulator-name = "vdd_cpu_b";
391 regulator-min-microvolt = <712500>;
392 regulator-max-microvolt = <1500000>;
393 regulator-ramp-delay = <1000>;
394 fcs,suspend-voltage-selector = <1>;
396 regulator-initial-state = <3>;
397 regulator-state-mem {
398 regulator-off-in-suspend;
403 compatible = "silergy,syr828";
406 vin-supply = <&vcc_sys>;
407 regulator-compatible = "fan53555-reg";
408 pinctrl-0 = <&vsel2_gpio>;
409 vsel-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
410 regulator-name = "vdd_gpu";
411 regulator-min-microvolt = <735000>;
412 regulator-max-microvolt = <1400000>;
413 regulator-ramp-delay = <1000>;
414 fcs,suspend-voltage-selector = <1>;
416 regulator-state-mem {
417 regulator-off-in-suspend;
422 compatible = "rockchip,rk808";
424 interrupt-parent = <&gpio1>;
425 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
426 pinctrl-0 = <&pmic_int_l>;
427 rockchip,system-power-controller;
430 clock-output-names = "xin32k", "rk808-clkout2";
432 vcc1-supply = <&vcc3v3_sys>;
433 vcc2-supply = <&vcc3v3_sys>;
434 vcc3-supply = <&vcc3v3_sys>;
435 vcc4-supply = <&vcc3v3_sys>;
436 vcc6-supply = <&vcc3v3_sys>;
437 vcc7-supply = <&vcc3v3_sys>;
438 vcc8-supply = <&vcc3v3_sys>;
439 vcc9-supply = <&vcc3v3_sys>;
440 vcc10-supply = <&vcc3v3_sys>;
441 vcc11-supply = <&vcc3v3_sys>;
442 vcc12-supply = <&vcc3v3_sys>;
443 vddio-supply = <&vcc1v8_pmu>;
446 vdd_center: DCDC_REG1 {
449 regulator-min-microvolt = <750000>;
450 regulator-max-microvolt = <1350000>;
451 regulator-ramp-delay = <6001>;
452 regulator-name = "vdd_center";
453 regulator-state-mem {
454 regulator-off-in-suspend;
458 vdd_cpu_l: DCDC_REG2 {
461 regulator-min-microvolt = <750000>;
462 regulator-max-microvolt = <1350000>;
463 regulator-ramp-delay = <6001>;
464 regulator-name = "vdd_cpu_l";
465 regulator-state-mem {
466 regulator-off-in-suspend;
473 regulator-name = "vcc_ddr";
474 regulator-state-mem {
475 regulator-on-in-suspend;
482 regulator-min-microvolt = <1800000>;
483 regulator-max-microvolt = <1800000>;
484 regulator-name = "vcc_1v8";
485 regulator-state-mem {
486 regulator-on-in-suspend;
487 regulator-suspend-microvolt = <1800000>;
491 vcc1v8_dvp: LDO_REG1 {
494 regulator-min-microvolt = <1800000>;
495 regulator-max-microvolt = <1800000>;
496 regulator-name = "vcc1v8_dvp";
497 regulator-state-mem {
498 regulator-off-in-suspend;
502 vcc3v0_tp: LDO_REG2 {
505 regulator-min-microvolt = <3000000>;
506 regulator-max-microvolt = <3000000>;
507 regulator-name = "vcc3v0_tp";
508 regulator-state-mem {
509 regulator-off-in-suspend;
513 vcc1v8_pmu: LDO_REG3 {
516 regulator-min-microvolt = <1800000>;
517 regulator-max-microvolt = <1800000>;
518 regulator-name = "vcc1v8_pmu";
519 regulator-state-mem {
520 regulator-on-in-suspend;
521 regulator-suspend-microvolt = <1800000>;
528 regulator-min-microvolt = <1800000>;
529 regulator-max-microvolt = <3300000>;
530 regulator-name = "vcc_sd";
531 regulator-state-mem {
532 regulator-on-in-suspend;
533 regulator-suspend-microvolt = <3300000>;
537 vcca3v0_codec: LDO_REG5 {
540 regulator-min-microvolt = <3000000>;
541 regulator-max-microvolt = <3000000>;
542 regulator-name = "vcca3v0_codec";
543 regulator-state-mem {
544 regulator-off-in-suspend;
551 regulator-min-microvolt = <1500000>;
552 regulator-max-microvolt = <1500000>;
553 regulator-name = "vcc_1v5";
554 regulator-state-mem {
555 regulator-on-in-suspend;
556 regulator-suspend-microvolt = <1500000>;
560 vcca1v8_codec: LDO_REG7 {
563 regulator-min-microvolt = <1800000>;
564 regulator-max-microvolt = <1800000>;
565 regulator-name = "vcca1v8_codec";
566 regulator-state-mem {
567 regulator-off-in-suspend;
574 regulator-min-microvolt = <3000000>;
575 regulator-max-microvolt = <3000000>;
576 regulator-name = "vcc_3v0";
577 regulator-state-mem {
578 regulator-on-in-suspend;
579 regulator-suspend-microvolt = <3000000>;
583 vcc3v3_s3: SWITCH_REG1 {
586 regulator-name = "vcc3v3_s3";
587 regulator-state-mem {
588 regulator-off-in-suspend;
592 vcc3v3_s0: SWITCH_REG2 {
595 regulator-name = "vcc3v3_s0";
596 regulator-state-mem {
597 regulator-off-in-suspend;
606 i2c-scl-rising-time-ns = <140>;
607 i2c-scl-falling-time-ns = <30>;
610 #sound-dai-cells = <0>;
611 compatible = "everest,es8316";
613 clocks = <&cru SCLK_I2S_8CH_OUT>;
614 clock-names = "mclk";
615 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
623 clock-frequency = <100000>;
624 compatible = "hid-over-i2c";
625 interrupt-parent = <&gpio0>;
626 interrupts = <GPIO_B0 IRQ_TYPE_LEVEL_LOW>;
627 pinctrl-names = "default";
628 pinctrl-0 = <&hidkey_irq_gpio>;
630 hid-descr-addr = <0x0001>;
634 compatible = "rockchip,ec-battery";
643 i2c-scl-rising-time-ns = <345>;
644 i2c-scl-falling-time-ns = <11>;
645 clock-frequency = <400000>;
647 touchpad: touchpad@2c {
648 compatible = "hid-over-i2c";
649 interrupt-parent = <&gpio1>;
650 interrupts = <GPIO_C2 IRQ_TYPE_LEVEL_LOW>;
651 pinctrl-names = "default";
652 pinctrl-0 = <&touchpad_irq_gpio>;
654 hid-descr-addr = <0x002c>;
660 clock-frequency = <100000>;
661 bq25700: bq25700@09 {//6a
662 compatible = "ti,bq25700";
664 extcon = <&fusb0>, <&fusb1>;
666 interrupt-parent = <&gpio1>;
667 interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
668 pinctrl-names = "default";
669 pinctrl-0 = <&charger_ok>;
670 ti,charge-current = <2500000>;
671 ti,max-input-voltage = <20000000>;
672 ti,max-input-current = <6000000>;
673 ti,max-charge-voltage = <8750000>;
674 ti,input-current = <500000>;
675 ti,input-current-sdp = <500000>;
676 ti,input-current-dcp = <2000000>;
677 ti,input-current-cdp = <2000000>;
678 ti,minimum-sys-voltage = <7400000>;
679 ti,otg-voltage = <5000000>;
680 ti,otg-current = <500000>;
681 pd-charge-only = <1>;
682 typec0-enable-gpios = <&gpio1 GPIO_A3 GPIO_ACTIVE_HIGH>;
683 typec1-enable-gpios = <&gpio1 GPIO_A4 GPIO_ACTIVE_HIGH>;
684 typec0-discharge-gpios = <&gpio0 GPIO_B4 GPIO_ACTIVE_HIGH>;
685 typec1-discharge-gpios = <&gpio0 GPIO_B5 GPIO_ACTIVE_HIGH>;
691 i2c-scl-rising-time-ns = <345>;
692 i2c-scl-falling-time-ns = <11>;
693 clock-frequency = <400000>;
696 compatible = "fairchild,fusb302";
698 pinctrl-names = "default";
699 pinctrl-0 = <&fusb1_int>;
700 vbus-5v-gpios = <&gpio4 GPIO_D6 GPIO_ACTIVE_LOW>;
701 int-n-gpios = <&gpio1 GPIO_B5 GPIO_ACTIVE_HIGH>;
702 charge-dev = <&bq25700>;
709 i2c-scl-rising-time-ns = <345>;
710 i2c-scl-falling-time-ns = <11>;
711 clock-frequency = <400000>;
714 compatible = "fairchild,fusb302";
716 pinctrl-names = "default";
717 pinctrl-0 = <&fusb0_int>;
718 vbus-5v-gpios = <&gpio4 GPIO_D5 GPIO_ACTIVE_LOW>;
719 int-n-gpios = <&gpio1 GPIO_A2 GPIO_ACTIVE_HIGH>;
720 charge-dev = <&bq25700>;
727 bt656-supply = <&vcc_3v0>;
728 audio-supply = <&vcca1v8_codec>;
729 sdmmc-supply = <&vcc_sd>;
730 gpio1830-supply = <&vcc_3v0>;
739 pmu1830-supply = <&vcc_1v8>;
756 logo,mode = "center";
768 clock-frequency = <50000000>;
769 clock-freq-min-max = <400000 150000000>;
777 vqmmc-supply = <&vcc_sd>;
778 pinctrl-names = "default";
779 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
784 clock-frequency = <150000000>;
785 clock-freq-min-max = <200000 150000000>;
791 keep-power-in-suspend;
792 mmc-pwrseq = <&sdio_pwrseq>;
795 pinctrl-names = "default";
796 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
806 keep-power-in-suspend;
807 mmc-hs400-enhanced-strobe;
813 #sound-dai-cells = <0>;
831 rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
832 rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
840 u2phy0_otg: otg-port {
844 u2phy0_host: host-port {
845 phy-supply = <&vcc5v0_host>;
854 u2phy1_otg: otg-port {
858 u2phy1_host: host-port {
859 phy-supply = <&vcc5v0_host>;
865 pinctrl-names = "default";
866 pinctrl-0 = <&uart0_xfer &uart0_cts>;
914 wifi_enable_h: wifi-enable-h {
915 rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
920 uart0_gpios: uart0-gpios {
921 rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
926 pmic_int_l: pmic-int-l {
928 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
930 vsel1_gpio: vsel1-gpio {
932 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
934 vsel2_gpio: vsel2-gpio {
936 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
942 rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_up>;
947 mh248_irq_gpio: mh248-irq-gpio {
948 rockchip,pins = <0 GPIO_A2 RK_FUNC_GPIO &pcfg_pull_up>;
953 hidkey_irq_gpio: hidkey-irq-gpio {
954 rockchip,pins = <0 GPIO_B0 RK_FUNC_GPIO &pcfg_pull_up>;
959 touchpad_irq_gpio: touchpad-irq-gpio {
960 rockchip,pins = <1 GPIO_C2 RK_FUNC_GPIO &pcfg_pull_up>;
965 charger_ok: charge-ok {
967 <1 23 RK_FUNC_GPIO &pcfg_pull_up>;
972 host_vbus_drv: host-vbus-drv {
974 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
979 fusb0_int: fusb0-int {
981 <1 GPIO_A2 RK_FUNC_GPIO &pcfg_pull_up>;
983 fusb1_int: fusb1-int {
985 <1 GPIO_B5 RK_FUNC_GPIO &pcfg_pull_up>;