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 "msm8996.dtsi"
10 #include "pmi8994.dtsi"
11 #include "pmi8996.dtsi"
12 #include <dt-bindings/input/input.h>
13 #include <dt-bindings/gpio/gpio.h>
14 #include <dt-bindings/leds/common.h>
15 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
16 #include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
18 /delete-node/ &adsp_mem;
19 /delete-node/ &slpi_mem;
20 /delete-node/ &venus_mem;
21 /delete-node/ &gpu_mem;
24 qcom,msm-id = <246 0x30001>; /* MSM8996 V3.1 (Final) */
25 qcom,board-id = <8 0>;
28 bootargs = "maxcpus=2";
33 compatible = "ramoops";
34 reg = <0 0xa7f00000 0 0x100000>;
35 record-size = <0x20000>;
36 console-size = <0x40000>;
37 ftrace-size = <0x20000>;
38 pmsg-size = <0x20000>;
42 adsp_mem: adsp@8ea00000 {
43 reg = <0x0 0x8ea00000 0x0 0x1a00000>;
47 gpu_mem: gpu@90400000 {
48 compatible = "shared-dma-pool";
49 reg = <0x0 0x90400000 0x0 0x2000>;
53 slpi_mem: memory@90500000 {
54 reg = <0 0x90500000 0 0xa00000>;
58 venus_mem: memory@90f00000 {
59 reg = <0 0x90f00000 0 0x500000>;
64 panel_tvdd: tvdd-regulator {
65 compatible = "regulator-fixed";
66 regulator-name = "panel_tvdd";
67 gpio = <&tlmm 50 GPIO_ACTIVE_LOW>;
68 pinctrl-0 = <&tp_vddio_en>;
69 pinctrl-names = "default";
73 compatible = "linux,extcon-usb-gpio";
74 id-gpios = <&tlmm 25 GPIO_ACTIVE_LOW>;
75 pinctrl-names = "default";
76 pinctrl-0 = <&usb_detect>;
79 vph_pwr: vph-pwr-regulator {
80 compatible = "regulator-fixed";
81 regulator-min-microvolt = <3700000>;
82 regulator-max-microvolt = <3700000>;
83 regulator-name = "vph_pwr";
88 wlan_en: wlan-en-1-8v {
89 compatible = "regulator-fixed";
90 regulator-name = "wlan-en-regulator";
91 regulator-min-microvolt = <1800000>;
92 regulator-max-microvolt = <1800000>;
93 gpio = <&tlmm 84 GPIO_ACTIVE_HIGH>;
94 pinctrl-names = "default";
95 pinctrl-0 = <&wl_reg_on>;
97 /* WLAN card specific delay */
98 startup-delay-us = <70000>;
104 clock-frequency = <355000>;
107 tof_sensor: vl53l0x@29 {
108 compatible = "st,vl53l0x";
118 clock-frequency = <355000>;
121 /* FUSB301 USB-C controller */
125 clock-frequency = <355000>;
129 compatible = "syna,rmi4-i2c";
131 interrupt-parent = <&tlmm>;
132 interrupts = <125 IRQ_TYPE_EDGE_FALLING>;
133 vdd-supply = <&panel_tvdd>;
135 syna,reset-delay-ms = <220>;
136 syna,startup-delay-ms = <220>;
137 #address-cells = <1>;
142 syna,nosleep-mode = <1>;
147 syna,sensor-type = <1>;
157 drive-strength = <2>;
162 drive-strength = <2>;
168 drive-strength = <2>;
173 drive-strength = <2>;
178 drive-strength = <2>;
183 vdd-supply = <&pm8994_l28>;
184 vdda-pll-supply = <&pm8994_l12>;
185 vdda-phy-dpdm-supply = <&pm8994_l24>;
190 vdd-gfx-supply = <&vdd_gfx>;
194 perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
195 wake-gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>;
196 vddpe-3v3-supply = <&wlan_en>;
197 vdda-supply = <&pm8994_l28>;
202 vdda-phy-supply = <&pm8994_l28>;
203 vdda-pll-supply = <&pm8994_l12>;
208 pinctrl-names = "default";
209 pinctrl-0 = <&pm8994_gpios_defaults>;
235 * We don't yet know for sure which GPIOs are of our interest, but what
236 * we do know is that if a vendor sets the pins to a non-default state, there's
237 * probably a reason for it, and just to be on the safe side, we follow suit.
239 pm8994_gpios_defaults: pm8994-gpios-default-state {
240 pm8994-gpio1-nc-pins {
242 function = PMIC_GPIO_FUNC_NORMAL;
249 function = PMIC_GPIO_FUNC_NORMAL;
253 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
254 power-source = <PM8994_GPIO_S4>;
259 function = PMIC_GPIO_FUNC_NORMAL;
263 power-source = <PM8994_GPIO_S4>;
266 camera-snapshot-n-pins {
268 function = PMIC_GPIO_FUNC_NORMAL;
272 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
273 power-source = <PM8994_GPIO_S4>;
276 camera-focus-n-pins {
278 function = PMIC_GPIO_FUNC_NORMAL;
282 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
283 power-source = <PM8994_GPIO_S4>;
286 pm8994-gpio6-nc-pins {
288 function = PMIC_GPIO_FUNC_NORMAL;
291 power-source = <PM8994_GPIO_VPH>;
296 function = PMIC_GPIO_FUNC_NORMAL;
300 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
301 power-source = <PM8994_GPIO_S4>;
304 pm8994-gpio8-nc-pins {
306 function = PMIC_GPIO_FUNC_NORMAL;
310 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
311 power-source = <PM8994_GPIO_VPH>;
314 pm8994-gpio9-nc-pins {
316 function = PMIC_GPIO_FUNC_NORMAL;
320 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
321 power-source = <PM8994_GPIO_VPH>;
326 function = PMIC_GPIO_FUNC_NORMAL;
330 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
331 power-source = <PM8994_GPIO_S4>;
334 pm8994-gpio11-nc-pins {
336 function = PMIC_GPIO_FUNC_NORMAL;
339 power-source = <PM8994_GPIO_VPH>;
342 pm8994-gpio12-nc-pins {
344 function = PMIC_GPIO_FUNC_NORMAL;
347 power-source = <PM8994_GPIO_VPH>;
352 function = PMIC_GPIO_FUNC_NORMAL;
356 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
357 power-source = <PM8994_GPIO_S4>;
360 pm8994-gpio14-nc-pins {
362 function = PMIC_GPIO_FUNC_NORMAL;
366 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
367 power-source = <PM8994_GPIO_VPH>;
370 pm-divclk1-gpio-pins {
376 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
377 power-source = <PM8994_GPIO_VPH>;
382 function = PMIC_GPIO_FUNC_NORMAL;
386 pm8994-gpio17-nc-pins {
388 function = PMIC_GPIO_FUNC_NORMAL;
391 power-source = <PM8994_GPIO_VPH>;
396 function = PMIC_GPIO_FUNC_FUNC2;
400 qcom,drive-strength = <PMIC_GPIO_STRENGTH_MED>;
401 power-source = <PM8994_GPIO_S4>;
404 pm8994-gpio19-nc-pins {
406 function = PMIC_GPIO_FUNC_NORMAL;
410 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
411 power-source = <PM8994_GPIO_VPH>;
414 pm8994-gpio22-nc-pins {
416 function = PMIC_GPIO_FUNC_NORMAL;
419 power-source = <PM8994_GPIO_VPH>;
425 pinctrl-names = "default";
426 pinctrl-0 = <&pm8994_mpps_defaults>;
438 pm8994_mpps_defaults: pm8994-mpps-default-state {
439 lcd-id_adc-mpp-pins {
443 qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH6>;
448 function = "digital";
450 power-source = <PM8994_GPIO_VPH>;
453 flash-therm-mpp-pins {
457 qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH5>;
462 function = "digital";
470 qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH8>;
476 linux,code = <KEY_VOLUMEUP>;
481 pinctrl-names = "default";
482 pinctrl-0 = <&pmi8994_gpios_defaults>;
496 pmi8994_gpios_defaults: pmi8994-gpios-default-state {
497 vib-ldo-en-gpio-pins {
499 function = PMIC_GPIO_FUNC_NORMAL;
503 power-source = <PM8994_GPIO_S4>;
508 function = PMIC_GPIO_FUNC_NORMAL;
512 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
513 power-source = <PM8994_GPIO_VPH>;
518 function = PMIC_GPIO_FUNC_NORMAL;
522 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
523 power-source = <PM8994_GPIO_VPH>;
528 function = PMIC_GPIO_FUNC_NORMAL;
531 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
532 power-source = <PM8994_GPIO_S4>;
537 function = PMIC_GPIO_FUNC_NORMAL;
540 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
541 power-source = <PM8994_GPIO_S4>;
546 function = PMIC_GPIO_FUNC_NORMAL;
549 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
550 power-source = <PM8994_GPIO_S4>;
555 function = PMIC_GPIO_FUNC_NORMAL;
558 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
559 power-source = <PM8994_GPIO_S4>;
564 function = PMIC_GPIO_FUNC_NORMAL;
567 qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
568 power-source = <PM8994_GPIO_S4>;
571 usb-switch-sel-pins {
573 function = PMIC_GPIO_FUNC_NORMAL;
579 function = PMIC_GPIO_FUNC_NORMAL;
583 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
584 power-source = <PM8994_GPIO_S4>;
589 &pm8994_spmi_regulators {
590 qcom,saw-reg = <&saw3>;
602 regulator-name = "vdd_apcc";
604 regulator-min-microvolt = <470000>;
605 regulator-max-microvolt = <1140000>;
610 qcom,power-source = <1>;
614 color = <LED_COLOR_ID_RGB>;
615 function = LED_FUNCTION_STATUS;
617 #address-cells = <1>;
622 color = <LED_COLOR_ID_BLUE>;
627 color = <LED_COLOR_ID_GREEN>;
632 color = <LED_COLOR_ID_RED>;
637 &pmi8994_spmi_regulators {
640 /* Pinned to a high value for now to avoid random crashes. */
641 regulator-min-microvolt = <1015000>;
642 regulator-max-microvolt = <1015000>;
643 regulator-name = "vdd_gfx";
649 default-brightness = <512>;
650 qcom,num-strings = <3>;
656 compatible = "qcom,rpm-pm8994-regulators";
658 vdd_s1-supply = <&vph_pwr>;
659 vdd_s2-supply = <&vph_pwr>;
660 vdd_s3-supply = <&vph_pwr>;
661 vdd_s4-supply = <&vph_pwr>;
662 vdd_s5-supply = <&vph_pwr>;
663 vdd_s6-supply = <&vph_pwr>;
664 vdd_s7-supply = <&vph_pwr>;
665 vdd_s8-supply = <&vph_pwr>;
666 vdd_s9-supply = <&vph_pwr>;
667 vdd_s10-supply = <&vph_pwr>;
668 vdd_s11-supply = <&vph_pwr>;
669 vdd_s12-supply = <&vph_pwr>;
670 vdd_l1-supply = <&pm8994_s3>;
671 vdd_l2_l26_l28-supply = <&pm8994_s3>;
672 vdd_l3_l11-supply = <&pm8994_s3>;
673 vdd_l4_l27_l31-supply = <&pm8994_s3>;
674 vdd_l5_l7-supply = <&pm8994_s5>;
675 vdd_l6_l12_l32-supply = <&pm8994_s5>;
676 vdd_l8_l16_l30-supply = <&vph_pwr>;
677 vdd_l14_l15-supply = <&pm8994_s5>;
678 vdd_l20_l21-supply = <&pm8994_s5>;
679 vdd_l25-supply = <&pm8994_s3>;
680 vdd_lvs1_2-supply = <&pm8994_s4>;
683 regulator-min-microvolt = <1300000>;
684 regulator-max-microvolt = <1300000>;
688 regulator-min-microvolt = <1800000>;
689 regulator-max-microvolt = <1800000>;
690 regulator-system-load = <325000>;
695 regulator-min-microvolt = <2150000>;
696 regulator-max-microvolt = <2150000>;
700 regulator-min-microvolt = <800000>;
701 regulator-max-microvolt = <800000>;
705 regulator-min-microvolt = <1000000>;
706 regulator-max-microvolt = <1000000>;
710 regulator-min-microvolt = <1250000>;
711 regulator-max-microvolt = <1250000>;
715 regulator-min-microvolt = <1100000>;
716 regulator-max-microvolt = <1100000>;
720 regulator-min-microvolt = <1225000>;
721 regulator-max-microvolt = <1225000>;
724 /* L6 and L7 seem unused. */
727 regulator-min-microvolt = <1800000>;
728 regulator-max-microvolt = <1800000>;
732 regulator-min-microvolt = <1800000>;
733 regulator-max-microvolt = <1800000>;
737 regulator-min-microvolt = <1800000>;
738 regulator-max-microvolt = <1800000>;
742 regulator-min-microvolt = <1100000>;
743 regulator-max-microvolt = <1100000>;
747 regulator-min-microvolt = <1800000>;
748 regulator-max-microvolt = <1800000>;
749 regulator-allow-set-load;
753 regulator-min-microvolt = <1800000>;
754 regulator-max-microvolt = <2950000>;
755 regulator-system-load = <22000>;
756 regulator-allow-set-load;
760 regulator-min-microvolt = <1700000>;
761 regulator-max-microvolt = <1900000>;
765 regulator-min-microvolt = <1800000>;
766 regulator-max-microvolt = <1800000>;
770 regulator-min-microvolt = <2700000>;
771 regulator-max-microvolt = <2700000>;
775 regulator-min-microvolt = <2200000>;
776 regulator-max-microvolt = <2500000>;
780 regulator-min-microvolt = <1800000>;
781 regulator-max-microvolt = <1800000>;
785 regulator-min-microvolt = <3000000>;
786 regulator-max-microvolt = <3000000>;
790 regulator-min-microvolt = <2950000>;
791 regulator-max-microvolt = <2950000>;
792 regulator-system-load = <570000>;
793 regulator-allow-set-load;
797 regulator-min-microvolt = <2950000>;
798 regulator-max-microvolt = <2950000>;
799 regulator-system-load = <800000>;
800 regulator-allow-set-load;
804 regulator-min-microvolt = <3000000>;
805 regulator-max-microvolt = <3000000>;
809 regulator-min-microvolt = <2700000>;
810 regulator-max-microvolt = <2700000>;
814 regulator-min-microvolt = <3075000>;
815 regulator-max-microvolt = <3075000>;
816 regulator-allow-set-load;
820 regulator-min-microvolt = <1200000>;
821 regulator-max-microvolt = <1200000>;
822 regulator-allow-set-load;
826 regulator-min-microvolt = <1000000>;
827 regulator-max-microvolt = <1200000>;
831 regulator-min-microvolt = <925000>;
832 regulator-max-microvolt = <925000>;
833 regulator-allow-set-load;
837 regulator-min-microvolt = <2700000>;
838 regulator-max-microvolt = <2700000>;
844 regulator-min-microvolt = <1800000>;
845 regulator-max-microvolt = <1800000>;
851 vmmc-supply = <&pm8994_l20>;
852 vqmmc-supply = <&pm8994_s4>;
859 cd-gpios = <&tlmm 40 GPIO_ACTIVE_HIGH>;
860 vmmc-supply = <&pm8994_l21>;
861 vqmmc-supply = <&pm8994_l13>;
866 gpio-reserved-ranges = <0 4>;
867 pinctrl-0 = <&sw_service_gpio>;
868 pinctrl-names = "default";
870 disp_reset_n_gpio: disp-reset-n-state {
873 drive-strength = <2>;
877 mdp_vsync_p_gpio: mdp-vsync-p-state {
879 function = "mdp_vsync";
880 drive-strength = <2>;
884 sw_service_gpio: sw-service-gpio-state {
887 drive-strength = <2>;
891 usb_detect: usb-detect-state {
894 drive-strength = <2>;
899 uim_detect_en: uim-detect-en-state {
902 drive-strength = <2>;
907 tray_det_pin: tray-det-state {
910 drive-strength = <2>;
914 tp_vddio_en: tp-vddio-en-state {
917 drive-strength = <2>;
922 lcd_vddio_en: lcd-vddio-en-state {
925 drive-strength = <2>;
930 wl_host_wake: wl-host-wake-state {
933 drive-strength = <2>;
937 wl_reg_on: wl-reg-on-state {
940 drive-strength = <2>;
945 ts_reset_n: ts-rst-n-state {
948 drive-strength = <2>;
951 touch_int_n: touch-int-n-state {
954 drive-strength = <2>;
958 touch_int_sleep: touch-int-sleep-state {
961 drive-strength = <2>;
967 qcom,select-utmi-as-pipe-clk;
973 dr_mode = "peripheral";
974 maximum-speed = "high-speed";
975 phys = <&hsusb_phy1>;
976 phy-names = "usb2-phy";
977 snps,hird-threshold = /bits/ 8 <0>;