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.
45 #include "rk3399.dtsi"
46 #include "rk3399-android.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 hall_sensor: hall-mh248 {
55 compatible = "hall-mh248";
56 pinctrl-names = "default";
57 pinctrl-0 = <&mh248_irq_gpio>;
58 irq-gpio = <&gpio1 2 IRQ_TYPE_EDGE_BOTH>;
64 compatible = "regulator-fixed";
65 regulator-name = "vcc_sys";
68 regulator-min-microvolt = <3900000>;
69 regulator-max-microvolt = <3900000>;
72 vcc3v3_sys: vcc3v3-sys {
73 compatible = "regulator-fixed";
74 regulator-name = "vcc3v3_sys";
77 regulator-min-microvolt = <3300000>;
78 regulator-max-microvolt = <3300000>;
81 vcc5v0_host: vcc5v0-host-regulator {
82 compatible = "regulator-fixed";
84 gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>;
85 pinctrl-names = "default";
86 pinctrl-0 = <&host_vbus_drv>;
87 regulator-name = "vcc5v0_host";
91 compatible = "pwm-regulator";
92 pwms = <&pwm2 0 25000 0>;
94 rockchip,pwm_voltage = <900000>;
95 regulator-name = "vdd_log";
96 regulator-min-microvolt = <750000>;
97 regulator-max-microvolt = <1350000>;
102 backlight: backlight {
103 compatible = "pwm-backlight";
104 pwms = <&vop0_pwm 0 25000 PWM_POLARITY_INVERTED>;
105 brightness-levels = <
106 0 1 51 52 52 53 53 54
107 54 55 55 56 56 57 57 58
108 58 59 59 60 61 61 62 63
109 63 64 65 65 66 67 67 68
110 69 69 70 71 71 72 73 73
111 74 75 75 76 77 77 78 79
112 79 80 80 81 81 82 83 83
113 84 85 86 86 87 88 89 89
114 90 91 92 92 93 94 95 95
115 96 97 98 98 99 100 101 101
116 102 103 104 104 105 106 107 107
117 108 109 110 110 111 112 113 113
118 114 115 116 116 117 118 119 119
119 120 121 122 122 123 124 125 125
120 126 127 128 128 129 130 131 131
121 132 133 134 134 135 136 137 137
122 138 139 140 140 141 142 143 143
123 144 145 146 146 147 148 149 149
124 150 151 152 152 153 154 155 155
125 156 157 158 158 159 160 161 161
126 162 163 164 164 165 166 167 167
127 168 169 170 170 171 172 173 173
128 174 175 176 176 177 178 179 179
129 180 181 182 182 183 184 185 185
130 186 187 188 188 189 190 191 191
131 216 217 218 218 219 220 221 221
132 222 223 224 224 225 226 227 227
133 228 229 230 230 231 232 233 233
134 234 235 236 236 237 238 239 239
135 240 241 242 242 243 244 245 245
136 246 247 248 248 249 250 251 251
137 252 253 254 254 255 255 255 255>;
138 default-brightness-level = <200>;
139 enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
142 vcc_phy: vcc-phy-regulator {
143 compatible = "regulator-fixed";
144 regulator-name = "vcc_phy";
150 compatible = "rockchip,rk3399-pmu-io-voltage-domain";
151 rockchip,grf = <&pmugrf>;
153 pmu1830-supply = <&vcc_1v8>;
157 compatible = "simple-audio-card";
158 simple-audio-card,format = "i2s";
159 simple-audio-card,name = "rockchip,es8316-codec";
160 simple-audio-card,mclk-fs = <256>;
161 simple-audio-card,widgets =
162 "Microphone", "Mic Jack",
163 "Headphone", "Headphone Jack";
164 simple-audio-card,routing =
165 "Mic Jack", "MICBIAS1",
167 "Headphone Jack", "HPOL",
168 "Headphone Jack", "HPOR";
169 simple-audio-card,cpu {
172 simple-audio-card,codec {
173 sound-dai = <&es8316>;
178 compatible = "simple-audio-card";
179 simple-audio-card,name = "rockchip,spdif";
180 simple-audio-card,cpu {
181 sound-dai = <&spdif>;
183 simple-audio-card,codec {
184 sound-dai = <&spdif_out>;
188 spdif_out: spdif-out {
189 compatible = "linux,spdif-dit";
190 #sound-dai-cells = <0>;
193 sdio_pwrseq: sdio-pwrseq {
194 compatible = "mmc-pwrseq-simple";
196 clock-names = "ext_clock";
197 pinctrl-names = "default";
198 pinctrl-0 = <&wifi_enable_h>;
201 * On the module itself this is one of these (depending
202 * on the actual card populated):
203 * - SDIO_RESET_L_WL_REG_ON
204 * - PDN (power down when low)
206 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
210 compatible = "wlan-platdata";
211 rockchip,grf = <&grf>;
212 wifi_chip_type = "ap6354";
214 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
219 compatible = "bluetooth-platdata";
221 clock-names = "ext_clock";
222 //wifi-bt-power-toggle;
223 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
224 pinctrl-names = "default", "rts_gpio";
225 pinctrl-0 = <&uart0_rts>;
226 pinctrl-1 = <&uart0_gpios>;
227 //BT,power_gpio = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */
228 BT,reset_gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
229 BT,wake_gpio = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
230 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
235 compatible = "rockchip,uboot-charge";
236 rockchip,uboot-charge-on = <0>;
237 rockchip,android-charge-on = <1>;
241 compatible = "rk-vibrator-gpio";
242 vibrator-gpio = <&gpio4 30 GPIO_ACTIVE_LOW>;
247 compatible = "rockchip_headset";
248 headset_gpio = <&gpio4 28 GPIO_ACTIVE_HIGH>;
249 pinctrl-names = "default";
250 pinctrl-0 = <&hp_det>;
251 io-channels = <&saradc 2>;
256 compatible = "rockchip,key";
259 io-channels = <&saradc 1>;
264 rockchip,adc_value = <1>;
269 label = "volume down";
270 rockchip,adc_value = <170>;
274 gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
283 rockchip,adc_value = <746>;
289 rockchip,adc_value = <355>;
295 rockchip,adc_value = <560>;
301 rockchip,adc_value = <450>;
306 clock-frequency = <50000000>;
307 clock-freq-min-max = <400000 150000000>;
315 vqmmc-supply = <&vcc_sd>;
316 pinctrl-names = "default";
317 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
322 clock-frequency = <150000000>;
323 clock-freq-min-max = <200000 150000000>;
329 keep-power-in-suspend;
330 mmc-pwrseq = <&sdio_pwrseq>;
333 pinctrl-names = "default";
334 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
348 keep-power-in-suspend;
349 mmc-hs400-enhanced-strobe;
355 rockchip,i2s-broken-burst-len;
356 rockchip,playback-channels = <8>;
357 rockchip,capture-channels = <8>;
358 #sound-dai-cells = <0>;
362 #sound-dai-cells = <0>;
368 bt656-supply = <&vcc1v8_dvp>;
369 audio-supply = <&vcca1v8_codec>;
370 sdmmc-supply = <&vcc_sd>;
371 gpio1830-supply = <&vcc_3v0>;
376 #sound-dai-cells = <0>;
381 i2c-scl-rising-time-ns = <180>;
382 i2c-scl-falling-time-ns = <30>;
383 clock-frequency = <400000>;
385 vdd_cpu_b: syr837@40 {
386 compatible = "silergy,syr827";
388 vin-supply = <&vcc_sys>;
389 regulator-compatible = "fan53555-reg";
390 pinctrl-0 = <&vsel1_gpio>;
391 vsel-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
392 regulator-name = "vdd_cpu_b";
393 regulator-min-microvolt = <712500>;
394 regulator-max-microvolt = <1500000>;
395 regulator-ramp-delay = <1000>;
396 fcs,suspend-voltage-selector = <1>;
398 regulator-initial-state = <3>;
399 regulator-state-mem {
400 regulator-off-in-suspend;
405 compatible = "silergy,syr828";
408 vin-supply = <&vcc_sys>;
409 regulator-compatible = "fan53555-reg";
410 pinctrl-0 = <&vsel2_gpio>;
411 vsel-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
412 regulator-name = "vdd_gpu";
413 regulator-min-microvolt = <735000>;
414 regulator-max-microvolt = <1400000>;
415 regulator-ramp-delay = <1000>;
416 fcs,suspend-voltage-selector = <1>;
418 regulator-state-mem {
419 regulator-off-in-suspend;
424 compatible = "rockchip,rk818";
427 clock-output-names = "xin32k", "wifibt_32kin";
428 interrupt-parent = <&gpio1>;
429 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
430 pinctrl-names = "default";
431 pinctrl-0 = <&pmic_int_l>;
432 rockchip,system-power-controller;
433 rk818,support_dc_chg = <1>;/*1: dc chg; 0:usb chg*/
438 vcc1-supply = <&vcc_sys>;
439 vcc2-supply = <&vcc_sys>;
440 vcc3-supply = <&vcc_sys>;
441 vcc4-supply = <&vcc_sys>;
442 vcc6-supply = <&vcc_sys>;
443 vcc7-supply = <&vcc3v3_sys>;
444 vcc8-supply = <&vcc_sys>;
445 vcc9-supply = <&vcc3v3_sys>;
448 vdd_cpu_l: DCDC_REG1 {
449 regulator-name = "vdd_cpu_l";
452 regulator-min-microvolt = <750000>;
453 regulator-max-microvolt = <1350000>;
454 regulator-ramp-delay = <6001>;
455 regulator-state-mem {
456 regulator-off-in-suspend;
460 vdd_center: DCDC_REG2 {
461 regulator-name = "vdd_center";
464 regulator-min-microvolt = <800000>;
465 regulator-max-microvolt = <1350000>;
466 regulator-ramp-delay = <6001>;
467 regulator-state-mem {
468 regulator-off-in-suspend;
473 regulator-name = "vcc_ddr";
476 regulator-state-mem {
477 regulator-on-in-suspend;
482 regulator-name = "vcc_1v8";
485 regulator-min-microvolt = <1800000>;
486 regulator-max-microvolt = <1800000>;
487 regulator-state-mem {
488 regulator-on-in-suspend;
489 regulator-suspend-microvolt = <1800000>;
493 vcca3v0_codec: LDO_REG1 {
496 regulator-min-microvolt = <3000000>;
497 regulator-max-microvolt = <3000000>;
498 regulator-name = "vcca3v0_codec";
499 regulator-state-mem {
500 regulator-off-in-suspend;
504 vcc3v0_tp: LDO_REG2 {
507 regulator-min-microvolt = <3000000>;
508 regulator-max-microvolt = <3000000>;
509 regulator-name = "vcc3v0_tp";
510 regulator-state-mem {
511 regulator-off-in-suspend;
515 vcca1v8_codec: LDO_REG3 {
518 regulator-min-microvolt = <1800000>;
519 regulator-max-microvolt = <1800000>;
520 regulator-name = "vcca1v8_codec";
521 regulator-state-mem {
522 regulator-off-in-suspend;
526 vcc_power_on: LDO_REG4 {
529 regulator-min-microvolt = <3300000>;
530 regulator-max-microvolt = <3300000>;
531 regulator-name = "vcc_power_on";
532 regulator-state-mem {
533 regulator-on-in-suspend;
534 regulator-suspend-microvolt = <3300000>;
541 regulator-min-microvolt = <3000000>;
542 regulator-max-microvolt = <3000000>;
543 regulator-name = "vcc_3v0";
544 regulator-state-mem {
545 regulator-on-in-suspend;
546 regulator-suspend-microvolt = <3000000>;
553 regulator-min-microvolt = <1500000>;
554 regulator-max-microvolt = <1500000>;
555 regulator-name = "vcc_1v5";
556 regulator-state-mem {
557 regulator-on-in-suspend;
558 regulator-suspend-microvolt = <1500000>;
562 vcc1v8_dvp: LDO_REG7 {
565 regulator-min-microvolt = <1800000>;
566 regulator-max-microvolt = <1800000>;
567 regulator-name = "vcc1v8_dvp";
568 regulator-state-mem {
569 regulator-off-in-suspend;
573 vcc3v3_s3: LDO_REG8 {
576 regulator-min-microvolt = <3300000>;
577 regulator-max-microvolt = <3300000>;
578 regulator-name = "vcc3v3_s3";
579 regulator-state-mem {
580 regulator-off-in-suspend;
587 regulator-min-microvolt = <1800000>;
588 regulator-max-microvolt = <3300000>;
589 regulator-name = "vcc_sd";
590 regulator-state-mem {
591 regulator-on-in-suspend;
592 regulator-suspend-microvolt = <3300000>;
596 vcc3v3_s0: SWITCH_REG {
599 regulator-name = "vcc3v3_s0";
600 regulator-state-mem {
601 regulator-on-in-suspend;
607 compatible = "rk818-battery";
608 ocv_table = <3400 3675 3689 3716 3740 3756 3768 3780
609 3793 3807 3827 3853 3896 3937 3974 4007 4066
610 4110 4161 4217 4308>;
611 design_capacity = <7916>;
612 design_qmax = <8708>;
614 max_input_current = <3000>;
615 max_chrg_current = <3000>;
616 max_chrg_voltage = <4350>;
617 sleep_enter_current = <300>;
618 sleep_exit_current = <300>;
619 power_off_thresd = <3400>;
620 zero_algorithm_vol = <3950>;
621 fb_temperature = <105>;
623 max_soc_offset = <60>;
634 i2c-scl-rising-time-ns = <140>;
635 i2c-scl-falling-time-ns = <30>;
638 #sound-dai-cells = <0>;
639 compatible = "everest,es8316";
641 clocks = <&cru SCLK_I2S_8CH_OUT>;
642 clock-names = "mclk";
643 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
649 i2c-scl-rising-time-ns = <345>;
650 i2c-scl-falling-time-ns = <11>;
651 clock-frequency = <400000>;
655 compatible = "lsm330_acc";
656 pinctrl-names = "default";
657 pinctrl-0 = <&lsm330a_irq_gpio>;
659 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
660 type = <SENSOR_TYPE_ACCEL>;
662 poll_delay_ms = <30>;
663 power-off-in-suspend = <1>;
669 compatible = "lsm330_gyro";
670 pinctrl-names = "default";
671 pinctrl-0 = <&lsm330g_irq_gpio>;
673 irq-gpio = <&gpio1 20 IRQ_TYPE_EDGE_RISING>;
674 type = <SENSOR_TYPE_GYROSCOPE>;
676 power-off-in-suspend = <1>;
677 poll_delay_ms = <30>;
682 compatible = "invensense,mpu6500";
683 pinctrl-names = "default";
684 pinctrl-0 = <&mpu6500_irq_gpio>;
686 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
687 mpu-int_config = <0x10>;
688 mpu-level_shifter = <0>;
689 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
693 support-hw-poweroff = <1>;
699 compatible = "ak8963";
700 pinctrl-names = "default";
701 pinctrl-0 = <&ak8963_irq_gpio>;
703 type = <SENSOR_TYPE_COMPASS>;
704 irq-gpio = <&gpio2 28 IRQ_TYPE_EDGE_RISING>;
706 poll_delay_ms = <30>;
712 compatible = "capella,light_cm3218";
713 pinctrl-names = "default";
714 pinctrl-0 = <&cm3218_irq_gpio>;
716 type = <SENSOR_TYPE_LIGHT>;
717 irq-gpio = <&gpio4 24 IRQ_TYPE_EDGE_FALLING>;
719 poll_delay_ms = <30>;
723 compatible = "fairchild,fusb302";
725 pinctrl-names = "default";
726 pinctrl-0 = <&fusb0_int>;
727 int-n-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
734 i2c-scl-rising-time-ns = <150>;
735 i2c-scl-falling-time-ns = <30>;
736 clock-frequency = <400000>;
739 compatible = "goodix,gt9xx";
741 touch-gpio = <&gpio3 12 IRQ_TYPE_LEVEL_LOW>;
742 reset-gpio = <&gpio3 13 GPIO_ACTIVE_HIGH>;
746 tp-supply = <&vcc3v0_tp>;
759 cpu-supply = <&vdd_cpu_l>;
763 cpu-supply = <&vdd_cpu_l>;
767 cpu-supply = <&vdd_cpu_l>;
771 cpu-supply = <&vdd_cpu_l>;
775 cpu-supply = <&vdd_cpu_b>;
779 cpu-supply = <&vdd_cpu_b>;
784 mali-supply = <&vdd_gpu>;
793 max-freq = <50000000>;
796 compatible = "inv-spi,mpu6500";
797 pinctrl-names = "default";
798 pinctrl-0 = <&mpu6500_irq_gpio>;
799 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
801 spi-max-frequency = <1000000>;
804 mpu-int_config = <0x00>;
805 mpu-level_shifter = <0>;
806 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
810 support-hw-poweroff = <1>;
821 rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
822 rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
830 u2phy0_otg: otg-port {
834 u2phy0_host: host-port {
835 phy-supply = <&vcc5v0_host>;
841 pinctrl-names = "default";
842 pinctrl-0 = <&uart0_xfer &uart0_cts>;
868 assigned-clocks = <&cru SCLK_VOP0_PWM>;
869 assigned-clock-rates = <50000000>;
883 wifi_enable_h: wifi-enable-h {
884 rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
889 uart0_gpios: uart0-gpios {
890 rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
895 pmic_int_l: pmic-int-l {
897 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
900 pmic_dvs2: pmic-dvs2 {
902 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
904 vsel1_gpio: vsel1-gpio {
906 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
908 vsel2_gpio: vsel2-gpio {
910 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
915 mh248_irq_gpio: mh248-irq-gpio {
916 rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>;
922 rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_up>;
927 lcdpwr_enable_h: lcdpwr-enable-h {
928 rockchip,pins = <3 8 RK_FUNC_GPIO &pcfg_pull_up>;
933 lsm330a_irq_gpio: lsm330a-irq-gpio {
934 rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
939 lsm330g_irq_gpio: lsm330g-irq-gpio {
940 rockchip,pins = <1 20 RK_FUNC_GPIO &pcfg_pull_none>;
945 mpu6500_irq_gpio: mpu6500-irq-gpio {
946 rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
951 ak8963_irq_gpio: ak8963-irq-gpio {
952 rockchip,pins = <2 28 RK_FUNC_GPIO &pcfg_pull_none>;
957 cm3218_irq_gpio: cm3218-irq-gpio {
958 rockchip,pins = <4 24 RK_FUNC_GPIO &pcfg_pull_up>;
963 host_vbus_drv: host-vbus-drv {
965 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
970 fusb0_int: fusb0-int {
972 <1 1 RK_FUNC_GPIO &pcfg_pull_up>;
978 #include <dt-bindings/display/screen-timing/lcd-LP097Qx2.dtsi>
989 dp_vop_sel = <DISPLAY_SOURCE_LCDC1>;
994 rockchip,cabc_mode = <1>;
995 power_ctr: power_ctr {
996 rockchip,debug = <0>;
999 rockchip,power_type = <GPIO>;
1000 pinctrl-names = "default";
1001 pinctrl-0 = <&lcdpwr_enable_h>;
1002 gpios = <&gpio3 8 GPIO_ACTIVE_HIGH>;
1003 rockchip,delay = <10>;