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 PWM_POLARITY_INVERTED>;
119 brightness-levels = <
120 0 1 51 52 52 53 53 54
121 54 55 55 56 56 57 57 58
122 58 59 59 60 61 61 62 63
123 63 64 65 65 66 67 67 68
124 69 69 70 71 71 72 73 73
125 74 75 75 76 77 77 78 79
126 79 80 80 81 81 82 83 83
127 84 85 86 86 87 88 89 89
128 90 91 92 92 93 94 95 95
129 96 97 98 98 99 100 101 101
130 102 103 104 104 105 106 107 107
131 108 109 110 110 111 112 113 113
132 114 115 116 116 117 118 119 119
133 120 121 122 122 123 124 125 125
134 126 127 128 128 129 130 131 131
135 132 133 134 134 135 136 137 137
136 138 139 140 140 141 142 143 143
137 144 145 146 146 147 148 149 149
138 150 151 152 152 153 154 155 155
139 156 157 158 158 159 160 161 161
140 162 163 164 164 165 166 167 167
141 168 169 170 170 171 172 173 173
142 174 175 176 176 177 178 179 179
143 180 181 182 182 183 184 185 185
144 186 187 188 188 189 190 191 191
145 216 217 218 218 219 220 221 221
146 222 223 224 224 225 226 227 227
147 228 229 230 230 231 232 233 233
148 234 235 236 236 237 238 239 239
149 240 241 242 242 243 244 245 245
150 246 247 248 248 249 250 251 251
151 252 253 254 254 255 255 255 255>;
152 default-brightness-level = <200>;
153 enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
156 vcc_phy: vcc-phy-regulator {
157 compatible = "regulator-fixed";
158 regulator-name = "vcc_phy";
164 compatible = "simple-audio-card";
165 simple-audio-card,format = "i2s";
166 simple-audio-card,name = "rockchip,es8316-codec";
167 simple-audio-card,mclk-fs = <256>;
168 simple-audio-card,widgets =
169 "Microphone", "Mic Jack",
170 "Headphone", "Headphone Jack";
171 simple-audio-card,routing =
172 "Mic Jack", "MICBIAS1",
174 "Headphone Jack", "HPOL",
175 "Headphone Jack", "HPOR";
176 simple-audio-card,cpu {
179 simple-audio-card,codec {
180 sound-dai = <&es8316>;
185 compatible = "simple-audio-card";
186 simple-audio-card,name = "rockchip,spdif";
187 simple-audio-card,cpu {
188 sound-dai = <&spdif>;
190 simple-audio-card,codec {
191 sound-dai = <&spdif_out>;
195 spdif_out: spdif-out {
196 compatible = "linux,spdif-dit";
197 #sound-dai-cells = <0>;
200 sdio_pwrseq: sdio-pwrseq {
201 compatible = "mmc-pwrseq-simple";
203 clock-names = "ext_clock";
204 pinctrl-names = "default";
205 pinctrl-0 = <&wifi_enable_h>;
208 * On the module itself this is one of these (depending
209 * on the actual card populated):
210 * - SDIO_RESET_L_WL_REG_ON
211 * - PDN (power down when low)
213 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
217 compatible = "wlan-platdata";
218 rockchip,grf = <&grf>;
219 wifi_chip_type = "ap6354";
221 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
226 compatible = "bluetooth-platdata";
228 clock-names = "ext_clock";
229 //wifi-bt-power-toggle;
230 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
231 pinctrl-names = "default", "rts_gpio";
232 pinctrl-0 = <&uart0_rts>;
233 pinctrl-1 = <&uart0_gpios>;
234 //BT,power_gpio = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */
235 BT,reset_gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
236 BT,wake_gpio = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
237 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
242 compatible = "rockchip,uboot-charge";
243 rockchip,uboot-charge-on = <0>;
244 rockchip,android-charge-on = <1>;
248 compatible = "rk-vibrator-gpio";
249 vibrator-gpio = <&gpio4 30 GPIO_ACTIVE_LOW>;
254 compatible = "rockchip_headset";
255 headset_gpio = <&gpio4 28 GPIO_ACTIVE_HIGH>;
256 pinctrl-names = "default";
257 pinctrl-0 = <&hp_det>;
258 io-channels = <&saradc 2>;
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 clock-frequency = <50000000>;
314 clock-freq-min-max = <400000 150000000>;
322 vqmmc-supply = <&vcc_sd>;
323 pinctrl-names = "default";
324 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
329 clock-frequency = <150000000>;
330 clock-freq-min-max = <200000 150000000>;
336 keep-power-in-suspend;
337 mmc-pwrseq = <&sdio_pwrseq>;
340 pinctrl-names = "default";
341 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
355 keep-power-in-suspend;
356 mmc-hs400-enhanced-strobe;
362 rockchip,i2s-broken-burst-len;
363 rockchip,playback-channels = <8>;
364 rockchip,capture-channels = <8>;
365 #sound-dai-cells = <0>;
369 #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,rk818";
425 clock-output-names = "xin32k", "wifibt_32kin";
426 interrupt-parent = <&gpio1>;
427 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
428 pinctrl-names = "default";
429 pinctrl-0 = <&pmic_int_l>;
430 rockchip,system-power-controller;
431 rk818,support_dc_chg = <1>;/*1: dc chg; 0:usb chg*/
436 vcc1-supply = <&vcc_sys>;
437 vcc2-supply = <&vcc_sys>;
438 vcc3-supply = <&vcc_sys>;
439 vcc4-supply = <&vcc_sys>;
440 vcc6-supply = <&vcc_sys>;
441 vcc7-supply = <&vcc3v3_sys>;
442 vcc8-supply = <&vcc_sys>;
443 vcc9-supply = <&vcc3v3_sys>;
446 vdd_cpu_l: DCDC_REG1 {
447 regulator-name = "vdd_cpu_l";
450 regulator-min-microvolt = <750000>;
451 regulator-max-microvolt = <1350000>;
452 regulator-ramp-delay = <6001>;
453 regulator-state-mem {
454 regulator-off-in-suspend;
458 vdd_center: DCDC_REG2 {
459 regulator-name = "vdd_center";
462 regulator-min-microvolt = <800000>;
463 regulator-max-microvolt = <1350000>;
464 regulator-ramp-delay = <6001>;
465 regulator-state-mem {
466 regulator-off-in-suspend;
471 regulator-name = "vcc_ddr";
474 regulator-state-mem {
475 regulator-on-in-suspend;
480 regulator-name = "vcc_1v8";
483 regulator-min-microvolt = <1800000>;
484 regulator-max-microvolt = <1800000>;
485 regulator-state-mem {
486 regulator-on-in-suspend;
487 regulator-suspend-microvolt = <1800000>;
491 vcca3v0_codec: LDO_REG1 {
494 regulator-min-microvolt = <3000000>;
495 regulator-max-microvolt = <3000000>;
496 regulator-name = "vcca3v0_codec";
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 vcca1v8_codec: LDO_REG3 {
516 regulator-min-microvolt = <1800000>;
517 regulator-max-microvolt = <1800000>;
518 regulator-name = "vcca1v8_codec";
519 regulator-state-mem {
520 regulator-off-in-suspend;
524 vcc_power_on: LDO_REG4 {
527 regulator-min-microvolt = <3300000>;
528 regulator-max-microvolt = <3300000>;
529 regulator-name = "vcc_power_on";
530 regulator-state-mem {
531 regulator-on-in-suspend;
532 regulator-suspend-microvolt = <3300000>;
539 regulator-min-microvolt = <3000000>;
540 regulator-max-microvolt = <3000000>;
541 regulator-name = "vcc_3v0";
542 regulator-state-mem {
543 regulator-on-in-suspend;
544 regulator-suspend-microvolt = <3000000>;
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 vcc1v8_dvp: LDO_REG7 {
563 regulator-min-microvolt = <1800000>;
564 regulator-max-microvolt = <1800000>;
565 regulator-name = "vcc1v8_dvp";
566 regulator-state-mem {
567 regulator-off-in-suspend;
571 vcc3v3_s3: LDO_REG8 {
574 regulator-min-microvolt = <3300000>;
575 regulator-max-microvolt = <3300000>;
576 regulator-name = "vcc3v3_s3";
577 regulator-state-mem {
578 regulator-off-in-suspend;
585 regulator-min-microvolt = <1800000>;
586 regulator-max-microvolt = <3300000>;
587 regulator-name = "vcc_sd";
588 regulator-state-mem {
589 regulator-on-in-suspend;
590 regulator-suspend-microvolt = <3300000>;
594 vcc3v3_s0: SWITCH_REG {
597 regulator-name = "vcc3v3_s0";
598 regulator-state-mem {
599 regulator-on-in-suspend;
605 compatible = "rk818-battery";
606 ocv_table = <3400 3675 3689 3716 3740 3756 3768 3780
607 3793 3807 3827 3853 3896 3937 3974 4007 4066
608 4110 4161 4217 4308>;
609 design_capacity = <7916>;
610 design_qmax = <8708>;
612 max_input_current = <3000>;
613 max_chrg_current = <3000>;
614 max_chrg_voltage = <4350>;
615 sleep_enter_current = <300>;
616 sleep_exit_current = <300>;
617 power_off_thresd = <3400>;
618 zero_algorithm_vol = <3950>;
619 fb_temperature = <105>;
621 max_soc_offset = <60>;
632 i2c-scl-rising-time-ns = <140>;
633 i2c-scl-falling-time-ns = <30>;
636 #sound-dai-cells = <0>;
637 compatible = "everest,es8316";
639 clocks = <&cru SCLK_I2S_8CH_OUT>;
640 clock-names = "mclk";
641 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
647 i2c-scl-rising-time-ns = <345>;
648 i2c-scl-falling-time-ns = <11>;
649 clock-frequency = <400000>;
653 compatible = "lsm330_acc";
654 pinctrl-names = "default";
655 pinctrl-0 = <&lsm330a_irq_gpio>;
657 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
658 type = <SENSOR_TYPE_ACCEL>;
660 poll_delay_ms = <30>;
661 power-off-in-suspend = <1>;
667 compatible = "lsm330_gyro";
668 pinctrl-names = "default";
669 pinctrl-0 = <&lsm330g_irq_gpio>;
671 irq-gpio = <&gpio1 20 IRQ_TYPE_EDGE_RISING>;
672 type = <SENSOR_TYPE_GYROSCOPE>;
674 power-off-in-suspend = <1>;
675 poll_delay_ms = <30>;
680 compatible = "invensense,mpu6500";
681 pinctrl-names = "default";
682 pinctrl-0 = <&mpu6500_irq_gpio>;
684 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
685 mpu-int_config = <0x10>;
686 mpu-level_shifter = <0>;
687 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
691 support-hw-poweroff = <1>;
697 compatible = "ak8963";
698 pinctrl-names = "default";
699 pinctrl-0 = <&ak8963_irq_gpio>;
701 type = <SENSOR_TYPE_COMPASS>;
702 irq-gpio = <&gpio2 28 IRQ_TYPE_EDGE_RISING>;
704 poll_delay_ms = <30>;
710 compatible = "capella,light_cm3218";
711 pinctrl-names = "default";
712 pinctrl-0 = <&cm3218_irq_gpio>;
714 type = <SENSOR_TYPE_LIGHT>;
715 irq-gpio = <&gpio4 24 IRQ_TYPE_EDGE_FALLING>;
717 poll_delay_ms = <30>;
721 compatible = "fairchild,fusb302";
723 pinctrl-names = "default";
724 pinctrl-0 = <&fusb0_int>;
725 int-n-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
732 i2c-scl-rising-time-ns = <150>;
733 i2c-scl-falling-time-ns = <30>;
734 clock-frequency = <400000>;
737 compatible = "goodix,gt9xx";
739 touch-gpio = <&gpio3 12 IRQ_TYPE_LEVEL_LOW>;
740 reset-gpio = <&gpio3 13 GPIO_ACTIVE_HIGH>;
744 tp-supply = <&vcc3v0_tp>;
751 bt656-supply = <&vcc1v8_dvp>;
752 audio-supply = <&vcca1v8_codec>;
753 sdmmc-supply = <&vcc_sd>;
754 gpio1830-supply = <&vcc_3v0>;
774 cpu-supply = <&vdd_cpu_l>;
778 cpu-supply = <&vdd_cpu_l>;
782 cpu-supply = <&vdd_cpu_l>;
786 cpu-supply = <&vdd_cpu_l>;
790 cpu-supply = <&vdd_cpu_b>;
794 cpu-supply = <&vdd_cpu_b>;
799 mali-supply = <&vdd_gpu>;
804 max-freq = <50000000>;
807 compatible = "inv-spi,mpu6500";
808 pinctrl-names = "default";
809 pinctrl-0 = <&mpu6500_irq_gpio>;
810 irq-gpio = <&gpio2 27 IRQ_TYPE_EDGE_RISING>;
812 spi-max-frequency = <1000000>;
815 mpu-int_config = <0x00>;
816 mpu-level_shifter = <0>;
817 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
821 support-hw-poweroff = <1>;
832 rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
833 rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
841 u2phy0_otg: otg-port {
845 u2phy0_host: host-port {
846 phy-supply = <&vcc5v0_host>;
852 pinctrl-names = "default";
853 pinctrl-0 = <&uart0_xfer &uart0_cts>;
892 wifi_enable_h: wifi-enable-h {
893 rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
898 uart0_gpios: uart0-gpios {
899 rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
904 pmic_int_l: pmic-int-l {
906 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
909 pmic_dvs2: pmic-dvs2 {
911 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
913 vsel1_gpio: vsel1-gpio {
915 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
917 vsel2_gpio: vsel2-gpio {
919 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
924 mh248_irq_gpio: mh248-irq-gpio {
925 rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>;
931 rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_up>;
936 lsm330a_irq_gpio: lsm330a-irq-gpio {
937 rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
942 lsm330g_irq_gpio: lsm330g-irq-gpio {
943 rockchip,pins = <1 20 RK_FUNC_GPIO &pcfg_pull_none>;
948 mpu6500_irq_gpio: mpu6500-irq-gpio {
949 rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
954 ak8963_irq_gpio: ak8963-irq-gpio {
955 rockchip,pins = <2 28 RK_FUNC_GPIO &pcfg_pull_none>;
960 cm3218_irq_gpio: cm3218-irq-gpio {
961 rockchip,pins = <4 24 RK_FUNC_GPIO &pcfg_pull_up>;
966 host_vbus_drv: host-vbus-drv {
968 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
973 fusb0_int: fusb0-int {
975 <1 1 RK_FUNC_GPIO &pcfg_pull_up>;
985 #address-cells = <1>;
987 edp_out_panel: endpoint@0 {
989 remote-endpoint = <&panel_in_edp>;
1000 status = "disabled";
1006 phys = <&tcphy0_dp>;
1010 status = "disabled";
1015 pmu1830-supply = <&vcc_1v8>;
1020 logo,mode = "center";