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-6.0.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";
92 compatible = "pwm-regulator";
93 pwms = <&pwm2 0 25000 1>;
95 rockchip,pwm_voltage = <900000>;
96 regulator-name = "vdd_log";
97 regulator-min-microvolt = <750000>;
98 regulator-max-microvolt = <1350000>;
103 backlight: backlight {
104 compatible = "pwm-backlight";
105 pwms = <&vop0_pwm 0 25000 PWM_POLARITY_INVERTED>;
106 brightness-levels = <
107 0 1 51 52 52 53 53 54
108 54 55 55 56 56 57 57 58
109 58 59 59 60 61 61 62 63
110 63 64 65 65 66 67 67 68
111 69 69 70 71 71 72 73 73
112 74 75 75 76 77 77 78 79
113 79 80 80 81 81 82 83 83
114 84 85 86 86 87 88 89 89
115 90 91 92 92 93 94 95 95
116 96 97 98 98 99 100 101 101
117 102 103 104 104 105 106 107 107
118 108 109 110 110 111 112 113 113
119 114 115 116 116 117 118 119 119
120 120 121 122 122 123 124 125 125
121 126 127 128 128 129 130 131 131
122 132 133 134 134 135 136 137 137
123 138 139 140 140 141 142 143 143
124 144 145 146 146 147 148 149 149
125 150 151 152 152 153 154 155 155
126 156 157 158 158 159 160 161 161
127 162 163 164 164 165 166 167 167
128 168 169 170 170 171 172 173 173
129 174 175 176 176 177 178 179 179
130 180 181 182 182 183 184 185 185
131 186 187 188 188 189 190 191 191
132 216 217 218 218 219 220 221 221
133 222 223 224 224 225 226 227 227
134 228 229 230 230 231 232 233 233
135 234 235 236 236 237 238 239 239
136 240 241 242 242 243 244 245 245
137 246 247 248 248 249 250 251 251
138 252 253 254 254 255 255 255 255>;
139 default-brightness-level = <200>;
140 enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
143 vcc_phy: vcc-phy-regulator {
144 compatible = "regulator-fixed";
145 regulator-name = "vcc_phy";
151 compatible = "simple-audio-card";
152 simple-audio-card,format = "i2s";
153 simple-audio-card,name = "rockchip,es8316-codec";
154 simple-audio-card,mclk-fs = <256>;
155 simple-audio-card,widgets =
156 "Microphone", "Mic Jack",
157 "Headphone", "Headphone Jack";
158 simple-audio-card,routing =
159 "Mic Jack", "MICBIAS1",
161 "Headphone Jack", "HPOL",
162 "Headphone Jack", "HPOR";
163 simple-audio-card,cpu {
166 simple-audio-card,codec {
167 sound-dai = <&es8316>;
172 compatible = "simple-audio-card";
173 simple-audio-card,name = "rockchip,spdif";
174 simple-audio-card,cpu {
175 sound-dai = <&spdif>;
177 simple-audio-card,codec {
178 sound-dai = <&spdif_out>;
182 spdif_out: spdif-out {
183 compatible = "linux,spdif-dit";
184 #sound-dai-cells = <0>;
187 sdio_pwrseq: sdio-pwrseq {
188 compatible = "mmc-pwrseq-simple";
190 clock-names = "ext_clock";
191 pinctrl-names = "default";
192 pinctrl-0 = <&wifi_enable_h>;
195 * On the module itself this is one of these (depending
196 * on the actual card populated):
197 * - SDIO_RESET_L_WL_REG_ON
198 * - PDN (power down when low)
200 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
204 compatible = "wlan-platdata";
205 rockchip,grf = <&grf>;
206 wifi_chip_type = "ap6354";
208 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
213 compatible = "bluetooth-platdata";
215 clock-names = "ext_clock";
216 //wifi-bt-power-toggle;
217 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
218 pinctrl-names = "default", "rts_gpio";
219 pinctrl-0 = <&uart0_rts>;
220 pinctrl-1 = <&uart0_gpios>;
221 //BT,power_gpio = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */
222 BT,reset_gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
223 BT,wake_gpio = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
224 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
229 compatible = "rockchip,uboot-charge";
230 rockchip,uboot-charge-on = <0>;
231 rockchip,android-charge-on = <1>;
235 compatible = "rk-vibrator-gpio";
236 vibrator-gpio = <&gpio4 30 GPIO_ACTIVE_LOW>;
241 compatible = "rockchip_headset";
242 headset_gpio = <&gpio4 28 GPIO_ACTIVE_HIGH>;
243 pinctrl-names = "default";
244 pinctrl-0 = <&hp_det>;
245 io-channels = <&saradc 2>;
250 compatible = "rockchip,key";
253 io-channels = <&saradc 1>;
258 rockchip,adc_value = <1>;
263 label = "volume down";
264 rockchip,adc_value = <170>;
268 gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
277 rockchip,adc_value = <746>;
283 rockchip,adc_value = <355>;
289 rockchip,adc_value = <560>;
295 rockchip,adc_value = <450>;
300 clock-frequency = <50000000>;
301 clock-freq-min-max = <400000 150000000>;
309 vqmmc-supply = <&vcc_sd>;
310 pinctrl-names = "default";
311 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
316 clock-frequency = <150000000>;
317 clock-freq-min-max = <200000 150000000>;
323 keep-power-in-suspend;
324 mmc-pwrseq = <&sdio_pwrseq>;
327 pinctrl-names = "default";
328 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
342 keep-power-in-suspend;
343 mmc-hs400-enhanced-strobe;
349 rockchip,i2s-broken-burst-len;
350 rockchip,playback-channels = <8>;
351 rockchip,capture-channels = <8>;
352 #sound-dai-cells = <0>;
356 #sound-dai-cells = <0>;
362 bt656-supply = <&vcc1v8_dvp>;
363 audio-supply = <&vcca1v8_codec>;
364 sdmmc-supply = <&vcc_sd>;
365 gpio1830-supply = <&vcc_3v0>;
370 #sound-dai-cells = <0>;
375 i2c-scl-rising-time-ns = <180>;
376 i2c-scl-falling-time-ns = <30>;
377 clock-frequency = <400000>;
379 vdd_cpu_b: syr837@40 {
380 compatible = "silergy,syr827";
382 vin-supply = <&vcc_sys>;
383 regulator-compatible = "fan53555-reg";
384 pinctrl-0 = <&vsel1_gpio>;
385 vsel-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
386 regulator-name = "vdd_cpu_b";
387 regulator-min-microvolt = <712500>;
388 regulator-max-microvolt = <1500000>;
389 regulator-ramp-delay = <1000>;
390 fcs,suspend-voltage-selector = <1>;
392 regulator-initial-state = <3>;
393 regulator-state-mem {
394 regulator-off-in-suspend;
399 compatible = "silergy,syr828";
402 vin-supply = <&vcc_sys>;
403 regulator-compatible = "fan53555-reg";
404 pinctrl-0 = <&vsel2_gpio>;
405 vsel-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
406 regulator-name = "vdd_gpu";
407 regulator-min-microvolt = <735000>;
408 regulator-max-microvolt = <1400000>;
409 regulator-ramp-delay = <1000>;
410 fcs,suspend-voltage-selector = <1>;
412 regulator-state-mem {
413 regulator-off-in-suspend;
418 compatible = "rockchip,rk818";
421 clock-output-names = "xin32k", "wifibt_32kin";
422 interrupt-parent = <&gpio1>;
423 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
424 pinctrl-names = "default";
425 pinctrl-0 = <&pmic_int_l>;
426 rockchip,system-power-controller;
427 rk818,support_dc_chg = <1>;/*1: dc chg; 0:usb chg*/
432 vcc1-supply = <&vcc_sys>;
433 vcc2-supply = <&vcc_sys>;
434 vcc3-supply = <&vcc_sys>;
435 vcc4-supply = <&vcc_sys>;
436 vcc6-supply = <&vcc_sys>;
437 vcc7-supply = <&vcc3v3_sys>;
438 vcc8-supply = <&vcc_sys>;
439 vcc9-supply = <&vcc3v3_sys>;
442 vdd_cpu_l: DCDC_REG1 {
443 regulator-name = "vdd_cpu_l";
446 regulator-min-microvolt = <750000>;
447 regulator-max-microvolt = <1350000>;
448 regulator-ramp-delay = <6001>;
449 regulator-state-mem {
450 regulator-off-in-suspend;
454 vdd_center: DCDC_REG2 {
455 regulator-name = "vdd_center";
458 regulator-min-microvolt = <800000>;
459 regulator-max-microvolt = <1350000>;
460 regulator-ramp-delay = <6001>;
461 regulator-state-mem {
462 regulator-off-in-suspend;
467 regulator-name = "vcc_ddr";
470 regulator-state-mem {
471 regulator-on-in-suspend;
476 regulator-name = "vcc_1v8";
479 regulator-min-microvolt = <1800000>;
480 regulator-max-microvolt = <1800000>;
481 regulator-state-mem {
482 regulator-on-in-suspend;
483 regulator-suspend-microvolt = <1800000>;
487 vcca3v0_codec: LDO_REG1 {
490 regulator-min-microvolt = <3000000>;
491 regulator-max-microvolt = <3000000>;
492 regulator-name = "vcca3v0_codec";
493 regulator-state-mem {
494 regulator-off-in-suspend;
498 vcc3v0_tp: LDO_REG2 {
501 regulator-min-microvolt = <3000000>;
502 regulator-max-microvolt = <3000000>;
503 regulator-name = "vcc3v0_tp";
504 regulator-state-mem {
505 regulator-off-in-suspend;
509 vcca1v8_codec: LDO_REG3 {
512 regulator-min-microvolt = <1800000>;
513 regulator-max-microvolt = <1800000>;
514 regulator-name = "vcca1v8_codec";
515 regulator-state-mem {
516 regulator-off-in-suspend;
520 vcc_power_on: LDO_REG4 {
523 regulator-min-microvolt = <3300000>;
524 regulator-max-microvolt = <3300000>;
525 regulator-name = "vcc_power_on";
526 regulator-state-mem {
527 regulator-on-in-suspend;
528 regulator-suspend-microvolt = <3300000>;
535 regulator-min-microvolt = <3000000>;
536 regulator-max-microvolt = <3000000>;
537 regulator-name = "vcc_3v0";
538 regulator-state-mem {
539 regulator-on-in-suspend;
540 regulator-suspend-microvolt = <3000000>;
547 regulator-min-microvolt = <1500000>;
548 regulator-max-microvolt = <1500000>;
549 regulator-name = "vcc_1v5";
550 regulator-state-mem {
551 regulator-on-in-suspend;
552 regulator-suspend-microvolt = <1500000>;
556 vcc1v8_dvp: LDO_REG7 {
559 regulator-min-microvolt = <1800000>;
560 regulator-max-microvolt = <1800000>;
561 regulator-name = "vcc1v8_dvp";
562 regulator-state-mem {
563 regulator-off-in-suspend;
567 vcc3v3_s3: LDO_REG8 {
570 regulator-min-microvolt = <3300000>;
571 regulator-max-microvolt = <3300000>;
572 regulator-name = "vcc3v3_s3";
573 regulator-state-mem {
574 regulator-off-in-suspend;
581 regulator-min-microvolt = <1800000>;
582 regulator-max-microvolt = <3300000>;
583 regulator-name = "vcc_sd";
584 regulator-state-mem {
585 regulator-on-in-suspend;
586 regulator-suspend-microvolt = <3300000>;
590 vcc3v3_s0: SWITCH_REG {
593 regulator-name = "vcc3v3_s0";
594 regulator-state-mem {
595 regulator-on-in-suspend;
601 compatible = "rk818-battery";
602 ocv_table = <3400 3675 3689 3716 3740 3756 3768 3780
603 3793 3807 3827 3853 3896 3937 3974 4007 4066
604 4110 4161 4217 4308>;
605 design_capacity = <7916>;
606 design_qmax = <8708>;
608 max_input_current = <3000>;
609 max_chrg_current = <3000>;
610 max_chrg_voltage = <4350>;
611 sleep_enter_current = <300>;
612 sleep_exit_current = <300>;
613 power_off_thresd = <3400>;
614 zero_algorithm_vol = <3950>;
615 fb_temperature = <105>;
617 max_soc_offset = <60>;
628 i2c-scl-rising-time-ns = <140>;
629 i2c-scl-falling-time-ns = <30>;
632 #sound-dai-cells = <0>;
633 compatible = "everest,es8316";
635 clocks = <&cru SCLK_I2S_8CH_OUT>;
636 clock-names = "mclk";
637 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
643 i2c-scl-rising-time-ns = <345>;
644 i2c-scl-falling-time-ns = <11>;
645 clock-frequency = <400000>;
649 compatible = "lsm330_acc";
650 pinctrl-names = "default";
651 pinctrl-0 = <&lsm330a_irq_gpio>;
653 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
654 type = <SENSOR_TYPE_ACCEL>;
656 poll_delay_ms = <30>;
657 power-off-in-suspend = <1>;
663 compatible = "lsm330_gyro";
664 pinctrl-names = "default";
665 pinctrl-0 = <&lsm330g_irq_gpio>;
667 irq-gpio = <&gpio1 20 IRQ_TYPE_EDGE_RISING>;
668 type = <SENSOR_TYPE_GYROSCOPE>;
670 power-off-in-suspend = <1>;
671 poll_delay_ms = <30>;
676 compatible = "invensense,mpu6500";
677 pinctrl-names = "default";
678 pinctrl-0 = <&mpu6500_irq_gpio>;
680 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
681 mpu-int_config = <0x10>;
682 mpu-level_shifter = <0>;
683 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
687 support-hw-poweroff = <1>;
693 compatible = "ak8963";
694 pinctrl-names = "default";
695 pinctrl-0 = <&ak8963_irq_gpio>;
697 type = <SENSOR_TYPE_COMPASS>;
698 irq-gpio = <&gpio2 28 IRQ_TYPE_EDGE_RISING>;
700 poll_delay_ms = <30>;
706 compatible = "capella,light_cm3218";
707 pinctrl-names = "default";
708 pinctrl-0 = <&cm3218_irq_gpio>;
710 type = <SENSOR_TYPE_LIGHT>;
711 irq-gpio = <&gpio4 24 IRQ_TYPE_EDGE_FALLING>;
713 poll_delay_ms = <30>;
717 compatible = "fairchild,fusb302";
719 pinctrl-names = "default";
720 pinctrl-0 = <&fusb0_int>;
721 int-n-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
728 i2c-scl-rising-time-ns = <150>;
729 i2c-scl-falling-time-ns = <30>;
730 clock-frequency = <400000>;
733 compatible = "goodix,gt9xx";
735 touch-gpio = <&gpio3 12 IRQ_TYPE_LEVEL_LOW>;
736 reset-gpio = <&gpio3 13 GPIO_ACTIVE_HIGH>;
740 tp-supply = <&vcc3v0_tp>;
753 cpu-supply = <&vdd_cpu_l>;
757 cpu-supply = <&vdd_cpu_l>;
761 cpu-supply = <&vdd_cpu_l>;
765 cpu-supply = <&vdd_cpu_l>;
769 cpu-supply = <&vdd_cpu_b>;
773 cpu-supply = <&vdd_cpu_b>;
778 mali-supply = <&vdd_gpu>;
783 max-freq = <50000000>;
786 compatible = "inv-spi,mpu6500";
787 pinctrl-names = "default";
788 pinctrl-0 = <&mpu6500_irq_gpio>;
789 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
791 spi-max-frequency = <1000000>;
794 mpu-int_config = <0x00>;
795 mpu-level_shifter = <0>;
796 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
800 support-hw-poweroff = <1>;
811 rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
812 rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
820 u2phy0_otg: otg-port {
824 u2phy0_host: host-port {
825 phy-supply = <&vcc5v0_host>;
831 pinctrl-names = "default";
832 pinctrl-0 = <&uart0_xfer &uart0_cts>;
858 assigned-clocks = <&cru SCLK_VOP0_PWM>;
859 assigned-clock-rates = <50000000>;
873 wifi_enable_h: wifi-enable-h {
874 rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
879 uart0_gpios: uart0-gpios {
880 rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
885 pmic_int_l: pmic-int-l {
887 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
890 pmic_dvs2: pmic-dvs2 {
892 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
894 vsel1_gpio: vsel1-gpio {
896 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
898 vsel2_gpio: vsel2-gpio {
900 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
905 mh248_irq_gpio: mh248-irq-gpio {
906 rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>;
912 rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_up>;
917 lcdpwr_enable_h: lcdpwr-enable-h {
918 rockchip,pins = <3 8 RK_FUNC_GPIO &pcfg_pull_up>;
923 lsm330a_irq_gpio: lsm330a-irq-gpio {
924 rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
929 lsm330g_irq_gpio: lsm330g-irq-gpio {
930 rockchip,pins = <1 20 RK_FUNC_GPIO &pcfg_pull_none>;
935 mpu6500_irq_gpio: mpu6500-irq-gpio {
936 rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
941 ak8963_irq_gpio: ak8963-irq-gpio {
942 rockchip,pins = <2 28 RK_FUNC_GPIO &pcfg_pull_none>;
947 cm3218_irq_gpio: cm3218-irq-gpio {
948 rockchip,pins = <4 24 RK_FUNC_GPIO &pcfg_pull_up>;
953 host_vbus_drv: host-vbus-drv {
955 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
960 fusb0_int: fusb0-int {
962 <1 1 RK_FUNC_GPIO &pcfg_pull_up>;
968 #include <dt-bindings/display/screen-timing/lcd-LP097Qx2.dtsi>
979 dp_vop_sel = <DISPLAY_SOURCE_LCDC1>;
984 rockchip,cabc_mode = <1>;
985 power_ctr: power_ctr {
986 rockchip,debug = <0>;
989 rockchip,power_type = <GPIO>;
990 pinctrl-names = "default";
991 pinctrl-0 = <&lcdpwr_enable_h>;
992 gpios = <&gpio3 8 GPIO_ACTIVE_HIGH>;
993 rockchip,delay = <10>;
1016 pmu1830-supply = <&vcc_1v8>;