1 // SPDX-License-Identifier: BSD-3-Clause
3 * Copyright (c) 2021, AngeloGioacchino Del Regno
4 * <angelogioacchino.delregno@somainline.org>
5 * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
8 #include <dt-bindings/input/input.h>
9 #include <dt-bindings/leds/common.h>
10 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
11 #include "msm8998.dtsi"
12 #include "pm8005.dtsi"
13 #include "pm8998.dtsi"
14 #include "pmi8998.dtsi"
17 /* required for bootloader to select correct board */
18 qcom,msm-id = <0x124 0x20000>, <0x124 0x20001>; /* 8998v2, v2.1 */
19 qcom,board-id = <8 0>;
23 compatible = "gpio-gate-clock";
24 pinctrl-0 = <&div_clk1>;
25 pinctrl-names = "default";
26 clocks = <&rpmcc RPM_SMD_DIV_CLK1>;
28 enable-gpios = <&pm8998_gpios 13 GPIO_ACTIVE_HIGH>;
32 board_vbat: vbat-regulator {
33 compatible = "regulator-fixed";
34 regulator-name = "VBAT";
36 regulator-min-microvolt = <4000000>;
37 regulator-max-microvolt = <4000000>;
42 cam0_vdig_vreg: cam0-vdig {
43 compatible = "regulator-fixed";
44 regulator-name = "cam0_vdig";
45 startup-delay-us = <0>;
47 gpio = <&tlmm 21 GPIO_ACTIVE_HIGH>;
48 pinctrl-names = "default";
49 pinctrl-0 = <&main_cam_pwr_en>;
52 cam1_vdig_vreg: cam1-vdig {
53 compatible = "regulator-fixed";
54 regulator-name = "cam1_vdig";
55 startup-delay-us = <0>;
57 gpio = <&tlmm 25 GPIO_ACTIVE_HIGH>;
58 pinctrl-names = "default";
59 pinctrl-0 = <&chat_cam_pwr_en>;
60 vin-supply = <&vreg_s3a_1p35>;
63 cam_vio_vreg: cam-vio-vreg {
64 compatible = "regulator-fixed";
65 regulator-name = "cam_vio_vreg";
66 startup-delay-us = <0>;
68 gpio = <&pmi8998_gpios 1 GPIO_ACTIVE_HIGH>;
69 pinctrl-names = "default";
70 pinctrl-0 = <&main_cam_pwr_io_en>;
71 vin-supply = <&vreg_lvs1a_1p8>;
74 touch_vddio_vreg: touch-vddio-vreg {
75 compatible = "regulator-fixed";
76 regulator-name = "touch_vddio_vreg";
77 startup-delay-us = <10000>;
78 gpio = <&tlmm 133 GPIO_ACTIVE_HIGH>;
79 pinctrl-names = "default";
80 pinctrl-0 = <&ts_vddio_en>;
83 vph_pwr: vph-pwr-regulator {
84 compatible = "regulator-fixed";
85 regulator-name = "vph_pwr";
90 extcon_usb: extcon-usb {
91 compatible = "linux,extcon-usb-gpio";
92 id-gpios = <&tlmm 38 GPIO_ACTIVE_HIGH>;
93 vbus-gpios = <&tlmm 128 GPIO_ACTIVE_HIGH>;
94 pinctrl-names = "default";
95 pinctrl-0 = <&cc_dir_default &usb_detect_en>;
99 compatible = "gpio-keys";
100 label = "Side buttons";
101 pinctrl-names = "default";
102 pinctrl-0 = <&vol_down_n &focus_n &snapshot_n>;
104 label = "Volume Down";
105 gpios = <&pm8998_gpios 5 GPIO_ACTIVE_LOW>;
106 linux,input-type = <EV_KEY>;
107 linux,code = <KEY_VOLUMEDOWN>;
109 debounce-interval = <15>;
112 button-camera-snapshot {
113 label = "Camera Snapshot";
114 gpios = <&pm8998_gpios 7 GPIO_ACTIVE_LOW>;
115 linux,input-type = <EV_KEY>;
116 linux,code = <KEY_CAMERA>;
117 debounce-interval = <15>;
120 button-camera-focus {
121 label = "Camera Focus";
122 gpios = <&pm8998_gpios 8 GPIO_ACTIVE_LOW>;
123 linux,input-type = <EV_KEY>;
124 linux,code = <KEY_CAMERA_FOCUS>;
125 debounce-interval = <15>;
130 compatible = "gpio-keys";
131 label = "Hall sensors";
132 pinctrl-names = "default";
133 pinctrl-0 = <&acc_cover_open>;
136 label = "Cover Hall Sensor";
137 gpios = <&tlmm 124 GPIO_ACTIVE_LOW>;
138 linux,input-type = <EV_SW>;
139 linux,code = <SW_LID>;
141 debounce-interval = <30>;
146 #address-cells = <2>;
150 hyp_mem: memory@85800000 {
151 reg = <0x0 0x85800000 0x0 0x3700000>;
155 cont_splash_mem: memory@9d400000 {
156 reg = <0x0 0x9d400000 0x0 0x2400000>;
160 zap_shader_region: memory@f6400000 {
161 compatible = "shared-dma-pool";
162 reg = <0x0 0xf6400000 0x0 0x2000>;
166 adsp_region: memory@fe000000 {
167 reg = <0x0 0xfe000000 0x0 0x800000>;
171 qseecom_region: memory@fe800000 {
172 reg = <0x0 0xfe800000 0x0 0x1400000>;
177 compatible = "ramoops";
178 reg = <0x0 0xffc00000 0x0 0x100000>;
179 record-size = <0x10000>;
180 console-size = <0x60000>;
181 ftrace-size = <0x10000>;
182 pmsg-size = <0x20000>;
188 compatible = "gpio-vibrator";
189 enable-gpios = <&pmi8998_gpios 5 GPIO_ACTIVE_HIGH>;
190 pinctrl-names = "default";
191 pinctrl-0 = <&vib_ldo_en>;
197 clock-frequency = <355000>;
200 compatible = "syna,rmi4-i2c";
202 #address-cells = <1>;
204 interrupts-extended = <&tlmm 125 IRQ_TYPE_EDGE_FALLING>;
206 pinctrl-names = "default";
207 pinctrl-0 = <&ts_int_n>;
209 vdd-supply = <&vreg_l28_3p0>;
210 vio-supply = <&touch_vddio_vreg>;
212 syna,reset-delay-ms = <220>;
213 syna,startup-delay-ms = <1000>;
217 syna,nosleep-mode = <1>;
222 syna,sensor-type = <1>;
235 compatible = "qcom,wcn3990-bt";
237 vddio-supply = <&vreg_s4a_1p8>;
238 vddxo-supply = <&vreg_l7a_1p8>;
239 vddrf-supply = <&vreg_l17a_1p3>;
240 vddch0-supply = <&vreg_l25a_3p3>;
241 max-speed = <3200000>;
243 clocks = <&rpmcc RPM_SMD_RF_CLK2_PIN>;
255 compatible = "st,vl53l0x";
258 interrupt-parent = <&tlmm>;
259 interrupts = <22 IRQ_TYPE_EDGE_FALLING>;
261 reset-gpios = <&tlmm 27 GPIO_ACTIVE_LOW>;
262 vdd-supply = <&cam_vio_vreg>;
264 pinctrl-names = "default";
265 pinctrl-0 = <&tof_int_n &tof_reset>;
270 regulator-min-microamp = <800000>;
271 regulator-max-microamp = <800000>;
272 regulator-enable-ramp-delay = <200>;
273 regulator-over-current-protection;
275 regulator-ramp-delay = <1>;
276 regulator-settling-time-up-us = <600>;
277 regulator-settling-time-down-us = <1000>;
278 regulator-soft-start;
279 qcom,discharge-resistor-kohms = <300>;
283 regulator-min-microamp = <200000>;
284 regulator-max-microamp = <200000>;
285 regulator-enable-ramp-delay = <500>;
286 regulator-over-current-protection;
288 regulator-ramp-delay = <1>;
289 regulator-settling-time-up-us = <50000>;
290 regulator-settling-time-down-us = <3000>;
291 regulator-soft-start;
295 gpio-line-names = "NC", /* GPIO_1 */
304 regulator-min-microvolt = <524000>;
305 regulator-max-microvolt = <1088000>;
306 regulator-enable-ramp-delay = <500>;
307 /* Hack until we rig up the gpu consumer */
313 gpio-line-names = "UIM_BATT_ALARM", /* GPIO_1 */
315 "WLAN_SW_CTRL (DISALLOWED)",
332 "NC (DISALLOWED)", /* GPIO_20 */
336 "OPTION_1 (DISALLOWED)",
337 "OPTION_2 (DISALLOWED)",
338 "PM_SLB (DISALLOWED)";
340 vol_down_n: vol-down-n-state {
342 function = PMIC_GPIO_FUNC_NORMAL;
345 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
348 focus_n: focus-n-state {
350 function = PMIC_GPIO_FUNC_NORMAL;
353 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
356 snapshot_n: snapshot-n-state {
358 function = PMIC_GPIO_FUNC_NORMAL;
361 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
364 div_clk1: div-clk1-state {
372 gpio-line-names = "MAIN_CAM_PWR_IO_EN", /* GPIO_1 */
387 main_cam_pwr_io_en: main-cam-pwr-io-en-state {
389 function = PMIC_GPIO_FUNC_NORMAL;
393 qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
397 vib_ldo_en: vib-ldo-en-state {
399 function = PMIC_GPIO_FUNC_NORMAL;
403 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
409 linux,code = <KEY_VOLUMEUP>;
416 vdda-pll-supply = <&vreg_l12a_1p8>;
417 vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
422 compatible = "qcom,rpm-pm8998-regulators";
424 vdd_s1-supply = <&vph_pwr>;
425 vdd_s2-supply = <&vph_pwr>;
426 vdd_s3-supply = <&vph_pwr>;
427 vdd_s4-supply = <&vph_pwr>;
428 vdd_s5-supply = <&vph_pwr>;
429 vdd_s6-supply = <&vph_pwr>;
430 vdd_s7-supply = <&vph_pwr>;
431 vdd_s8-supply = <&vph_pwr>;
432 vdd_s9-supply = <&vph_pwr>;
433 vdd_s10-supply = <&vph_pwr>;
434 vdd_s11-supply = <&vph_pwr>;
435 vdd_s12-supply = <&vph_pwr>;
436 vdd_s13-supply = <&vph_pwr>;
437 vdd_l1_l27-supply = <&vreg_s7a_1p025>;
438 vdd_l2_l8_l17-supply = <&vreg_s3a_1p35>;
439 vdd_l3_l11-supply = <&vreg_s7a_1p025>;
440 vdd_l4_l5-supply = <&vreg_s7a_1p025>;
441 vdd_l6-supply = <&vreg_s5a_2p04>;
442 vdd_l7_l12_l14_l15-supply = <&vreg_s5a_2p04>;
443 vdd_l9-supply = <&vreg_bob>;
444 vdd_l10_l23_l25-supply = <&vreg_bob>;
445 vdd_l13_l19_l21-supply = <&vreg_bob>;
446 vdd_l16_l28-supply = <&vreg_bob>;
447 vdd_l18_l22-supply = <&vreg_bob>;
448 vdd_l20_l24-supply = <&vreg_bob>;
449 vdd_l26-supply = <&vreg_s3a_1p35>;
450 vdd_lvs1_lvs2-supply = <&vreg_s4a_1p8>;
453 regulator-min-microvolt = <1352000>;
454 regulator-max-microvolt = <1352000>;
458 regulator-min-microvolt = <1800000>;
459 regulator-max-microvolt = <1800000>;
460 regulator-system-load = <100000>;
461 regulator-allow-set-load;
465 regulator-min-microvolt = <1904000>;
466 regulator-max-microvolt = <2032000>;
470 regulator-min-microvolt = <900000>;
471 regulator-max-microvolt = <1028000>;
475 regulator-min-microvolt = <880000>;
476 regulator-max-microvolt = <880000>;
477 regulator-system-load = <73400>;
478 regulator-allow-set-load;
482 regulator-min-microvolt = <1200000>;
483 regulator-max-microvolt = <1200000>;
484 regulator-system-load = <12560>;
485 regulator-allow-set-load;
489 regulator-min-microvolt = <1000000>;
490 regulator-max-microvolt = <1000000>;
494 regulator-min-microvolt = <800000>;
495 regulator-max-microvolt = <800000>;
499 regulator-min-microvolt = <1800000>;
500 regulator-max-microvolt = <1800000>;
504 regulator-min-microvolt = <1800000>;
505 regulator-max-microvolt = <1800000>;
509 regulator-min-microvolt = <1200000>;
510 regulator-max-microvolt = <1200000>;
514 regulator-min-microvolt = <1808000>;
515 regulator-max-microvolt = <2960000>;
519 regulator-min-microvolt = <1808000>;
520 regulator-max-microvolt = <2960000>;
524 regulator-min-microvolt = <1000000>;
525 regulator-max-microvolt = <1000000>;
529 regulator-min-microvolt = <1800000>;
530 regulator-max-microvolt = <1800000>;
533 vreg_l13a_2p95: l13 {
534 regulator-min-microvolt = <1808000>;
535 regulator-max-microvolt = <2960000>;
536 regulator-allow-set-load;
539 vreg_l14a_1p85: l14 {
540 regulator-min-microvolt = <1848000>;
541 regulator-max-microvolt = <1856000>;
542 regulator-system-load = <32000>;
543 regulator-allow-set-load;
547 regulator-min-microvolt = <1800000>;
548 regulator-max-microvolt = <1800000>;
552 regulator-min-microvolt = <2704000>;
553 regulator-max-microvolt = <2704000>;
557 regulator-min-microvolt = <1304000>;
558 regulator-max-microvolt = <1304000>;
561 vreg_l18a_2p85: l18 { };
564 regulator-min-microvolt = <2696000>;
565 regulator-max-microvolt = <2704000>;
568 vreg_l20a_2p95: l20 {
569 regulator-min-microvolt = <2960000>;
570 regulator-max-microvolt = <2960000>;
571 regulator-system-load = <10000>;
572 regulator-allow-set-load;
575 vreg_l21a_2p95: l21 {
576 regulator-min-microvolt = <2960000>;
577 regulator-max-microvolt = <2960000>;
578 regulator-system-load = <800000>;
579 regulator-allow-set-load;
582 vreg_l22a_2p85: l22 { };
585 regulator-min-microvolt = <3312000>;
586 regulator-max-microvolt = <3312000>;
589 vreg_l24a_3p075: l24 {
590 regulator-min-microvolt = <3088000>;
591 regulator-max-microvolt = <3088000>;
595 regulator-min-microvolt = <3104000>;
596 regulator-max-microvolt = <3312000>;
600 regulator-min-microvolt = <1200000>;
601 regulator-max-microvolt = <1200000>;
602 regulator-allow-set-load;
606 regulator-min-microvolt = <3000000>;
607 regulator-max-microvolt = <3000000>;
610 vreg_lvs1a_1p8: lvs1 { };
612 vreg_lvs2a_1p8: lvs2 { };
616 compatible = "qcom,rpm-pmi8998-regulators";
618 vdd_bob-supply = <&vph_pwr>;
621 regulator-min-microvolt = <3312000>;
622 regulator-max-microvolt = <3600000>;
629 cd-gpios = <&tlmm 95 GPIO_ACTIVE_HIGH>;
631 vmmc-supply = <&vreg_l21a_2p95>;
632 vqmmc-supply = <&vreg_l13a_2p95>;
634 pinctrl-names = "default", "sleep";
635 pinctrl-0 = <&sdc2_on &sdc2_cd>;
636 pinctrl-1 = <&sdc2_off &sdc2_cd>;
640 gpio-reserved-ranges = <0 4>, <81 4>;
641 gpio-line-names = "", /* GPIO_0 */
651 "MDP_VSYNC_P", /* GPIO_10 */
661 "CCI_I2C_SCL1", /* GPIO_20 */
671 "CAM1_RSTN", /* GPIO_30 */
681 "FP_RESET_N", /* GPIO_40 */
711 "LPASS_SLIMBUS_CLK", /* GPIO_70 */
712 "LPASS_SLIMBUS_DATA0",
713 "LPASS_SLIMBUS_DATA1",
714 "BT_FM_SLIMBUS_DATA",
741 "DEBUG_GPIO1", /* GPIO_100 */
751 "UIM1_CLK", /* GPIO_110 */
761 "ALS_PROX_INT_N", /* GPIO_120 */
771 "QLINK_REQUEST", /* GPIO_130 */
781 "RFFE4_CLK", /* GPIO_140 */
792 mdp_vsync_p: mdp-vsync-p-state {
794 function = "mdp_vsync_a";
795 drive-strength = <2>;
799 nfc_ven: nfc-ven-state {
803 drive-strength = <2>;
807 cam_mclk0_active: cam-mclk0-active-state {
809 function = "cam_mclk";
810 drive-strength = <2>;
814 cam_mclk1_active: cam-mclk1-active-state {
816 function = "cam_mclk";
817 drive-strength = <2>;
821 cci0_default: cci0-default-state {
822 pins = "gpio18", "gpio19";
823 function = "cci_i2c";
825 drive-strength = <2>;
828 cci1_default: cci1-default-state {
829 pins = "gpio19", "gpio20";
830 function = "cci_i2c";
832 drive-strength = <2>;
835 main_cam_pwr_en: main-cam-pwr-en-default-state {
839 drive-strength = <2>;
842 tof_int_n: tof-int-n-state {
846 drive-strength = <2>;
849 chat_cam_pwr_en: chat-cam-pwr-en-default-state {
853 drive-strength = <2>;
856 tof_reset: tof-reset-state {
860 drive-strength = <2>;
863 cc_dir_default: cc-dir-active-state {
867 drive-strength = <16>;
870 acc_cover_open: acc-cover-open-state {
874 drive-strength = <2>;
877 ts_int_n: ts-int-n-state {
880 drive-strength = <8>;
884 usb_detect_en: usb-detect-en-active-state {
888 drive-strength = <2>;
892 ts_vddio_en: ts-vddio-en-default-state {
896 drive-strength = <2>;
903 * Disable UFS until card quirks are in to avoid unrecoverable hard-brick
904 * that would happen as soon as the UFS card gets probed as, without the
905 * required quirks, the bootloader will be erased right after card probe.
920 /* Force to peripheral until we have Type-C hooked up */
921 dr_mode = "peripheral";
922 extcon = <&extcon_usb>;
928 vdda-phy-supply = <&vreg_l1a_0p875>;
929 vdda-pll-supply = <&vreg_l2a_1p2>;