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 edp_panel: edp-panel {
55 compatible = "lg,lp079qx1-sp0v", "panel-simple";
56 bus-format = <MEDIA_BUS_FMT_RGB666_1X18>;
57 backlight = <&backlight>;
58 power-supply = <&vcc3v3_s0>;
59 enable-gpios = <&gpio3 8 GPIO_ACTIVE_HIGH>;
61 panel_in_edp: endpoint {
62 remote-endpoint = <&edp_out_panel>;
67 hall_sensor: hall-mh248 {
68 compatible = "hall-mh248";
69 pinctrl-names = "default";
70 pinctrl-0 = <&mh248_irq_gpio>;
71 irq-gpio = <&gpio1 2 IRQ_TYPE_EDGE_BOTH>;
77 compatible = "regulator-fixed";
78 regulator-name = "vcc_sys";
81 regulator-min-microvolt = <3900000>;
82 regulator-max-microvolt = <3900000>;
85 vcc3v3_sys: vcc3v3-sys {
86 compatible = "regulator-fixed";
87 regulator-name = "vcc3v3_sys";
90 regulator-min-microvolt = <3300000>;
91 regulator-max-microvolt = <3300000>;
94 vcc5v0_host: vcc5v0-host-regulator {
95 compatible = "regulator-fixed";
97 gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>;
98 pinctrl-names = "default";
99 pinctrl-0 = <&host_vbus_drv>;
100 regulator-name = "vcc5v0_host";
105 compatible = "pwm-regulator";
106 pwms = <&pwm2 0 25000 1>;
107 rockchip,pwm_id= <2>;
108 rockchip,pwm_voltage = <900000>;
109 regulator-name = "vdd_log";
110 regulator-min-microvolt = <750000>;
111 regulator-max-microvolt = <1350000>;
116 backlight: backlight {
117 compatible = "pwm-backlight";
118 pwms = <&pwm0 0 25000 0>;
119 brightness-levels = <
120 255 200 199 198 197 197 196 195 194 193 193 192
121 191 190 189 189 188 187 186 185 185 184 183 182
122 181 181 180 179 178 177 177 176 175 174 173 173
123 172 171 170 169 169 168 167 166 165 165 164 163
124 162 161 161 160 159 158 157 157 156 155 154 153
125 153 152 151 150 149 149 148 147 146 145 145 144
126 143 142 141 141 140 139 138 137 137 136 135 134
127 133 133 132 131 130 129 129 128 127 126 125 125
128 124 123 122 121 121 120 119 118 117 117 116 115
129 114 113 113 112 111 110 109 109 108 107 106 105
130 105 104 103 102 101 101 100 99 98 97 97 96
131 95 94 93 93 92 91 90 89 89 88 87 86
132 85 85 84 83 82 81 81 80 79 78 77 77
133 76 75 74 73 73 72 71 70 69 69 68 67
134 66 65 65 64 63 62 61 61 60 59 58 57
135 57 56 55 54 53 53 52 51 50 49 49 48
136 47 46 45 45 44 43 42 41 41 40 39 38
137 37 37 36 35 34 33 33 32 31 30 29 29
138 28 27 26 25 25 24 23 22 21 21 20 19
139 18 17 17 16 15 14 13 13 12 11 10 9
140 9 8 7 6 5 5 4 3 2 1 1 0
142 default-brightness-level = <200>;
143 enable-gpios = <&gpio1 13 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>;
253 compatible = "rockchip,key";
256 io-channels = <&saradc 1>;
261 rockchip,adc_value = <1>;
266 label = "volume down";
267 rockchip,adc_value = <170>;
271 gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
280 rockchip,adc_value = <746>;
286 rockchip,adc_value = <355>;
292 rockchip,adc_value = <560>;
298 rockchip,adc_value = <450>;
303 clock-frequency = <50000000>;
304 clock-freq-min-max = <400000 150000000>;
312 vqmmc-supply = <&vcc_sd>;
313 pinctrl-names = "default";
314 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
319 clock-frequency = <150000000>;
320 clock-freq-min-max = <200000 150000000>;
326 keep-power-in-suspend;
327 mmc-pwrseq = <&sdio_pwrseq>;
330 pinctrl-names = "default";
331 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
345 keep-power-in-suspend;
346 mmc-hs400-enhanced-strobe;
352 rockchip,i2s-broken-burst-len;
353 rockchip,playback-channels = <8>;
354 rockchip,capture-channels = <8>;
355 #sound-dai-cells = <0>;
359 #sound-dai-cells = <0>;
364 #sound-dai-cells = <0>;
369 i2c-scl-rising-time-ns = <180>;
370 i2c-scl-falling-time-ns = <30>;
371 clock-frequency = <400000>;
373 vdd_cpu_b: syr837@40 {
374 compatible = "silergy,syr827";
376 vin-supply = <&vcc_sys>;
377 regulator-compatible = "fan53555-reg";
378 pinctrl-0 = <&vsel1_gpio>;
379 vsel-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
380 regulator-name = "vdd_cpu_b";
381 regulator-min-microvolt = <712500>;
382 regulator-max-microvolt = <1500000>;
383 regulator-ramp-delay = <1000>;
384 fcs,suspend-voltage-selector = <1>;
386 regulator-initial-state = <3>;
387 regulator-state-mem {
388 regulator-off-in-suspend;
393 compatible = "silergy,syr828";
396 vin-supply = <&vcc_sys>;
397 regulator-compatible = "fan53555-reg";
398 pinctrl-0 = <&vsel2_gpio>;
399 vsel-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
400 regulator-name = "vdd_gpu";
401 regulator-min-microvolt = <735000>;
402 regulator-max-microvolt = <1400000>;
403 regulator-ramp-delay = <1000>;
404 fcs,suspend-voltage-selector = <1>;
406 regulator-state-mem {
407 regulator-off-in-suspend;
412 compatible = "rockchip,rk818";
415 clock-output-names = "xin32k", "wifibt_32kin";
416 interrupt-parent = <&gpio1>;
417 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
418 pinctrl-names = "default";
419 pinctrl-0 = <&pmic_int_l>;
420 rockchip,system-power-controller;
421 rk818,support_dc_chg = <1>;/*1: dc chg; 0:usb chg*/
426 vcc1-supply = <&vcc_sys>;
427 vcc2-supply = <&vcc_sys>;
428 vcc3-supply = <&vcc_sys>;
429 vcc4-supply = <&vcc_sys>;
430 vcc6-supply = <&vcc_sys>;
431 vcc7-supply = <&vcc3v3_sys>;
432 vcc8-supply = <&vcc_sys>;
433 vcc9-supply = <&vcc3v3_sys>;
436 vdd_cpu_l: DCDC_REG1 {
437 regulator-name = "vdd_cpu_l";
440 regulator-min-microvolt = <750000>;
441 regulator-max-microvolt = <1350000>;
442 regulator-ramp-delay = <6001>;
443 regulator-state-mem {
444 regulator-off-in-suspend;
448 vdd_center: DCDC_REG2 {
449 regulator-name = "vdd_center";
452 regulator-min-microvolt = <800000>;
453 regulator-max-microvolt = <1350000>;
454 regulator-ramp-delay = <6001>;
455 regulator-state-mem {
456 regulator-off-in-suspend;
461 regulator-name = "vcc_ddr";
464 regulator-state-mem {
465 regulator-on-in-suspend;
470 regulator-name = "vcc_1v8";
473 regulator-min-microvolt = <1800000>;
474 regulator-max-microvolt = <1800000>;
475 regulator-state-mem {
476 regulator-on-in-suspend;
477 regulator-suspend-microvolt = <1800000>;
481 vcca3v0_codec: LDO_REG1 {
484 regulator-min-microvolt = <3000000>;
485 regulator-max-microvolt = <3000000>;
486 regulator-name = "vcca3v0_codec";
487 regulator-state-mem {
488 regulator-off-in-suspend;
492 vcc3v0_tp: LDO_REG2 {
495 regulator-min-microvolt = <3000000>;
496 regulator-max-microvolt = <3000000>;
497 regulator-name = "vcc3v0_tp";
498 regulator-state-mem {
499 regulator-off-in-suspend;
503 vcca1v8_codec: LDO_REG3 {
506 regulator-min-microvolt = <1800000>;
507 regulator-max-microvolt = <1800000>;
508 regulator-name = "vcca1v8_codec";
509 regulator-state-mem {
510 regulator-off-in-suspend;
514 vcc_power_on: LDO_REG4 {
517 regulator-min-microvolt = <3300000>;
518 regulator-max-microvolt = <3300000>;
519 regulator-name = "vcc_power_on";
520 regulator-state-mem {
521 regulator-on-in-suspend;
522 regulator-suspend-microvolt = <3300000>;
529 regulator-min-microvolt = <3000000>;
530 regulator-max-microvolt = <3000000>;
531 regulator-name = "vcc_3v0";
532 regulator-state-mem {
533 regulator-on-in-suspend;
534 regulator-suspend-microvolt = <3000000>;
541 regulator-min-microvolt = <1500000>;
542 regulator-max-microvolt = <1500000>;
543 regulator-name = "vcc_1v5";
544 regulator-state-mem {
545 regulator-on-in-suspend;
546 regulator-suspend-microvolt = <1500000>;
550 vcc1v8_dvp: LDO_REG7 {
553 regulator-min-microvolt = <1800000>;
554 regulator-max-microvolt = <1800000>;
555 regulator-name = "vcc1v8_dvp";
556 regulator-state-mem {
557 regulator-off-in-suspend;
561 vcc3v3_s3: LDO_REG8 {
564 regulator-min-microvolt = <3300000>;
565 regulator-max-microvolt = <3300000>;
566 regulator-name = "vcc3v3_s3";
567 regulator-state-mem {
568 regulator-off-in-suspend;
575 regulator-min-microvolt = <1800000>;
576 regulator-max-microvolt = <3300000>;
577 regulator-name = "vcc_sd";
578 regulator-state-mem {
579 regulator-on-in-suspend;
580 regulator-suspend-microvolt = <3300000>;
584 vcc3v3_s0: SWITCH_REG {
587 regulator-name = "vcc3v3_s0";
588 regulator-state-mem {
589 regulator-on-in-suspend;
595 compatible = "rk818-battery";
596 ocv_table = <3400 3675 3689 3716 3740 3756 3768 3780
597 3793 3807 3827 3853 3896 3937 3974 4007 4066
598 4110 4161 4217 4308>;
599 design_capacity = <7916>;
600 design_qmax = <8708>;
602 max_input_current = <3000>;
603 max_chrg_current = <3000>;
604 max_chrg_voltage = <4350>;
605 sleep_enter_current = <300>;
606 sleep_exit_current = <300>;
607 power_off_thresd = <3400>;
608 zero_algorithm_vol = <3950>;
609 fb_temperature = <105>;
611 max_soc_offset = <60>;
622 i2c-scl-rising-time-ns = <140>;
623 i2c-scl-falling-time-ns = <30>;
626 #sound-dai-cells = <0>;
627 compatible = "everest,es8316";
629 clocks = <&cru SCLK_I2S_8CH_OUT>;
630 clock-names = "mclk";
631 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
637 i2c-scl-rising-time-ns = <345>;
638 i2c-scl-falling-time-ns = <11>;
639 clock-frequency = <400000>;
643 compatible = "lsm330_acc";
644 pinctrl-names = "default";
645 pinctrl-0 = <&lsm330a_irq_gpio>;
647 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
648 type = <SENSOR_TYPE_ACCEL>;
650 poll_delay_ms = <30>;
651 power-off-in-suspend = <1>;
657 compatible = "lsm330_gyro";
658 pinctrl-names = "default";
659 pinctrl-0 = <&lsm330g_irq_gpio>;
661 irq-gpio = <&gpio1 20 IRQ_TYPE_EDGE_RISING>;
662 type = <SENSOR_TYPE_GYROSCOPE>;
664 power-off-in-suspend = <1>;
665 poll_delay_ms = <30>;
670 compatible = "invensense,mpu6500";
671 pinctrl-names = "default";
672 pinctrl-0 = <&mpu6500_irq_gpio>;
674 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
675 mpu-int_config = <0x10>;
676 mpu-level_shifter = <0>;
677 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
681 support-hw-poweroff = <1>;
687 compatible = "ak8963";
688 pinctrl-names = "default";
689 pinctrl-0 = <&ak8963_irq_gpio>;
691 type = <SENSOR_TYPE_COMPASS>;
692 irq-gpio = <&gpio2 28 IRQ_TYPE_EDGE_RISING>;
694 poll_delay_ms = <30>;
700 compatible = "capella,light_cm3218";
701 pinctrl-names = "default";
702 pinctrl-0 = <&cm3218_irq_gpio>;
704 type = <SENSOR_TYPE_LIGHT>;
705 irq-gpio = <&gpio4 24 IRQ_TYPE_EDGE_FALLING>;
707 poll_delay_ms = <30>;
711 compatible = "fairchild,fusb302";
713 pinctrl-names = "default";
714 pinctrl-0 = <&fusb0_int>;
715 int-n-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
722 i2c-scl-rising-time-ns = <150>;
723 i2c-scl-falling-time-ns = <30>;
724 clock-frequency = <400000>;
727 compatible = "goodix,gt9xx";
729 touch-gpio = <&gpio3 12 IRQ_TYPE_LEVEL_LOW>;
730 reset-gpio = <&gpio3 13 GPIO_ACTIVE_HIGH>;
734 tp-supply = <&vcc3v0_tp>;
741 bt656-supply = <&vcc1v8_dvp>;
742 audio-supply = <&vcca1v8_codec>;
743 sdmmc-supply = <&vcc_sd>;
744 gpio1830-supply = <&vcc_3v0>;
764 cpu-supply = <&vdd_cpu_l>;
768 cpu-supply = <&vdd_cpu_l>;
772 cpu-supply = <&vdd_cpu_l>;
776 cpu-supply = <&vdd_cpu_l>;
780 cpu-supply = <&vdd_cpu_b>;
784 cpu-supply = <&vdd_cpu_b>;
789 mali-supply = <&vdd_gpu>;
794 max-freq = <50000000>;
797 compatible = "inv-spi,mpu6500";
798 pinctrl-names = "default";
799 pinctrl-0 = <&mpu6500_irq_gpio>;
800 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
802 spi-max-frequency = <1000000>;
805 mpu-int_config = <0x00>;
806 mpu-level_shifter = <0>;
807 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
811 support-hw-poweroff = <1>;
822 rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
823 rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
831 u2phy0_otg: otg-port {
835 u2phy0_host: host-port {
836 phy-supply = <&vcc5v0_host>;
842 pinctrl-names = "default";
843 pinctrl-0 = <&uart0_xfer &uart0_cts>;
882 rockchip,sleep-debug-en = <1>;
883 rockchip,sleep-mode-config = <
894 rockchip,wakeup-config = <
899 rockchip,pwm-regulator-config = <
904 rockchip,power-ctrl =
905 <&gpio1 17 GPIO_ACTIVE_HIGH>,
906 <&gpio1 14 GPIO_ACTIVE_HIGH>;
911 wifi_enable_h: wifi-enable-h {
912 rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
917 uart0_gpios: uart0-gpios {
918 rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
923 pmic_int_l: pmic-int-l {
925 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
928 pmic_dvs2: pmic-dvs2 {
930 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
932 vsel1_gpio: vsel1-gpio {
934 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
936 vsel2_gpio: vsel2-gpio {
938 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
943 mh248_irq_gpio: mh248-irq-gpio {
944 rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>;
950 rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_up>;
955 lsm330a_irq_gpio: lsm330a-irq-gpio {
956 rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
961 lsm330g_irq_gpio: lsm330g-irq-gpio {
962 rockchip,pins = <1 20 RK_FUNC_GPIO &pcfg_pull_none>;
967 mpu6500_irq_gpio: mpu6500-irq-gpio {
968 rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
973 ak8963_irq_gpio: ak8963-irq-gpio {
974 rockchip,pins = <2 28 RK_FUNC_GPIO &pcfg_pull_none>;
979 cm3218_irq_gpio: cm3218-irq-gpio {
980 rockchip,pins = <4 24 RK_FUNC_GPIO &pcfg_pull_up>;
985 host_vbus_drv: host-vbus-drv {
987 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
992 fusb0_int: fusb0-int {
994 <1 1 RK_FUNC_GPIO &pcfg_pull_up>;
1004 #address-cells = <1>;
1006 edp_out_panel: endpoint@0 {
1008 remote-endpoint = <&panel_in_edp>;
1015 status = "disabled";
1023 status = "disabled";
1029 phys = <&tcphy0_dp>;
1033 status = "disabled";
1038 pmu1830-supply = <&vcc_1v8>;
1043 logo,mode = "center";