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 = "simple-audio-card";
151 simple-audio-card,format = "i2s";
152 simple-audio-card,name = "rockchip,es8316-codec";
153 simple-audio-card,mclk-fs = <256>;
154 simple-audio-card,widgets =
155 "Microphone", "Mic Jack",
156 "Headphone", "Headphone Jack";
157 simple-audio-card,routing =
158 "Mic Jack", "MICBIAS1",
160 "Headphone Jack", "HPOL",
161 "Headphone Jack", "HPOR";
162 simple-audio-card,cpu {
165 simple-audio-card,codec {
166 sound-dai = <&es8316>;
171 compatible = "simple-audio-card";
172 simple-audio-card,name = "rockchip,spdif";
173 simple-audio-card,cpu {
174 sound-dai = <&spdif>;
176 simple-audio-card,codec {
177 sound-dai = <&spdif_out>;
181 spdif_out: spdif-out {
182 compatible = "linux,spdif-dit";
183 #sound-dai-cells = <0>;
186 sdio_pwrseq: sdio-pwrseq {
187 compatible = "mmc-pwrseq-simple";
189 clock-names = "ext_clock";
190 pinctrl-names = "default";
191 pinctrl-0 = <&wifi_enable_h>;
194 * On the module itself this is one of these (depending
195 * on the actual card populated):
196 * - SDIO_RESET_L_WL_REG_ON
197 * - PDN (power down when low)
199 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
203 compatible = "wlan-platdata";
204 rockchip,grf = <&grf>;
205 wifi_chip_type = "ap6354";
207 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
212 compatible = "bluetooth-platdata";
214 clock-names = "ext_clock";
215 //wifi-bt-power-toggle;
216 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
217 pinctrl-names = "default", "rts_gpio";
218 pinctrl-0 = <&uart0_rts>;
219 pinctrl-1 = <&uart0_gpios>;
220 //BT,power_gpio = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */
221 BT,reset_gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
222 BT,wake_gpio = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
223 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
228 compatible = "rockchip,uboot-charge";
229 rockchip,uboot-charge-on = <0>;
230 rockchip,android-charge-on = <1>;
234 compatible = "rk-vibrator-gpio";
235 vibrator-gpio = <&gpio4 30 GPIO_ACTIVE_LOW>;
240 compatible = "rockchip_headset";
241 headset_gpio = <&gpio4 28 GPIO_ACTIVE_HIGH>;
242 pinctrl-names = "default";
243 pinctrl-0 = <&hp_det>;
244 io-channels = <&saradc 2>;
249 compatible = "rockchip,key";
252 io-channels = <&saradc 1>;
257 rockchip,adc_value = <1>;
262 label = "volume down";
263 rockchip,adc_value = <170>;
267 gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
276 rockchip,adc_value = <746>;
282 rockchip,adc_value = <355>;
288 rockchip,adc_value = <560>;
294 rockchip,adc_value = <450>;
299 clock-frequency = <50000000>;
300 clock-freq-min-max = <400000 150000000>;
308 vqmmc-supply = <&vcc_sd>;
309 pinctrl-names = "default";
310 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
315 clock-frequency = <150000000>;
316 clock-freq-min-max = <200000 150000000>;
322 keep-power-in-suspend;
323 mmc-pwrseq = <&sdio_pwrseq>;
326 pinctrl-names = "default";
327 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
341 keep-power-in-suspend;
342 mmc-hs400-enhanced-strobe;
348 rockchip,i2s-broken-burst-len;
349 rockchip,playback-channels = <8>;
350 rockchip,capture-channels = <8>;
351 #sound-dai-cells = <0>;
355 #sound-dai-cells = <0>;
361 bt656-supply = <&vcc1v8_dvp>;
362 audio-supply = <&vcca1v8_codec>;
363 sdmmc-supply = <&vcc_sd>;
364 gpio1830-supply = <&vcc_3v0>;
369 #sound-dai-cells = <0>;
374 i2c-scl-rising-time-ns = <180>;
375 i2c-scl-falling-time-ns = <30>;
376 clock-frequency = <400000>;
378 vdd_cpu_b: syr837@40 {
379 compatible = "silergy,syr827";
381 vin-supply = <&vcc_sys>;
382 regulator-compatible = "fan53555-reg";
383 pinctrl-0 = <&vsel1_gpio>;
384 vsel-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
385 regulator-name = "vdd_cpu_b";
386 regulator-min-microvolt = <712500>;
387 regulator-max-microvolt = <1500000>;
388 regulator-ramp-delay = <1000>;
389 fcs,suspend-voltage-selector = <1>;
391 regulator-initial-state = <3>;
392 regulator-state-mem {
393 regulator-off-in-suspend;
398 compatible = "silergy,syr828";
401 vin-supply = <&vcc_sys>;
402 regulator-compatible = "fan53555-reg";
403 pinctrl-0 = <&vsel2_gpio>;
404 vsel-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
405 regulator-name = "vdd_gpu";
406 regulator-min-microvolt = <735000>;
407 regulator-max-microvolt = <1400000>;
408 regulator-ramp-delay = <1000>;
409 fcs,suspend-voltage-selector = <1>;
411 regulator-state-mem {
412 regulator-off-in-suspend;
417 compatible = "rockchip,rk818";
420 clock-output-names = "xin32k", "wifibt_32kin";
421 interrupt-parent = <&gpio1>;
422 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
423 pinctrl-names = "default";
424 pinctrl-0 = <&pmic_int_l>;
425 rockchip,system-power-controller;
426 rk818,support_dc_chg = <1>;/*1: dc chg; 0:usb chg*/
431 vcc1-supply = <&vcc_sys>;
432 vcc2-supply = <&vcc_sys>;
433 vcc3-supply = <&vcc_sys>;
434 vcc4-supply = <&vcc_sys>;
435 vcc6-supply = <&vcc_sys>;
436 vcc7-supply = <&vcc3v3_sys>;
437 vcc8-supply = <&vcc_sys>;
438 vcc9-supply = <&vcc3v3_sys>;
441 vdd_cpu_l: DCDC_REG1 {
442 regulator-name = "vdd_cpu_l";
445 regulator-min-microvolt = <750000>;
446 regulator-max-microvolt = <1350000>;
447 regulator-ramp-delay = <6001>;
448 regulator-state-mem {
449 regulator-off-in-suspend;
453 vdd_center: DCDC_REG2 {
454 regulator-name = "vdd_center";
457 regulator-min-microvolt = <800000>;
458 regulator-max-microvolt = <1350000>;
459 regulator-ramp-delay = <6001>;
460 regulator-state-mem {
461 regulator-off-in-suspend;
466 regulator-name = "vcc_ddr";
469 regulator-state-mem {
470 regulator-on-in-suspend;
475 regulator-name = "vcc_1v8";
478 regulator-min-microvolt = <1800000>;
479 regulator-max-microvolt = <1800000>;
480 regulator-state-mem {
481 regulator-on-in-suspend;
482 regulator-suspend-microvolt = <1800000>;
486 vcca3v0_codec: LDO_REG1 {
489 regulator-min-microvolt = <3000000>;
490 regulator-max-microvolt = <3000000>;
491 regulator-name = "vcca3v0_codec";
492 regulator-state-mem {
493 regulator-off-in-suspend;
497 vcc3v0_tp: LDO_REG2 {
500 regulator-min-microvolt = <3000000>;
501 regulator-max-microvolt = <3000000>;
502 regulator-name = "vcc3v0_tp";
503 regulator-state-mem {
504 regulator-off-in-suspend;
508 vcca1v8_codec: LDO_REG3 {
511 regulator-min-microvolt = <1800000>;
512 regulator-max-microvolt = <1800000>;
513 regulator-name = "vcca1v8_codec";
514 regulator-state-mem {
515 regulator-off-in-suspend;
519 vcc_power_on: LDO_REG4 {
522 regulator-min-microvolt = <3300000>;
523 regulator-max-microvolt = <3300000>;
524 regulator-name = "vcc_power_on";
525 regulator-state-mem {
526 regulator-on-in-suspend;
527 regulator-suspend-microvolt = <3300000>;
534 regulator-min-microvolt = <3000000>;
535 regulator-max-microvolt = <3000000>;
536 regulator-name = "vcc_3v0";
537 regulator-state-mem {
538 regulator-on-in-suspend;
539 regulator-suspend-microvolt = <3000000>;
546 regulator-min-microvolt = <1500000>;
547 regulator-max-microvolt = <1500000>;
548 regulator-name = "vcc_1v5";
549 regulator-state-mem {
550 regulator-on-in-suspend;
551 regulator-suspend-microvolt = <1500000>;
555 vcc1v8_dvp: LDO_REG7 {
558 regulator-min-microvolt = <1800000>;
559 regulator-max-microvolt = <1800000>;
560 regulator-name = "vcc1v8_dvp";
561 regulator-state-mem {
562 regulator-off-in-suspend;
566 vcc3v3_s3: LDO_REG8 {
569 regulator-min-microvolt = <3300000>;
570 regulator-max-microvolt = <3300000>;
571 regulator-name = "vcc3v3_s3";
572 regulator-state-mem {
573 regulator-off-in-suspend;
580 regulator-min-microvolt = <1800000>;
581 regulator-max-microvolt = <3300000>;
582 regulator-name = "vcc_sd";
583 regulator-state-mem {
584 regulator-on-in-suspend;
585 regulator-suspend-microvolt = <3300000>;
589 vcc3v3_s0: SWITCH_REG {
592 regulator-name = "vcc3v3_s0";
593 regulator-state-mem {
594 regulator-on-in-suspend;
600 compatible = "rk818-battery";
601 ocv_table = <3400 3675 3689 3716 3740 3756 3768 3780
602 3793 3807 3827 3853 3896 3937 3974 4007 4066
603 4110 4161 4217 4308>;
604 design_capacity = <7916>;
605 design_qmax = <8708>;
607 max_input_current = <3000>;
608 max_chrg_current = <3000>;
609 max_chrg_voltage = <4350>;
610 sleep_enter_current = <300>;
611 sleep_exit_current = <300>;
612 power_off_thresd = <3400>;
613 zero_algorithm_vol = <3950>;
614 fb_temperature = <105>;
616 max_soc_offset = <60>;
627 i2c-scl-rising-time-ns = <140>;
628 i2c-scl-falling-time-ns = <30>;
631 #sound-dai-cells = <0>;
632 compatible = "everest,es8316";
634 clocks = <&cru SCLK_I2S_8CH_OUT>;
635 clock-names = "mclk";
636 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
642 i2c-scl-rising-time-ns = <345>;
643 i2c-scl-falling-time-ns = <11>;
644 clock-frequency = <400000>;
648 compatible = "lsm330_acc";
649 pinctrl-names = "default";
650 pinctrl-0 = <&lsm330a_irq_gpio>;
652 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
653 type = <SENSOR_TYPE_ACCEL>;
655 poll_delay_ms = <30>;
656 power-off-in-suspend = <1>;
662 compatible = "lsm330_gyro";
663 pinctrl-names = "default";
664 pinctrl-0 = <&lsm330g_irq_gpio>;
666 irq-gpio = <&gpio1 20 IRQ_TYPE_EDGE_RISING>;
667 type = <SENSOR_TYPE_GYROSCOPE>;
669 power-off-in-suspend = <1>;
670 poll_delay_ms = <30>;
675 compatible = "invensense,mpu6500";
676 pinctrl-names = "default";
677 pinctrl-0 = <&mpu6500_irq_gpio>;
679 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
680 mpu-int_config = <0x10>;
681 mpu-level_shifter = <0>;
682 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
686 support-hw-poweroff = <1>;
692 compatible = "ak8963";
693 pinctrl-names = "default";
694 pinctrl-0 = <&ak8963_irq_gpio>;
696 type = <SENSOR_TYPE_COMPASS>;
697 irq-gpio = <&gpio2 28 IRQ_TYPE_EDGE_RISING>;
699 poll_delay_ms = <30>;
705 compatible = "capella,light_cm3218";
706 pinctrl-names = "default";
707 pinctrl-0 = <&cm3218_irq_gpio>;
709 type = <SENSOR_TYPE_LIGHT>;
710 irq-gpio = <&gpio4 24 IRQ_TYPE_EDGE_FALLING>;
712 poll_delay_ms = <30>;
716 compatible = "fairchild,fusb302";
718 pinctrl-names = "default";
719 pinctrl-0 = <&fusb0_int>;
720 int-n-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
727 i2c-scl-rising-time-ns = <150>;
728 i2c-scl-falling-time-ns = <30>;
729 clock-frequency = <400000>;
732 compatible = "goodix,gt9xx";
734 touch-gpio = <&gpio3 12 IRQ_TYPE_LEVEL_LOW>;
735 reset-gpio = <&gpio3 13 GPIO_ACTIVE_HIGH>;
739 tp-supply = <&vcc3v0_tp>;
752 cpu-supply = <&vdd_cpu_l>;
756 cpu-supply = <&vdd_cpu_l>;
760 cpu-supply = <&vdd_cpu_l>;
764 cpu-supply = <&vdd_cpu_l>;
768 cpu-supply = <&vdd_cpu_b>;
772 cpu-supply = <&vdd_cpu_b>;
777 mali-supply = <&vdd_gpu>;
786 max-freq = <50000000>;
789 compatible = "inv-spi,mpu6500";
790 pinctrl-names = "default";
791 pinctrl-0 = <&mpu6500_irq_gpio>;
792 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
794 spi-max-frequency = <1000000>;
797 mpu-int_config = <0x00>;
798 mpu-level_shifter = <0>;
799 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
803 support-hw-poweroff = <1>;
814 rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
815 rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
823 u2phy0_otg: otg-port {
827 u2phy0_host: host-port {
828 phy-supply = <&vcc5v0_host>;
834 pinctrl-names = "default";
835 pinctrl-0 = <&uart0_xfer &uart0_cts>;
861 assigned-clocks = <&cru SCLK_VOP0_PWM>;
862 assigned-clock-rates = <50000000>;
876 wifi_enable_h: wifi-enable-h {
877 rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
882 uart0_gpios: uart0-gpios {
883 rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
888 pmic_int_l: pmic-int-l {
890 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
893 pmic_dvs2: pmic-dvs2 {
895 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
897 vsel1_gpio: vsel1-gpio {
899 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
901 vsel2_gpio: vsel2-gpio {
903 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
908 mh248_irq_gpio: mh248-irq-gpio {
909 rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>;
915 rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_up>;
920 lcdpwr_enable_h: lcdpwr-enable-h {
921 rockchip,pins = <3 8 RK_FUNC_GPIO &pcfg_pull_up>;
926 lsm330a_irq_gpio: lsm330a-irq-gpio {
927 rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
932 lsm330g_irq_gpio: lsm330g-irq-gpio {
933 rockchip,pins = <1 20 RK_FUNC_GPIO &pcfg_pull_none>;
938 mpu6500_irq_gpio: mpu6500-irq-gpio {
939 rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
944 ak8963_irq_gpio: ak8963-irq-gpio {
945 rockchip,pins = <2 28 RK_FUNC_GPIO &pcfg_pull_none>;
950 cm3218_irq_gpio: cm3218-irq-gpio {
951 rockchip,pins = <4 24 RK_FUNC_GPIO &pcfg_pull_up>;
956 host_vbus_drv: host-vbus-drv {
958 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
963 fusb0_int: fusb0-int {
965 <1 1 RK_FUNC_GPIO &pcfg_pull_up>;
971 #include <dt-bindings/display/screen-timing/lcd-LP097Qx2.dtsi>
982 dp_vop_sel = <DISPLAY_SOURCE_LCDC1>;
987 rockchip,cabc_mode = <1>;
988 power_ctr: power_ctr {
989 rockchip,debug = <0>;
992 rockchip,power_type = <GPIO>;
993 pinctrl-names = "default";
994 pinctrl-0 = <&lcdpwr_enable_h>;
995 gpios = <&gpio3 8 GPIO_ACTIVE_HIGH>;
996 rockchip,delay = <10>;
1019 pmu1830-supply = <&vcc_1v8>;