code:
// SPDX-License-Identifier: GPL-2.0
#include "qcom-msm8974pro.dtsi"
#include "qcom-pma8084.dtsi"
#include <dt-bindings/input/input.h>
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
#include <dt-bindings/leds/common.h>

/ {
	model = "Samsung Galaxy S5";
	compatible = "samsung,klte", "qcom,msm8974pro", "qcom,msm8974";
	chassis-type = "handset";

	aliases {
		serial0 = &blsp1_uart1;
		mmc0 = &sdhc_1; /* SDC1 eMMC slot */
		mmc1 = &sdhc_3; /* SDC2 SD card slot */
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

	gpio-keys {
		compatible = "gpio-keys";

		pinctrl-names = "default";
		pinctrl-0 = <&gpio_keys_pin_a>;

		key-volume-down {
			label = "volume_down";
			gpios = <&pma8084_gpios 2 GPIO_ACTIVE_LOW>;
			linux,input-type = <1>;
			linux,code = <KEY_VOLUMEDOWN>;
			debounce-interval = <15>;
		};

		key-home {
			label = "home_key";
			gpios = <&pma8084_gpios 3 GPIO_ACTIVE_LOW>;
			linux,input-type = <1>;
			linux,code = <KEY_HOMEPAGE>;
			wakeup-source;
			debounce-interval = <15>;
		};

		key-volume-up {
			label = "volume_up";
			gpios = <&pma8084_gpios 5 GPIO_ACTIVE_LOW>;
			linux,input-type = <1>;
			linux,code = <KEY_VOLUMEUP>;
			debounce-interval = <15>;
		};
	};

	i2c-gpio-touchkey {
		compatible = "i2c-gpio";
		#address-cells = <1>;
		#size-cells = <0>;
		sda-gpios = <&tlmm 95 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
		scl-gpios = <&tlmm 96 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
		pinctrl-names = "default";
		pinctrl-0 = <&i2c_touchkey_pins>;

		touchkey@20 {
			compatible = "cypress,tm2-touchkey";
			reg = <0x20>;

			interrupt-parent = <&pma8084_gpios>;
			interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
			pinctrl-names = "default";
			pinctrl-0 = <&touchkey_pin>;

			vcc-supply = <&max77826_ldo15>;
			vdd-supply = <&pma8084_l19>;

			linux,keycodes = <KEY_APPSELECT KEY_BACK>;
		};
	};

	i2c-gpio-led {
		compatible = "i2c-gpio";
		#address-cells = <1>;
		#size-cells = <0>;
		scl-gpios = <&tlmm 121 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
		sda-gpios = <&tlmm 120 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
		pinctrl-names = "default";
		pinctrl-0 = <&i2c_led_gpioex_pins>;

		i2c-gpio,delay-us = <2>;

		gpio_expander: gpio@20 {
			compatible = "nxp,pcal6416";
			reg = <0x20>;

			gpio-controller;
			#gpio-cells = <2>;

			vcc-supply = <&pma8084_s4>;

			pinctrl-names = "default";
			pinctrl-0 = <&gpioex_pin>;

			reset-gpios = <&tlmm 145 GPIO_ACTIVE_LOW>;
		};

		led-controller@30 {
			compatible = "panasonic,an30259a";
			reg = <0x30>;

			#address-cells = <1>;
			#size-cells = <0>;

			led@1 {
				reg = <1>;
				function = LED_FUNCTION_STATUS;
				color = <LED_COLOR_ID_RED>;
			};

			led@2 {
				reg = <2>;
				function = LED_FUNCTION_STATUS;
				color = <LED_COLOR_ID_GREEN>;
			};

			led@3 {
				reg = <3>;
				function = LED_FUNCTION_STATUS;
				color = <LED_COLOR_ID_BLUE>;
			};
		};
	};

	vreg_wlan: wlan-regulator {
		compatible = "regulator-fixed";

		regulator-name = "wl-reg";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		gpio = <&gpio_expander 8 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	vreg_panel: panel-regulator {
		compatible = "regulator-fixed";

		pinctrl-names = "default";
		pinctrl-0 = <&panel_en_pin>;

		regulator-name = "panel-vddr-reg";
		regulator-min-microvolt = <1500000>;
		regulator-max-microvolt = <1500000>;

		gpio = <&pma8084_gpios 14 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	/delete-node/ vreg-boost;
};

&blsp1_i2c2 {
	status = "okay";

	touchscreen@20 {
		compatible = "syna,rmi4-i2c";
		reg = <0x20>;

		interrupt-parent = <&pma8084_gpios>;
		interrupts = <8 IRQ_TYPE_EDGE_FALLING>;

		vdd-supply = <&max77826_ldo13>;
		vio-supply = <&pma8084_lvs2>;

		pinctrl-names = "default";
		pinctrl-0 = <&touch_pin>;

		syna,startup-delay-ms = <100>;

		#address-cells = <1>;
		#size-cells = <0>;

		rmi4-f01@1 {
			reg = <0x1>;
			syna,nosleep-mode = <1>;
		};

		rmi4-f12@12 {
			reg = <0x12>;
			syna,sensor-type = <1>;
		};
	};
};

&blsp1_i2c6 {
	status = "okay";

	pmic@60 {
		reg = <0x60>;
		compatible = "maxim,max77826";

		regulators {
			max77826_ldo1: LDO1 {
				regulator-min-microvolt = <1200000>;
				regulator-max-microvolt = <1200000>;
			};

			max77826_ldo2: LDO2 {
				regulator-min-microvolt = <1000000>;
				regulator-max-microvolt = <1000000>;
			};

			max77826_ldo3: LDO3 {
				regulator-min-microvolt = <1200000>;
				regulator-max-microvolt = <1200000>;
			};

			max77826_ldo4: LDO4 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
			};

			max77826_ldo5: LDO5 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
			};

			max77826_ldo6: LDO6 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
			};

			max77826_ldo7: LDO7 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
			};

			max77826_ldo8: LDO8 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <3300000>;
			};

			max77826_ldo9: LDO9 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
			};

			max77826_ldo10: LDO10 {
				regulator-min-microvolt = <2800000>;
				regulator-max-microvolt = <2950000>;
			};

			max77826_ldo11: LDO11 {
				regulator-min-microvolt = <2700000>;
				regulator-max-microvolt = <2950000>;
			};

			max77826_ldo12: LDO12 {
				regulator-min-microvolt = <2500000>;
				regulator-max-microvolt = <3300000>;
			};

			max77826_ldo13: LDO13 {
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
			};

			max77826_ldo14: LDO14 {
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
			};

			max77826_ldo15: LDO15 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
			};

			max77826_buck: BUCK {
				regulator-min-microvolt = <1225000>;
				regulator-max-microvolt = <1225000>;
			};

			max77826_buckboost: BUCKBOOST {
				regulator-min-microvolt = <3400000>;
				regulator-max-microvolt = <3400000>;
			};
		};
	};
};

&blsp1_uart2 {
	status = "okay";
};

&blsp2_i2c6 {
	status = "okay";

	fuelgauge@36 {
		compatible = "maxim,max17048";
		reg = <0x36>;

		maxim,double-soc;
		maxim,rcomp = /bits/ 8 <0x56>;

		interrupt-parent = <&pma8084_gpios>;
		interrupts = <21 IRQ_TYPE_LEVEL_LOW>;

		pinctrl-names = "default";
		pinctrl-0 = <&fuelgauge_pin>;
	};
};

&blsp2_uart2 {
	status = "okay";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&blsp2_uart2_pins_active>;
	pinctrl-1 = <&blsp2_uart2_pins_sleep>;

	bluetooth {
		compatible = "brcm,bcm43540-bt";
		max-speed = <3000000>;
		pinctrl-names = "default";
		pinctrl-0 = <&bt_pins>;
		device-wakeup-gpios = <&tlmm 91 GPIO_ACTIVE_HIGH>;
		shutdown-gpios = <&gpio_expander 9 GPIO_ACTIVE_HIGH>;
		interrupt-parent = <&tlmm>;
		interrupts = <75 IRQ_TYPE_LEVEL_HIGH>;
		interrupt-names = "host-wakeup";
	};
};

&dsi0 {
	status = "okay";

	vdda-supply = <&pma8084_l2>;
	vdd-supply = <&pma8084_l22>;
	vddio-supply = <&pma8084_l12>;

	panel: panel@0 {
		reg = <0>;
		compatible = "samsung,s6e3fa2";

		pinctrl-names = "default";
		pinctrl-0 = <&panel_te_pin &panel_rst_pin>;

		iovdd-supply = <&pma8084_lvs4>;
		vddr-supply = <&vreg_panel>;

		reset-gpios = <&pma8084_gpios 17 GPIO_ACTIVE_LOW>;
		te-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;

		port {
			panel_in: endpoint {
				remote-endpoint = <&dsi0_out>;
			};
		};
	};
};

&dsi0_out {
	remote-endpoint = <&panel_in>;
	data-lanes = <0 1 2 3>;
};

&dsi0_phy {
	status = "okay";

	vddio-supply = <&pma8084_l12>;
};

&gpu {
	status = "okay";
};

&mdss {
	status = "okay";
};

&pma8084_gpios {
	gpio_keys_pin_a: gpio-keys-active-state {
		pins = "gpio2", "gpio3", "gpio5";
		function = "normal";

		bias-pull-up;
		power-source = <PMA8084_GPIO_S4>;
	};

	touchkey_pin: touchkey-int-state {
		pins = "gpio6";
		function = "normal";
		bias-disable;
		input-enable;
		power-source = <PMA8084_GPIO_S4>;
	};

	touch_pin: touchscreen-int-state {
		pins = "gpio8";
		function = "normal";
		bias-disable;
		input-enable;
		power-source = <PMA8084_GPIO_S4>;
	};

	panel_en_pin: panel-en-state {
		pins = "gpio14";
		function = "normal";
		bias-pull-up;
		power-source = <PMA8084_GPIO_S4>;
		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
	};

	wlan_sleep_clk_pin: wlan-sleep-clk-state {
		pins = "gpio16";
		function = "func2";

		output-high;
		power-source = <PMA8084_GPIO_S4>;
		qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
	};

	panel_rst_pin: panel-rst-state {
		pins = "gpio17";
		function = "normal";
		bias-disable;
		power-source = <PMA8084_GPIO_S4>;
		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
	};

	fuelgauge_pin: fuelgauge-int-state {
		pins = "gpio21";
		function = "normal";
		bias-disable;
		input-enable;
		power-source = <PMA8084_GPIO_S4>;
	};
};

&remoteproc_adsp {
	status = "okay";
	cx-supply = <&pma8084_s2>;
};

&remoteproc_mss {
	status = "okay";
	cx-supply = <&pma8084_s2>;
	mss-supply = <&pma8084_s6>;
	mx-supply = <&pma8084_s1>;
	pll-supply = <&pma8084_l12>;
};

&rpm_requests {
	regulators-0 {
		compatible = "qcom,rpm-pma8084-regulators";

		pma8084_s1: s1 {
			regulator-min-microvolt = <675000>;
			regulator-max-microvolt = <1050000>;
			regulator-always-on;
		};

		pma8084_s2: s2 {
			regulator-min-microvolt = <500000>;
			regulator-max-microvolt = <1050000>;
		};

		pma8084_s3: s3 {
			regulator-min-microvolt = <1300000>;
			regulator-max-microvolt = <1300000>;
		};

		pma8084_s4: s4 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};

		pma8084_s5: s5 {
			regulator-min-microvolt = <2150000>;
			regulator-max-microvolt = <2150000>;
		};

		pma8084_s6: s6 {
			regulator-min-microvolt = <1050000>;
			regulator-max-microvolt = <1050000>;
		};

		pma8084_l1: l1 {
			regulator-min-microvolt = <1225000>;
			regulator-max-microvolt = <1225000>;
		};

		pma8084_l2: l2 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
		};

		pma8084_l3: l3 {
			regulator-min-microvolt = <1050000>;
			regulator-max-microvolt = <1200000>;
		};

		pma8084_l4: l4 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1225000>;
		};

		pma8084_l5: l5 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};

		pma8084_l6: l6 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};

		pma8084_l7: l7 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};

		pma8084_l8: l8 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};

		pma8084_l9: l9 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
		};

		pma8084_l10: l10 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
		};

		pma8084_l11: l11 {
			regulator-min-microvolt = <1300000>;
			regulator-max-microvolt = <1300000>;
		};

		pma8084_l12: l12 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-always-on;
		};

		pma8084_l13: l13 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
		};

		pma8084_l14: l14 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};

		pma8084_l15: l15 {
			regulator-min-microvolt = <2050000>;
			regulator-max-microvolt = <2050000>;
		};

		pma8084_l16: l16 {
			regulator-min-microvolt = <2700000>;
			regulator-max-microvolt = <2700000>;
		};

		pma8084_l17: l17 {
			regulator-min-microvolt = <2850000>;
			regulator-max-microvolt = <2850000>;
		};

		pma8084_l18: l18 {
			regulator-min-microvolt = <2850000>;
			regulator-max-microvolt = <2850000>;
		};

		pma8084_l19: l19 {
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
		};

		pma8084_l20: l20 {
			regulator-min-microvolt = <2950000>;
			regulator-max-microvolt = <2950000>;
			regulator-system-load = <200000>;
			regulator-allow-set-load;
		};

		pma8084_l21: l21 {
			regulator-min-microvolt = <2950000>;
			regulator-max-microvolt = <2950000>;
			regulator-system-load = <200000>;
			regulator-allow-set-load;
		};

		pma8084_l22: l22 {
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3300000>;
		};

		pma8084_l23: l23 {
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3000000>;
		};

		pma8084_l24: l24 {
			regulator-min-microvolt = <3075000>;
			regulator-max-microvolt = <3075000>;
		};

		pma8084_l25: l25 {
			regulator-min-microvolt = <2100000>;
			regulator-max-microvolt = <2100000>;
		};

		pma8084_l26: l26 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2050000>;
		};

		pma8084_l27: l27 {
			regulator-min-microvolt = <1000000>;
			regulator-max-microvolt = <1225000>;
		};

		pma8084_lvs1: lvs1 {};
		pma8084_lvs2: lvs2 {};
		pma8084_lvs3: lvs3 {};
		pma8084_lvs4: lvs4 {};

		pma8084_5vs1: 5vs1 {};
	};
};

&sdhc_1 {
	status = "okay";

	vmmc-supply = <&pma8084_l20>;
	vqmmc-supply = <&pma8084_s4>;

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc1_on>;
	pinctrl-1 = <&sdc1_off>;
};

&sdhc_2 {
	status = "okay";
	max-frequency = <100000000>;
	vmmc-supply = <&vreg_wlan>;
	vqmmc-supply = <&pma8084_s4>;
	non-removable;

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc2_on>;
	pinctrl-1 = <&sdc2_off>;

	wifi@1 {
		reg = <1>;
		compatible = "brcm,bcm4329-fmac";

		interrupt-parent = <&tlmm>;
		interrupts = <92 IRQ_TYPE_LEVEL_HIGH>;
		interrupt-names = "host-wake";

		pinctrl-names = "default";
		pinctrl-0 = <&wlan_sleep_clk_pin &wifi_pin>;
	};
};

&sdhc_3 {
	status = "okay";
	max-frequency = <100000000>;
	vmmc-supply = <&pma8084_l21>;
	vqmmc-supply = <&pma8084_l13>;

	/*
	 * cd-gpio is intentionally disabled. If enabled, an SD card
	 * present during boot is not initialized correctly. Without
	 * cd-gpios the driver resorts to polling, so hotplug works.
	 */
	pinctrl-names = "default";
	pinctrl-0 = <&sdc3_on /* &sdhc3_cd_pin */>;
	/* cd-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>; */
};

&tlmm {
	/* This seems suspicious, but somebody with this device should look into it. */
	blsp2_uart2_pins_active: blsp2-uart2-pins-active-state {
		pins = "gpio45", "gpio46", "gpio47", "gpio48";
		function = "blsp_uart8";
		drive-strength = <8>;
		bias-disable;
	};

	blsp2_uart2_pins_sleep: blsp2-uart2-pins-sleep-state {
		pins = "gpio45", "gpio46", "gpio47", "gpio48";
		function = "gpio";
		drive-strength = <2>;
		bias-pull-down;
	};

	bt_pins: bt-pins-state {
		hostwake-pins {
			pins = "gpio75";
			function = "gpio";
			drive-strength = <16>;
			input-enable;
		};

		devwake-pins {
			pins = "gpio91";
			function = "gpio";
			drive-strength = <2>;
		};
	};

	sdc1_on: sdhc1-on-state {
		clk-pins {
			pins = "sdc1_clk";
			drive-strength = <4>;
			bias-disable;
		};

		cmd-data-pins {
			pins = "sdc1_cmd", "sdc1_data";
			drive-strength = <4>;
			bias-pull-up;
		};
	};

	sdc3_on: sdc3-on-state {
		pins = "gpio35", "gpio36", "gpio37", "gpio38", "gpio39", "gpio40";
		function = "sdc3";
		drive-strength = <8>;
		bias-disable;
	};

	sdhc3_cd_pin: sdc3-cd-on-state {
		pins = "gpio62";
		function = "gpio";

		drive-strength = <2>;
		bias-disable;
	};

	sdc2_on: sdhc2-on-state {
		clk-pins {
			pins = "sdc2_clk";
			drive-strength = <6>;
			bias-disable;
		};

		cmd-data-pins {
			pins = "sdc2_cmd", "sdc2_data";
			drive-strength = <6>;
			bias-pull-up;
		};
	};

	i2c_touchkey_pins: i2c-touchkey-state {
		pins = "gpio95", "gpio96";
		function = "gpio";
		input-enable;
		bias-pull-up;
	};

	i2c_led_gpioex_pins: i2c-led-gpioex-state {
		pins = "gpio120", "gpio121";
		function = "gpio";
		input-enable;
		bias-pull-down;
	};

	gpioex_pin: gpioex-state {
		pins = "gpio145";
		function = "gpio";
		bias-pull-up;
		drive-strength = <2>;
	};

	wifi_pin: wifi-state {
		pins = "gpio92";
		function = "gpio";
		input-enable;
		bias-pull-down;
	};

	panel_te_pin: panel-state {
		pins = "gpio12";
		function = "mdp_vsync";
		drive-strength = <2>;
		bias-disable;
	};
};

&usb {
	status = "okay";

	phys = <&usb_hs1_phy>;
	phy-select = <&tcsr 0xb000 0>;

	hnp-disable;
	srp-disable;
	adp-disable;
};

&usb_hs1_phy {
	status = "okay";

	v1p8-supply = <&pma8084_l6>;
	v3p3-supply = <&pma8084_l24>;

	qcom,init-seq = /bits/ 8 <0x1 0x64>;
};


code:
// SPDX-License-Identifier: GPL-2.0
#include "qcom-msm8974pro.dtsi"
#include "qcom-pm8841.dtsi"
#include "qcom-pm8941.dtsi"
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>

/ {
	model = "Sony Xperia Z2 Tablet";
	compatible = "sony,xperia-castor", "qcom,msm8974pro", "qcom,msm8974";
	chassis-type = "tablet";

	aliases {
		serial0 = &blsp1_uart2;
		serial1 = &blsp2_uart1;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

	gpio-keys {
		compatible = "gpio-keys";

		pinctrl-names = "default";
		pinctrl-0 = <&gpio_keys_pin_a>;

		key-volume-down {
			label = "volume_down";
			gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
			linux,input-type = <1>;
			linux,code = <KEY_VOLUMEDOWN>;
		};

		key-camera-snapshot {
			label = "camera_snapshot";
			gpios = <&pm8941_gpios 3 GPIO_ACTIVE_LOW>;
			linux,input-type = <1>;
			linux,code = <KEY_CAMERA>;
		};

		key-camera-focus {
			label = "camera_focus";
			gpios = <&pm8941_gpios 4 GPIO_ACTIVE_LOW>;
			linux,input-type = <1>;
			linux,code = <KEY_CAMERA_FOCUS>;
		};

		key-volume-up {
			label = "volume_up";
			gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
			linux,input-type = <1>;
			linux,code = <KEY_VOLUMEUP>;
		};
	};

	vreg_bl_vddio: lcd-backlight-vddio {
		compatible = "regulator-fixed";
		regulator-name = "vreg_bl_vddio";
		regulator-min-microvolt = <3150000>;
		regulator-max-microvolt = <3150000>;

		gpio = <&tlmm 69 0>;
		enable-active-high;

		vin-supply = <&pm8941_s3>;
		startup-delay-us = <70000>;

		pinctrl-names = "default";
		pinctrl-0 = <&lcd_backlight_en_pin_a>;
	};

	vreg_vsp: lcd-dcdc-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vreg_vsp";
		regulator-min-microvolt = <5600000>;
		regulator-max-microvolt = <5600000>;

		gpio = <&pm8941_gpios 20 GPIO_ACTIVE_HIGH>;
		enable-active-high;

		pinctrl-names = "default";
		pinctrl-0 = <&lcd_dcdc_en_pin_a>;
	};

	vreg_wlan: wlan-regulator {
		compatible = "regulator-fixed";

		regulator-name = "wl-reg";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		gpio = <&pm8941_gpios 18 GPIO_ACTIVE_HIGH>;
		enable-active-high;

		pinctrl-names = "default";
		pinctrl-0 = <&wlan_regulator_pin>;
	};
};

&blsp1_uart2 {
	status = "okay";
};

&blsp2_i2c2 {
	status = "okay";
	clock-frequency = <355000>;

	synaptics@2c {
		compatible = "syna,rmi4-i2c";
		reg = <0x2c>;

		interrupt-parent = <&tlmm>;
		interrupts = <86 IRQ_TYPE_EDGE_FALLING>;

		#address-cells = <1>;
		#size-cells = <0>;

		vdd-supply = <&pm8941_l22>;
		vio-supply = <&pm8941_lvs3>;

		pinctrl-names = "default";
		pinctrl-0 = <&ts_int_pin>;

		syna,startup-delay-ms = <10>;

		rmi-f01@1 {
			reg = <0x1>;
			syna,nosleep = <1>;
		};

		rmi-f11@11 {
			reg = <0x11>;
			syna,f11-flip-x = <1>;
			syna,sensor-type = <1>;
		};
	};
};

&blsp2_i2c5 {
	status = "okay";
	clock-frequency = <355000>;

	lp8566_wled: backlight@2c {
		compatible = "ti,lp8556";
		reg = <0x2c>;
		power-supply = <&vreg_bl_vddio>;

		bl-name = "backlight";
		dev-ctrl = /bits/ 8 <0x05>;
		init-brt = /bits/ 8 <0x3f>;
		rom_a0h {
			rom-addr = /bits/ 8 <0xa0>;
			rom-val = /bits/ 8 <0xff>;
		};
		rom_a1h {
			rom-addr = /bits/ 8 <0xa1>;
			rom-val = /bits/ 8 <0x3f>;
		};
		rom_a2h {
			rom-addr = /bits/ 8 <0xa2>;
			rom-val = /bits/ 8 <0x20>;
		};
		rom_a3h {
			rom-addr = /bits/ 8 <0xa3>;
			rom-val = /bits/ 8 <0x5e>;
		};
		rom_a4h {
			rom-addr = /bits/ 8 <0xa4>;
			rom-val = /bits/ 8 <0x02>;
		};
		rom_a5h {
			rom-addr = /bits/ 8 <0xa5>;
			rom-val = /bits/ 8 <0x04>;
		};
		rom_a6h {
			rom-addr = /bits/ 8 <0xa6>;
			rom-val = /bits/ 8 <0x80>;
		};
		rom_a7h {
			rom-addr = /bits/ 8 <0xa7>;
			rom-val = /bits/ 8 <0xf7>;
		};
		rom_a9h {
			rom-addr = /bits/ 8 <0xa9>;
			rom-val = /bits/ 8 <0x80>;
		};
		rom_aah {
			rom-addr = /bits/ 8 <0xaa>;
			rom-val = /bits/ 8 <0x0f>;
		};
		rom_aeh {
			rom-addr = /bits/ 8 <0xae>;
			rom-val = /bits/ 8 <0x0f>;
		};
	};
};

&blsp2_uart1 {
	status = "okay";

	bluetooth {
		compatible = "brcm,bcm43438-bt";
		max-speed = <3000000>;

		pinctrl-names = "default";
		pinctrl-0 = <&bt_host_wake_pin>, <&bt_dev_wake_pin>, <&bt_reg_on_pin>;

		host-wakeup-gpios = <&tlmm 95 GPIO_ACTIVE_HIGH>;
		device-wakeup-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
		shutdown-gpios = <&pm8941_gpios 16 GPIO_ACTIVE_HIGH>;
	};
};

&pm8941_coincell {
	status = "okay";

	qcom,rset-ohms = <2100>;
	qcom,vset-millivolts = <3000>;
};

&pm8941_gpios {
	gpio_keys_pin_a: gpio-keys-active-state {
		pins = "gpio2", "gpio5";
		function = "normal";

		bias-pull-up;
		power-source = <PM8941_GPIO_S3>;
	};

	bt_reg_on_pin: bt-reg-on-state {
		pins = "gpio16";
		function = "normal";

		output-low;
		power-source = <PM8941_GPIO_S3>;
	};

	wlan_sleep_clk_pin: wl-sleep-clk-state {
		pins = "gpio17";
		function = "func2";

		output-high;
		power-source = <PM8941_GPIO_S3>;
	};

	wlan_regulator_pin: wl-reg-active-state {
		pins = "gpio18";
		function = "normal";

		bias-disable;
		power-source = <PM8941_GPIO_S3>;
	};

	lcd_dcdc_en_pin_a: lcd-dcdc-en-active-state {
		pins = "gpio20";
		function = "normal";

		bias-disable;
		power-source = <PM8941_GPIO_S3>;
		input-disable;
		output-low;
	};

};

&pm8941_lpg {
	status = "okay";

	qcom,power-source = <1>;

	multi-led {
		color = <LED_COLOR_ID_RGB>;
		function = LED_FUNCTION_STATUS;

		#address-cells = <1>;
		#size-cells = <0>;

		led@5 {
			reg = <5>;
			color = <LED_COLOR_ID_BLUE>;
		};

		led@6 {
			reg = <6>;
			color = <LED_COLOR_ID_GREEN>;
		};

		led@7 {
			reg = <7>;
			color = <LED_COLOR_ID_RED>;
		};
	};
};

&rpm_requests {
	regulators-0 {
		compatible = "qcom,rpm-pm8941-regulators";

		vdd_l1_l3-supply = <&pm8941_s1>;
		vdd_l2_lvs1_2_3-supply = <&pm8941_s3>;
		vdd_l4_l11-supply = <&pm8941_s1>;
		vdd_l5_l7-supply = <&pm8941_s2>;
		vdd_l6_l12_l14_l15-supply = <&pm8941_s2>;
		vdd_l9_l10_l17_l22-supply = <&vreg_boost>;
		vdd_l13_l20_l23_l24-supply = <&vreg_boost>;
		vdd_l21-supply = <&vreg_boost>;

		pm8941_s1: s1 {
			regulator-min-microvolt = <1300000>;
			regulator-max-microvolt = <1300000>;
			regulator-always-on;
			regulator-boot-on;
		};

		pm8941_s2: s2 {
			regulator-min-microvolt = <2150000>;
			regulator-max-microvolt = <2150000>;
			regulator-boot-on;
		};

		pm8941_s3: s3 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-system-load = <154000>;
			regulator-always-on;
			regulator-boot-on;
		};

		pm8941_s4: s4 {
			regulator-min-microvolt = <5000000>;
			regulator-max-microvolt = <5000000>;
		};

		pm8941_l1: l1 {
			regulator-min-microvolt = <1225000>;
			regulator-max-microvolt = <1225000>;
			regulator-always-on;
			regulator-boot-on;
		};

		pm8941_l2: l2 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
		};

		pm8941_l3: l3 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
		};

		pm8941_l4: l4 {
			regulator-min-microvolt = <1225000>;
			regulator-max-microvolt = <1225000>;
		};

		pm8941_l5: l5 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};

		pm8941_l6: l6 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-boot-on;
		};

		pm8941_l7: l7 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-boot-on;
		};

		pm8941_l8: l8 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};

		pm8941_l9: l9 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
		};

		pm8941_l11: l11 {
			regulator-min-microvolt = <1300000>;
			regulator-max-microvolt = <1350000>;
		};

		pm8941_l12: l12 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-always-on;
			regulator-boot-on;
		};

		pm8941_l13: l13 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
			regulator-boot-on;
		};

		pm8941_l14: l14 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};

		pm8941_l15: l15 {
			regulator-min-microvolt = <2050000>;
			regulator-max-microvolt = <2050000>;
		};

		pm8941_l16: l16 {
			regulator-min-microvolt = <2700000>;
			regulator-max-microvolt = <2700000>;
		};

		pm8941_l17: l17 {
			regulator-min-microvolt = <2700000>;
			regulator-max-microvolt = <2700000>;
		};

		pm8941_l18: l18 {
			regulator-min-microvolt = <2850000>;
			regulator-max-microvolt = <2850000>;
		};

		pm8941_l19: l19 {
			regulator-min-microvolt = <2850000>;
			regulator-max-microvolt = <2850000>;
		};

		pm8941_l20: l20 {
			regulator-min-microvolt = <2950000>;
			regulator-max-microvolt = <2950000>;
			regulator-system-load = <500000>;
			regulator-allow-set-load;
			regulator-boot-on;
		};

		pm8941_l21: l21 {
			regulator-min-microvolt = <2950000>;
			regulator-max-microvolt = <2950000>;
			regulator-boot-on;
		};

		pm8941_l22: l22 {
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3000000>;
		};

		pm8941_l23: l23 {
			regulator-min-microvolt = <2800000>;
			regulator-max-microvolt = <2800000>;
		};

		pm8941_l24: l24 {
			regulator-min-microvolt = <3075000>;
			regulator-max-microvolt = <3075000>;
			regulator-boot-on;
		};

		pm8941_lvs3: lvs3 {};
	};
};

&sdhc_1 {
	status = "okay";

	vmmc-supply = <&pm8941_l20>;
	vqmmc-supply = <&pm8941_s3>;

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc1_on>;
	pinctrl-1 = <&sdc1_off>;
};

&sdhc_2 {
	status = "okay";

	vmmc-supply = <&pm8941_l21>;
	vqmmc-supply = <&pm8941_l13>;

	cd-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>;

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc2_on>;
	pinctrl-1 = <&sdc2_off>;
};

&sdhc_3 {
	status = "okay";

	max-frequency = <100000000>;
	vmmc-supply = <&vreg_wlan>;
	non-removable;

	pinctrl-names = "default";
	pinctrl-0 = <&sdc3_on>;

	#address-cells = <1>;
	#size-cells = <0>;

	bcrmf@1 {
		compatible = "brcm,bcm4339-fmac", "brcm,bcm4329-fmac";
		reg = <1>;

		brcm,drive-strength = <10>;

		pinctrl-names = "default";
		pinctrl-0 = <&wlan_sleep_clk_pin>;
	};
};

&smbb {
	qcom,fast-charge-safe-current = <1500000>;
	qcom,fast-charge-current-limit = <1500000>;
	qcom,dc-current-limit = <1800000>;
	qcom,fast-charge-safe-voltage = <4400000>;
	qcom,fast-charge-high-threshold-voltage = <4350000>;
	qcom,fast-charge-low-threshold-voltage = <3400000>;
	qcom,auto-recharge-threshold-voltage = <4200000>;
	qcom,minimum-input-voltage = <4300000>;
};

&tlmm {
	lcd_backlight_en_pin_a: lcd-backlight-vddio-state {
		pins = "gpio69";
		function = "gpio";
		drive-strength = <10>;
		output-low;
		bias-disable;
	};

	sdc1_on: sdc1-on-state {
		clk-pins {
			pins = "sdc1_clk";
			drive-strength = <16>;
			bias-disable;
		};

		cmd-data-pins {
			pins = "sdc1_cmd", "sdc1_data";
			drive-strength = <10>;
			bias-pull-up;
		};
	};

	sdc2_on: sdc2-on-state {
		clk-pins {
			pins = "sdc2_clk";
			drive-strength = <6>;
			bias-disable;
		};

		cmd-data-pins {
			pins = "sdc2_cmd", "sdc2_data";
			drive-strength = <6>;
			bias-pull-up;
		};

		cd-pins {
			pins = "gpio62";
			function = "gpio";
			drive-strength = <2>;
			bias-disable;
		};
	};

	sdc3_on: sdc3-on-state {
		clk-pins {
			pins = "gpio40";
			function = "sdc3";
			drive-strength = <10>;
			bias-disable;
		};

		cmd-pins {
			pins = "gpio39";
			function = "sdc3";
			drive-strength = <10>;
			bias-pull-up;
		};

		data-pins {
			pins = "gpio35", "gpio36", "gpio37", "gpio38";
			function = "sdc3";
			drive-strength = <10>;
			bias-pull-up;
		};
	};

	ts_int_pin: ts-int-pin-state {
		pins = "gpio86";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
		input-enable;
	};

	bt_host_wake_pin: bt-host-wake-state {
		pins = "gpio95";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
		output-low;
	};

	bt_dev_wake_pin: bt-dev-wake-state {
		pins = "gpio96";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
	};
};

&usb {
	status = "okay";

	phys = <&usb_hs1_phy>;
	phy-select = <&tcsr 0xb000 0>;
	extcon = <&smbb>, <&usb_id>;
	vbus-supply = <&chg_otg>;

	hnp-disable;
	srp-disable;
	adp-disable;
};

&usb_hs1_phy {
	status = "okay";

	v1p8-supply = <&pm8941_l6>;
	v3p3-supply = <&pm8941_l24>;

	extcon = <&smbb>;
	qcom,init-seq = /bits/ 8 <0x1 0x64>;
};

repo_name: angery/linux


code:
// SPDX-License-Identifier: GPL-2.0
#include "qcom-msm8974.dtsi"

&gcc {
	compatible = "qcom,gcc-msm8974pro";
};

&gpu {
	compatible = "qcom,adreno-330.2", "qcom,adreno";
};

&sdhc_1 {
	clocks = <&gcc GCC_SDCC1_AHB_CLK>,
		 <&gcc GCC_SDCC1_APPS_CLK>,
		 <&xo_board>,
		 <&gcc GCC_SDCC1_CDCCAL_FF_CLK>,
		 <&gcc GCC_SDCC1_CDCCAL_SLEEP_CLK>;
	clock-names = "iface", "core", "xo", "cal", "sleep";
};


code:
// SPDX-License-Identifier: BSD-3-Clause
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/spmi/spmi.h>
#include <dt-bindings/iio/qcom,spmi-vadc.h>

&spmi_bus {
	pm8226_0: pm8226@0 {
		compatible = "qcom,pm8226", "qcom,spmi-pmic";
		reg = <0x0 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <0>;

		pwrkey@800 {
			compatible = "qcom,pm8941-pwrkey";
			reg = <0x800>;
			interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
			debounce = <15625>;
			bias-pull-up;
		};

		smbb: charger@1000 {
			compatible = "qcom,pm8226-charger";
			reg = <0x1000>;
			interrupts = <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
				     <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
				     <0x0 0x10 4 IRQ_TYPE_EDGE_BOTH>,
				     <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
				     <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
				     <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
				     <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
				     <0x0 0x14 1 IRQ_TYPE_EDGE_BOTH>;
			interrupt-names = "chg-done",
					  "chg-fast",
					  "chg-trkl",
					  "bat-temp-ok",
					  "bat-present",
					  "chg-gone",
					  "usb-valid",
					  "dc-valid";

			chg_otg: otg-vbus { };
		};

		rtc@6000 {
			compatible = "qcom,pm8941-rtc";
			reg = <0x6000>, <0x6100>;
			reg-names = "rtc", "alarm";
			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
		};

		pm8226_vadc: adc@3100 {
			compatible = "qcom,spmi-vadc";
			reg = <0x3100>;
			interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
			#address-cells = <1>;
			#size-cells = <0>;
			#io-channel-cells = <1>;

			adc-chan@7 {
				reg = <VADC_VSYS>;
				qcom,pre-scaling = <1 3>;
				label = "vph_pwr";
			};
			adc-chan@8 {
				reg = <VADC_DIE_TEMP>;
				label = "die_temp";
			};
			adc-chan@9 {
				reg = <VADC_REF_625MV>;
				label = "ref_625mv";
			};
			adc-chan@a {
				reg = <VADC_REF_1250MV>;
				label = "ref_1250mv";
			};
			adc-chan@e {
				reg = <VADC_GND_REF>;
			};
			adc-chan@f {
				reg = <VADC_VDD_VADC>;
			};
		};

		pm8226_mpps: mpps@a000 {
			compatible = "qcom,pm8226-mpp", "qcom,spmi-mpp";
			reg = <0xa000>;
			gpio-controller;
			#gpio-cells = <2>;
			gpio-ranges = <&pm8226_mpps 0 0 8>;
			interrupt-controller;
			#interrupt-cells = <2>;
		};

		pm8226_gpios: gpio@c000 {
			compatible = "qcom,pm8226-gpio", "qcom,spmi-gpio";
			reg = <0xc000>;
			gpio-controller;
			#gpio-cells = <2>;
			gpio-ranges = <&pm8226_gpios 0 0 8>;
			interrupt-controller;
			#interrupt-cells = <2>;
		};
	};

	pm8226_1: pm8226@1 {
		compatible = "qcom,pm8226", "qcom,spmi-pmic";
		reg = <0x1 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <0>;

		pm8226_spmi_regulators: regulators {
			compatible = "qcom,pm8226-regulators";
		};

		pm8226_vib: vibrator@c000 {
			compatible = "qcom,pm8916-vib";
			reg = <0xc000>;
			status = "disabled";
		};
	};
};


code:
// SPDX-License-Identifier: GPL-2.0
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/spmi/spmi.h>

&spmi_bus {

	pm8841_0: pm8841@4 {
		compatible = "qcom,pm8841", "qcom,spmi-pmic";
		reg = <0x4 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <0>;

		pm8841_mpps: mpps@a000 {
			compatible = "qcom,pm8841-mpp", "qcom,spmi-mpp";
			reg = <0xa000>;
			gpio-controller;
			#gpio-cells = <2>;
			gpio-ranges = <&pm8841_mpps 0 0 4>;
			interrupt-controller;
			#interrupt-cells = <2>;
		};

		temp-alarm@2400 {
			compatible = "qcom,spmi-temp-alarm";
			reg = <0x2400>;
			interrupts = <4 0x24 0 IRQ_TYPE_EDGE_RISING>;
			#thermal-sensor-cells = <0>;
		};
	};

	pm8841_1: pm8841@5 {
		compatible = "qcom,pm8841", "qcom,spmi-pmic";
		reg = <0x5 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <0>;
	};
};


code:
// SPDX-License-Identifier: GPL-2.0
#include <dt-bindings/iio/qcom,spmi-vadc.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/spmi/spmi.h>

&spmi_bus {

	pm8941_0: pm8941@0 {
		compatible = "qcom,pm8941", "qcom,spmi-pmic";
		reg = <0x0 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <0>;

		rtc@6000 {
			compatible = "qcom,pm8941-rtc";
			reg = <0x6000>,
			      <0x6100>;
			reg-names = "rtc", "alarm";
			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
		};

		pwrkey@800 {
			compatible = "qcom,pm8941-pwrkey";
			reg = <0x800>;
			interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
			debounce = <15625>;
			bias-pull-up;
		};

		usb_id: usb-detect@900 {
			compatible = "qcom,pm8941-misc";
			reg = <0x900>;
			interrupts = <0x0 0x9 0 IRQ_TYPE_EDGE_BOTH>;
			interrupt-names = "usb_id";
		};

		smbb: charger@1000 {
			compatible = "qcom,pm8941-charger";
			reg = <0x1000>;
			interrupts = <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
				     <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
				     <0x0 0x10 4 IRQ_TYPE_EDGE_BOTH>,
				     <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
				     <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
				     <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
				     <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
				     <0x0 0x14 1 IRQ_TYPE_EDGE_BOTH>;
			interrupt-names = "chg-done",
					  "chg-fast",
					  "chg-trkl",
					  "bat-temp-ok",
					  "bat-present",
					  "chg-gone",
					  "usb-valid",
					  "dc-valid";

			usb-otg-in-supply = <&pm8941_5vs1>;

			chg_otg: otg-vbus { };
		};

		pm8941_gpios: gpio@c000 {
			compatible = "qcom,pm8941-gpio", "qcom,spmi-gpio";
			reg = <0xc000>;
			gpio-controller;
			gpio-ranges = <&pm8941_gpios 0 0 36>;
			#gpio-cells = <2>;
			interrupt-controller;
			#interrupt-cells = <2>;

			boost_bypass_n_pin: boost-bypass-state {
				pins = "gpio21";
				function = "normal";
			};
		};

		pm8941_mpps: mpps@a000 {
			compatible = "qcom,pm8941-mpp", "qcom,spmi-mpp";
			reg = <0xa000>;
			gpio-controller;
			#gpio-cells = <2>;
			gpio-ranges = <&pm8941_mpps 0 0 8>;
			interrupt-controller;
			#interrupt-cells = <2>;
		};

		pm8941_temp: temp-alarm@2400 {
			compatible = "qcom,spmi-temp-alarm";
			reg = <0x2400>;
			interrupts = <0 0x24 0 IRQ_TYPE_EDGE_RISING>;
			io-channels = <&pm8941_vadc VADC_DIE_TEMP>;
			io-channel-names = "thermal";
			#thermal-sensor-cells = <0>;
		};

		pm8941_vadc: adc@3100 {
			compatible = "qcom,spmi-vadc";
			reg = <0x3100>;
			interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
			#address-cells = <1>;
			#size-cells = <0>;
			#io-channel-cells = <1>;

			adc-chan@6 {
				reg = <VADC_VBAT_SNS>;
			};

			adc-chan@8 {
				reg = <VADC_DIE_TEMP>;
			};

			adc-chan@9 {
				reg = <VADC_REF_625MV>;
			};

			adc-chan@a {
				reg = <VADC_REF_1250MV>;
			};

			adc-chan@e {
				reg = <VADC_GND_REF>;
			};

			adc-chan@f {
				reg = <VADC_VDD_VADC>;
			};

			adc-chan@30 {
				reg = <VADC_LR_MUX1_BAT_THERM>;
			};
		};

		pm8941_iadc: adc@3600 {
			compatible = "qcom,pm8941-iadc", "qcom,spmi-iadc";
			reg = <0x3600>;
			interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>;
			qcom,external-resistor-micro-ohms = <10000>;
		};

		pm8941_coincell: charger@2800 {
			compatible = "qcom,pm8941-coincell";
			reg = <0x2800>;
			status = "disabled";
		};
	};

	pm8941_1: pm8941@1 {
		compatible = "qcom,pm8941", "qcom,spmi-pmic";
		reg = <0x1 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <0>;

		pm8941_lpg: pwm {
			compatible = "qcom,pm8941-lpg";

			#address-cells = <1>;
			#size-cells = <0>;
			#pwm-cells = <2>;

			status = "disabled";
		};

		pm8941_wled: wled@d800 {
			compatible = "qcom,pm8941-wled";
			reg = <0xd800>;
			label = "backlight";

			status = "disabled";
		};

		regulators {
			compatible = "qcom,pm8941-regulators";
			interrupts = <0x1 0x83 0x2 0>, <0x1 0x84 0x2 0>;
			interrupt-names = "ocp-5vs1", "ocp-5vs2";
			vin_5vs-supply = <&pm8941_5v>;

			pm8941_5v: s4 {
				regulator-min-microvolt = <5000000>;
				regulator-max-microvolt = <5000000>;
				regulator-enable-ramp-delay = <500>;
			};

			pm8941_5vs1: 5vs1 {
				regulator-enable-ramp-delay = <1000>;
				regulator-pull-down;
				regulator-over-current-protection;
				qcom,ocp-max-retries = <10>;
				qcom,ocp-retry-delay = <30>;
				qcom,vs-soft-start-strength = <0>;
				regulator-initial-mode = <1>;
			};

			pm8941_5vs2: 5vs2 {
				regulator-enable-ramp-delay = <1000>;
				regulator-pull-down;
				regulator-over-current-protection;
				qcom,ocp-max-retries = <10>;
				qcom,ocp-retry-delay = <30>;
				qcom,vs-soft-start-strength = <0>;
				regulator-initial-mode = <1>;
			};
		};
	};
};


code:
// SPDX-License-Identifier: GPL-2.0
#include <dt-bindings/iio/qcom,spmi-vadc.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/spmi/spmi.h>

&spmi_bus {

	pma8084_0: pma8084@0 {
		compatible = "qcom,pma8084", "qcom,spmi-pmic";
		reg = <0x0 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <0>;

		rtc@6000 {
			compatible = "qcom,pm8941-rtc";
			reg = <0x6000>,
			      <0x6100>;
			reg-names = "rtc", "alarm";
			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
		};

		pwrkey@800 {
			compatible = "qcom,pm8941-pwrkey";
			reg = <0x800>;
			interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
			debounce = <15625>;
			bias-pull-up;
		};

		pma8084_gpios: gpio@c000 {
			compatible = "qcom,pma8084-gpio", "qcom,spmi-gpio";
			reg = <0xc000>;
			gpio-controller;
			gpio-ranges = <&pma8084_gpios 0 0 22>;
			#gpio-cells = <2>;
			interrupt-controller;
			#interrupt-cells = <2>;
		};

		pma8084_mpps: mpps@a000 {
			compatible = "qcom,pma8084-mpp", "qcom,spmi-mpp";
			reg = <0xa000>;
			gpio-controller;
			#gpio-cells = <2>;
			gpio-ranges = <&pma8084_mpps 0 0 8>;
			interrupt-controller;
			#interrupt-cells = <2>;
		};

		pma8084_temp: temp-alarm@2400 {
			compatible = "qcom,spmi-temp-alarm";
			reg = <0x2400>;
			interrupts = <0 0x24 0 IRQ_TYPE_EDGE_RISING>;
			#thermal-sensor-cells = <0>;
			io-channels = <&pma8084_vadc VADC_DIE_TEMP>;
			io-channel-names = "thermal";
		};

		pma8084_vadc: adc@3100 {
			compatible = "qcom,spmi-vadc";
			reg = <0x3100>;
			interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
			#address-cells = <1>;
			#size-cells = <0>;
			#io-channel-cells = <1>;

			adc-chan@8 {
				reg = <VADC_DIE_TEMP>;
			};

			adc-chan@9 {
				reg = <VADC_REF_625MV>;
			};

			adc-chan@a {
				reg = <VADC_REF_1250MV>;
			};

			adc-chan@c {
				reg = <VADC_SPARE1>;
			};

			adc-chan@e {
				reg = <VADC_GND_REF>;
			};

			adc-chan@f {
				reg = <VADC_VDD_VADC>;
			};
		};
	};

	pma8084_1: pma8084@1 {
		compatible = "qcom,pma8084", "qcom,spmi-pmic";
		reg = <0x1 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <0>;
	};
};


code:
// SPDX-License-Identifier: BSD-3-Clause

/*
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2020, Linaro Limited
 */

#include <dt-bindings/iio/qcom,spmi-vadc.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/spmi/spmi.h>

&spmi_bus {
	pmic@8 {
		compatible = "qcom,pmx55", "qcom,spmi-pmic";
		reg = <0x8 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <0>;

		pon@800 {
			compatible = "qcom,pm8916-pon";
			reg = <0x0800>;

			status = "disabled";
		};

		pmx55_temp: temp-alarm@2400 {
			compatible = "qcom,spmi-temp-alarm";
			reg = <0x2400>;
			interrupts = <0x8 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
			io-channels = <&pmx55_adc ADC5_DIE_TEMP>;
			io-channel-names = "thermal";
			#thermal-sensor-cells = <0>;
		};

		pmx55_adc: adc@3100 {
			compatible = "qcom,spmi-adc5";
			reg = <0x3100>;
			#address-cells = <1>;
			#size-cells = <0>;
			#io-channel-cells = <1>;
			interrupts = <0x8 0x31 0x0 IRQ_TYPE_EDGE_RISING>;

			ref-gnd@0 {
				reg = <ADC5_REF_GND>;
				qcom,pre-scaling = <1 1>;
				label = "ref_gnd";
			};

			vref-1p25@1 {
				reg = <ADC5_1P25VREF>;
				qcom,pre-scaling = <1 1>;
				label = "vref_1p25";
			};

			die-temp@6 {
				reg = <ADC5_DIE_TEMP>;
				qcom,pre-scaling = <1 1>;
				label = "die_temp";
			};

			chg-temp@9 {
				reg = <ADC5_CHG_TEMP>;
				qcom,pre-scaling = <1 1>;
				label = "chg_temp";
			};
		};

		pmx55_gpios: gpio@c000 {
			compatible = "qcom,pmx55-gpio", "qcom,spmi-gpio";
			reg = <0xc000>;
			gpio-controller;
			gpio-ranges = <&pmx55_gpios 0 0 11>;
			#gpio-cells = <2>;
			interrupt-controller;
			#interrupt-cells = <2>;
		};
	};

	pmic@9 {
		compatible = "qcom,pmx55", "qcom,spmi-pmic";
		reg = <0x9 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <0>;
	};
};


code:
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/spmi/spmi.h>

&spmi_bus {
	pmic@1 {
		compatible = "qcom,pmx65", "qcom,spmi-pmic";
		reg = <1 SPMI_USID>;
		#address-cells = <1>;
		#size-cells = <0>;

		pmx65_temp: temp-alarm@a00 {
			compatible = "qcom,spmi-temp-alarm";
			reg = <0xa00>;
			interrupts = <0x1 0xa 0x0 IRQ_TYPE_EDGE_BOTH>;
			#thermal-sensor-cells = <0>;
		};

		pmx65_gpios: gpio@8800 {
			compatible = "qcom,pmx65-gpio", "qcom,spmi-gpio";
			reg = <0x8800>;
			gpio-controller;
			gpio-ranges = <&pmx65_gpios 0 0 16>;
			#gpio-cells = <2>;
			interrupt-controller;
			#interrupt-cells = <2>;
		};
	};
};


code:
// SPDX-License-Identifier: BSD-3-Clause
/*
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2020, Linaro Ltd.
 */

/dts-v1/;

#include "qcom-sdx55.dtsi"
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
#include <arm64/qcom/pm8150b.dtsi>
#include "qcom-pmx55.dtsi"

/ {
	model = "Qualcomm Technologies, Inc. SDX55 MTP";
	compatible = "qcom,sdx55-mtp", "qcom,sdx55";
	qcom,board-id = <0x5010008 0x0>;

	aliases {
		serial0 = &blsp1_uart3;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		mpss_debug_mem: memory@8ef00000 {
			no-map;
			reg = <0x8ef00000 0x800000>;
		};

		ipa_fw_mem: memory@8fced000 {
			no-map;
			reg = <0x8fced000 0x10000>;
		};

		mpss_adsp_mem: memory@90c00000 {
			no-map;
			reg = <0x90c00000 0xd400000>;
		};
	};

	vph_pwr: vph-pwr-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vph_pwr";
		regulator-min-microvolt = <3700000>;
		regulator-max-microvolt = <3700000>;
	};

	vreg_bob_3p3: pmx55-bob {
		compatible = "regulator-fixed";
		regulator-name = "vreg_bob_3p3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		regulator-always-on;
		regulator-boot-on;

		vin-supply = <&vph_pwr>;
	};

	vreg_s7e_mx_0p752: pmx55-s7e {
		compatible = "regulator-fixed";
		regulator-name = "vreg_s7e_mx_0p752";
		regulator-min-microvolt = <752000>;
		regulator-max-microvolt = <752000>;

		vin-supply = <&vph_pwr>;
	};
};

&apps_rsc {
	pmx55-rpmh-regulators {
		compatible = "qcom,pmx55-rpmh-regulators";
		qcom,pmic-id = "e";

		vdd-s1-supply = <&vph_pwr>;
		vdd-s2-supply = <&vph_pwr>;
		vdd-s3-supply = <&vph_pwr>;
		vdd-s4-supply = <&vph_pwr>;
		vdd-s5-supply = <&vph_pwr>;
		vdd-s6-supply = <&vph_pwr>;
		vdd-s7-supply = <&vph_pwr>;
		vdd-l1-l2-supply = <&vreg_s2e_1p224>;
		vdd-l3-l9-supply = <&vreg_s3e_0p824>;
		vdd-l4-l12-supply = <&vreg_s4e_1p904>;
		vdd-l5-l6-supply = <&vreg_s4e_1p904>;
		vdd-l7-l8-supply = <&vreg_s3e_0p824>;
		vdd-l10-l11-l13-supply = <&vreg_bob_3p3>;
		vdd-l14-supply = <&vreg_s7e_mx_0p752>;
		vdd-l15-supply = <&vreg_s2e_1p224>;
		vdd-l16-supply = <&vreg_s4e_1p904>;

		vreg_s2e_1p224: smps2 {
			regulator-min-microvolt = <1280000>;
			regulator-max-microvolt = <1400000>;
		};

		vreg_s3e_0p824: smps3 {
			regulator-min-microvolt = <800000>;
			regulator-max-microvolt = <1000000>;
		};

		vreg_s4e_1p904: smps4 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1960000>;
		};

		vreg_l1e_bb_1p2: ldo1 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo2 {
			regulator-min-microvolt = <1128000>;
			regulator-max-microvolt = <1128000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo3 {
			regulator-min-microvolt = <800000>;
			regulator-max-microvolt = <800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		vreg_l4e_bb_0p875: ldo4 {
			regulator-min-microvolt = <872000>;
			regulator-max-microvolt = <872000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		vreg_l5e_bb_1p7: ldo5 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <1900000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo6 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo7 {
			regulator-min-microvolt = <480000>;
			regulator-max-microvolt = <900000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo8 {
			regulator-min-microvolt = <480000>;
			regulator-max-microvolt = <900000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo9 {
			regulator-min-microvolt = <800000>;
			regulator-max-microvolt = <800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		vreg_l10e_3p1: ldo10 {
			regulator-min-microvolt = <3088000>;
			regulator-max-microvolt = <3088000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo11 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <2928000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo12 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo13 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <2928000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo14 {
			regulator-min-microvolt = <600000>;
			regulator-max-microvolt = <800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo15 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo16 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <1904000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};
	};
};

&blsp1_uart3 {
	status = "okay";
};

&qpic_bam {
	status = "okay";
};

&qpic_nand {
	status = "okay";

	nand@0 {
		reg = <0>;

		nand-ecc-strength = <8>;
		nand-ecc-step-size = <512>;
		nand-bus-width = <8>;
	};
};

&usb {
	status = "okay";
};

&usb_dwc3 {
	dr_mode = "peripheral";
};

&usb_hsphy {
	status = "okay";
	vdda-pll-supply = <&vreg_l4e_bb_0p875>;
	vdda33-supply = <&vreg_l10e_3p1>;
	vdda18-supply = <&vreg_l5e_bb_1p7>;
};

&usb_qmpphy {
	status = "okay";
	vdda-phy-supply = <&vreg_l4e_bb_0p875>;
	vdda-pll-supply = <&vreg_l1e_bb_1p2>;
};


code:
// SPDX-License-Identifier: BSD-3-Clause
/*
 * Copyright (c) 2021, Linaro Ltd.
 */

/dts-v1/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
#include "qcom-sdx55.dtsi"
#include "qcom-pmx55.dtsi"

/ {
	model = "Thundercomm T55 Development Kit";
	compatible = "qcom,sdx55-t55", "qcom,sdx55";
	qcom,board-id = <0xb010008 0x4>;

	aliases {
		serial0 = &blsp1_uart3;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		mpss_debug_mem: memory@8ef00000 {
			no-map;
			reg = <0x8ef00000 0x800000>;
		};

		ipa_fw_mem: memory@8fced000 {
			no-map;
			reg = <0x8fced000 0x10000>;
		};

		mpss_adsp_mem: memory@90800000 {
			no-map;
			reg = <0x90800000 0xf800000>;
		};
	};

	vph_pwr: vph-pwr-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vph_pwr";
		regulator-min-microvolt = <3700000>;
		regulator-max-microvolt = <3700000>;
	};

	vreg_bob_3p3: pmx55-bob {
		compatible = "regulator-fixed";
		regulator-name = "vreg_bob_3p3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		regulator-always-on;
		regulator-boot-on;

		vin-supply = <&vph_pwr>;
	};

	vreg_s7e_mx_0p752: pmx55-s7e {
		compatible = "regulator-fixed";
		regulator-name = "vreg_s7e_mx_0p752";
		regulator-min-microvolt = <752000>;
		regulator-max-microvolt = <752000>;

		vin-supply = <&vph_pwr>;
	};

	vreg_sd_vdd: sd-vdd {
		compatible = "regulator-fixed";
		regulator-name = "vreg_sd_vdd";
		regulator-min-microvolt = <2950000>;
		regulator-max-microvolt = <2950000>;

		vin-supply = <&vreg_vddpx_2>;
	};

	vreg_vddpx_2: vddpx-2 {
		compatible = "regulator-gpio";
		regulator-name = "vreg_vddpx_2";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2850000>;
		enable-gpios = <&tlmm 98 GPIO_ACTIVE_HIGH>;
		gpios = <&tlmm 100 GPIO_ACTIVE_HIGH>;
		states = <1800000 0>, <2850000 1>;
		startup-delay-us = <200000>;
		enable-active-high;
		regulator-boot-on;

		vin-supply = <&vph_pwr>;
	};
};

&apps_rsc {
	pmx55-rpmh-regulators {
		compatible = "qcom,pmx55-rpmh-regulators";
		qcom,pmic-id = "e";

		vdd-s1-supply = <&vph_pwr>;
		vdd-s2-supply = <&vph_pwr>;
		vdd-s3-supply = <&vph_pwr>;
		vdd-s4-supply = <&vph_pwr>;
		vdd-s5-supply = <&vph_pwr>;
		vdd-s6-supply = <&vph_pwr>;
		vdd-s7-supply = <&vph_pwr>;
		vdd-l1-l2-supply = <&vreg_s2e_1p224>;
		vdd-l3-l9-supply = <&vreg_s3e_0p824>;
		vdd-l4-l12-supply = <&vreg_s4e_1p904>;
		vdd-l5-l6-supply = <&vreg_s4e_1p904>;
		vdd-l7-l8-supply = <&vreg_s3e_0p824>;
		vdd-l10-l11-l13-supply = <&vreg_bob_3p3>;
		vdd-l14-supply = <&vreg_s7e_mx_0p752>;
		vdd-l15-supply = <&vreg_s2e_1p224>;
		vdd-l16-supply = <&vreg_s4e_1p904>;

		vreg_s2e_1p224: smps2 {
			regulator-min-microvolt = <1280000>;
			regulator-max-microvolt = <1400000>;
		};

		vreg_s3e_0p824: smps3 {
			regulator-min-microvolt = <800000>;
			regulator-max-microvolt = <1000000>;
		};

		vreg_s4e_1p904: smps4 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1960000>;
		};

		vreg_l1e_bb_1p2: ldo1 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo2 {
			regulator-min-microvolt = <1128000>;
			regulator-max-microvolt = <1128000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo3 {
			regulator-min-microvolt = <800000>;
			regulator-max-microvolt = <800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		vreg_l4e_bb_0p875: ldo4 {
			regulator-min-microvolt = <872000>;
			regulator-max-microvolt = <872000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		vreg_l5e_bb_1p7: ldo5 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <1900000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo6 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo7 {
			regulator-min-microvolt = <480000>;
			regulator-max-microvolt = <900000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo8 {
			regulator-min-microvolt = <480000>;
			regulator-max-microvolt = <900000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo9 {
			regulator-min-microvolt = <800000>;
			regulator-max-microvolt = <800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		vreg_l10e_3p1: ldo10 {
			regulator-min-microvolt = <3088000>;
			regulator-max-microvolt = <3088000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo11 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <2928000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo12 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo13 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <2928000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo14 {
			regulator-min-microvolt = <600000>;
			regulator-max-microvolt = <800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo15 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo16 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <1904000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};
	};
};

&blsp1_uart3 {
	status = "ok";
};

&ipa {
	status = "okay";

	memory-region = <&ipa_fw_mem>;
};

&qpic_bam {
	status = "ok";
};

&qpic_nand {
	status = "ok";

	nand@0 {
		reg = <0>;

		nand-ecc-strength = <8>;
		nand-ecc-step-size = <512>;
		nand-bus-width = <8>;
		/* efs2 partition is secured */
		secure-regions = /bits/ 64 <0x500000 0xb00000>;
	};
};

&remoteproc_mpss {
	status = "okay";
	memory-region = <&mpss_adsp_mem>;
};

&usb_hsphy {
	status = "okay";
	vdda-pll-supply = <&vreg_l4e_bb_0p875>;
	vdda33-supply = <&vreg_l10e_3p1>;
	vdda18-supply = <&vreg_l5e_bb_1p7>;
};

&usb_qmpphy {
	status = "okay";
	vdda-phy-supply = <&vreg_l4e_bb_0p875>;
	vdda-pll-supply = <&vreg_l1e_bb_1p2>;
};

&usb {
	status = "okay";
};

&usb_dwc3 {
	dr_mode = "peripheral";
};


code:
// SPDX-License-Identifier: BSD-3-Clause
/*
 * Copyright (c) 2021, Linaro Ltd.
 */

/dts-v1/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
#include "qcom-sdx55.dtsi"
#include "qcom-pmx55.dtsi"

/ {
	model = "Telit FN980 TLB";
	compatible = "qcom,sdx55-telit-fn980-tlb", "qcom,sdx55";
	qcom,board-id = <0xb010008 0x0>;

	aliases {
		serial0 = &blsp1_uart3;
	};

	chosen {
		stdout-path = "serial0:921600n8";
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		mpss_debug_mem: memory@8ef00000 {
			no-map;
			reg = <0x8ef00000 0x800000>;
		};

		ipa_fw_mem: memory@8fced000 {
			no-map;
			reg = <0x8fced000 0x10000>;
		};

		mpss_adsp_mem: memory@90800000 {
			no-map;
			reg = <0x90800000 0xf800000>;
		};
	};

	vph_pwr: vph-pwr-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vph_pwr";
		regulator-min-microvolt = <3700000>;
		regulator-max-microvolt = <3700000>;
	};

	vreg_bob_3p3: pmx55-bob {
		compatible = "regulator-fixed";
		regulator-name = "vreg_bob_3p3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		regulator-always-on;
		regulator-boot-on;

		vin-supply = <&vph_pwr>;
	};

	vreg_s7e_mx_0p752: pmx55-s7e {
		compatible = "regulator-fixed";
		regulator-name = "vreg_s7e_mx_0p752";
		regulator-min-microvolt = <752000>;
		regulator-max-microvolt = <752000>;

		vin-supply = <&vph_pwr>;
	};

	vreg_sd_vdd: sd-vdd {
		compatible = "regulator-fixed";
		regulator-name = "vreg_sd_vdd";
		regulator-min-microvolt = <2950000>;
		regulator-max-microvolt = <2950000>;

		vin-supply = <&vreg_vddpx_2>;
	};

	vreg_vddpx_2: vddpx-2 {
		compatible = "regulator-gpio";
		regulator-name = "vreg_vddpx_2";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2850000>;
		enable-gpios = <&tlmm 98 GPIO_ACTIVE_HIGH>;
		gpios = <&tlmm 100 GPIO_ACTIVE_HIGH>;
		states = <1800000 0>, <2850000 1>;
		startup-delay-us = <200000>;
		enable-active-high;
		regulator-boot-on;

		vin-supply = <&vph_pwr>;
	};
};

&apps_rsc {
	pmx55-rpmh-regulators {
		compatible = "qcom,pmx55-rpmh-regulators";
		qcom,pmic-id = "e";

		vdd-s1-supply = <&vph_pwr>;
		vdd-s2-supply = <&vph_pwr>;
		vdd-s3-supply = <&vph_pwr>;
		vdd-s4-supply = <&vph_pwr>;
		vdd-s5-supply = <&vph_pwr>;
		vdd-s6-supply = <&vph_pwr>;
		vdd-s7-supply = <&vph_pwr>;
		vdd-l1-l2-supply = <&vreg_s2e_1p224>;
		vdd-l3-l9-supply = <&vreg_s3e_0p824>;
		vdd-l4-l12-supply = <&vreg_s4e_1p904>;
		vdd-l5-l6-supply = <&vreg_s4e_1p904>;
		vdd-l7-l8-supply = <&vreg_s3e_0p824>;
		vdd-l10-l11-l13-supply = <&vreg_bob_3p3>;
		vdd-l14-supply = <&vreg_s7e_mx_0p752>;
		vdd-l15-supply = <&vreg_s2e_1p224>;
		vdd-l16-supply = <&vreg_s4e_1p904>;

		vreg_s2e_1p224: smps2 {
			regulator-min-microvolt = <1280000>;
			regulator-max-microvolt = <1400000>;
		};

		vreg_s3e_0p824: smps3 {
			regulator-min-microvolt = <800000>;
			regulator-max-microvolt = <1000000>;
		};

		vreg_s4e_1p904: smps4 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1960000>;
		};

		vreg_l1e_bb_1p2: ldo1 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo2 {
			regulator-min-microvolt = <1128000>;
			regulator-max-microvolt = <1128000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo3 {
			regulator-min-microvolt = <800000>;
			regulator-max-microvolt = <800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		vreg_l4e_bb_0p875: ldo4 {
			regulator-min-microvolt = <872000>;
			regulator-max-microvolt = <872000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		vreg_l5e_bb_1p7: ldo5 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <1900000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo6 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo7 {
			regulator-min-microvolt = <480000>;
			regulator-max-microvolt = <900000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo8 {
			regulator-min-microvolt = <480000>;
			regulator-max-microvolt = <900000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo9 {
			regulator-min-microvolt = <800000>;
			regulator-max-microvolt = <800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		vreg_l10e_3p1: ldo10 {
			regulator-min-microvolt = <3088000>;
			regulator-max-microvolt = <3088000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo11 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <2928000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo12 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo13 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <2928000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo14 {
			regulator-min-microvolt = <600000>;
			regulator-max-microvolt = <800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo15 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};

		ldo16 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <1904000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_LPM>;
		};
	};
};

&blsp1_uart3 {
	status = "ok";
};

&ipa {
	status = "okay";

	memory-region = <&ipa_fw_mem>;
};

&pcie0_phy {
	status = "okay";

	vdda-phy-supply = <&vreg_l1e_bb_1p2>;
	vdda-pll-supply = <&vreg_l4e_bb_0p875>;
};

&pcie_ep {
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&pcie_ep_clkreq_default &pcie_ep_perst_default
		     &pcie_ep_wake_default>;
};

&qpic_bam {
	status = "ok";
};

&qpic_nand {
	status = "ok";

	nand@0 {
		reg = <0>;

		nand-ecc-strength = <8>;
		nand-ecc-step-size = <512>;
		nand-bus-width = <8>;
		/* ico and efs2 partitions are secured */
		secure-regions = /bits/ 64 <0x500000 0x500000
					    0xa00000 0xb00000>;
	};
};

&remoteproc_mpss {
	status = "okay";
	memory-region = <&mpss_adsp_mem>;
};

&tlmm {
	pcie_ep_clkreq_default: pcie-ep-clkreq-default-state {
		pins = "gpio56";
		function = "pcie_clkreq";
		drive-strength = <2>;
		bias-disable;
	};

	pcie_ep_perst_default: pcie-ep-perst-default-state {
		pins = "gpio57";
		function = "gpio";
		drive-strength = <2>;
		bias-pull-down;
	};

	pcie_ep_wake_default: pcie-ep-wake-default-state {
		pins = "gpio53";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
	};
};

&usb_hsphy {
	status = "okay";
	vdda-pll-supply = <&vreg_l4e_bb_0p875>;
	vdda33-supply = <&vreg_l10e_3p1>;
	vdda18-supply = <&vreg_l5e_bb_1p7>;
};

&usb_qmpphy {
	status = "okay";
	vdda-phy-supply = <&vreg_l4e_bb_0p875>;
	vdda-pll-supply = <&vreg_l1e_bb_1p2>;
};

&usb {
	status = "okay";
};

&usb_dwc3 {
	dr_mode = "peripheral";
};


code:
// SPDX-License-Identifier: BSD-3-Clause
/*
 * SDX55 SoC device tree source
 *
 * Copyright (c) 2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2020, Linaro Ltd.
 */

#include <dt-bindings/clock/qcom,gcc-sdx55.h>
#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interconnect/qcom,sdx55.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/power/qcom-rpmpd.h>
#include <dt-bindings/soc/qcom,rpmh-rsc.h>

/ {
	#address-cells = <1>;
	#size-cells = <1>;
	qcom,msm-id = <357 0x10000>, <368 0x10000>, <418 0x10000>;
	interrupt-parent = <&intc>;

	memory {
		device_type = "memory";
		reg = <0 0>;
	};

	clocks {
		xo_board: xo-board {
			compatible = "fixed-clock";
			#clock-cells = <0>;
			clock-frequency = <38400000>;
			clock-output-names = "xo_board";
		};

		sleep_clk: sleep-clk {
			compatible = "fixed-clock";
			#clock-cells = <0>;
			clock-frequency = <32000>;
		};

		nand_clk_dummy: nand-clk-dummy {
			compatible = "fixed-clock";
			#clock-cells = <0>;
			clock-frequency = <32000>;
		};
	};

	cpus {
		#address-cells = <1>;
		#size-cells = <0>;

		cpu0: cpu@0 {
			device_type = "cpu";
			compatible = "arm,cortex-a7";
			reg = <0x0>;
			enable-method = "psci";
			clocks = <&apcs>;
			power-domains = <&rpmhpd SDX55_CX>;
			power-domain-names = "rpmhpd";
			operating-points-v2 = <&cpu_opp_table>;
		};
	};

	cpu_opp_table: cpu-opp-table {
		compatible = "operating-points-v2";
		opp-shared;

		opp-345600000 {
			opp-hz = /bits/ 64 <345600000>;
			required-opps = <&rpmhpd_opp_low_svs>;
		};

		opp-576000000 {
			opp-hz = /bits/ 64 <576000000>;
			required-opps = <&rpmhpd_opp_svs>;
		};

		opp-1094400000 {
			opp-hz = /bits/ 64 <1094400000>;
			required-opps = <&rpmhpd_opp_nom>;
		};

		opp-1555200000 {
			opp-hz = /bits/ 64 <1555200000>;
			required-opps = <&rpmhpd_opp_turbo>;
		};
	};

	firmware {
		scm {
			compatible = "qcom,scm-sdx55", "qcom,scm";
		};
	};

	psci {
		compatible = "arm,psci-1.0";
		method = "smc";
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		hyp_mem: memory@8fc00000 {
			no-map;
			reg = <0x8fc00000 0x80000>;
		};

		ac_db_mem: memory@8fc80000 {
			no-map;
			reg = <0x8fc80000 0x40000>;
		};

		secdata_mem: memory@8fcfd000 {
			no-map;
			reg = <0x8fcfd000 0x1000>;
		};

		sbl_mem: memory@8fd00000 {
			no-map;
			reg = <0x8fd00000 0x100000>;
		};

		aop_image: memory@8fe00000 {
			no-map;
			reg = <0x8fe00000 0x20000>;
		};

		aop_cmd_db: memory@8fe20000 {
			compatible = "qcom,cmd-db";
			reg = <0x8fe20000 0x20000>;
			no-map;
		};

		smem_mem: memory@8fe40000 {
			no-map;
			reg = <0x8fe40000 0xc0000>;
		};

		tz_mem: memory@8ff00000 {
			no-map;
			reg = <0x8ff00000 0x100000>;
		};

		tz_apps_mem: memory@90000000 {
			no-map;
			reg = <0x90000000 0x500000>;
		};
	};

	smem {
		compatible = "qcom,smem";
		memory-region = <&smem_mem>;
		hwlocks = <&tcsr_mutex 3>;
	};

	smp2p-mpss {
		compatible = "qcom,smp2p";
		qcom,smem = <435>, <428>;
		interrupts = <GIC_SPI 113 IRQ_TYPE_EDGE_RISING>;
		mboxes = <&apcs 14>;
		qcom,local-pid = <0>;
		qcom,remote-pid = <1>;

		modem_smp2p_out: master-kernel {
			qcom,entry-name = "master-kernel";
			#qcom,smem-state-cells = <1>;
		};

		modem_smp2p_in: slave-kernel {
			qcom,entry-name = "slave-kernel";
			interrupt-controller;
			#interrupt-cells = <2>;
		};

		ipa_smp2p_out: ipa-ap-to-modem {
			qcom,entry-name = "ipa";
			#qcom,smem-state-cells = <1>;
		};

		ipa_smp2p_in: ipa-modem-to-ap {
			qcom,entry-name = "ipa";
			interrupt-controller;
			#interrupt-cells = <2>;
		};
	};

	soc: soc {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;
		compatible = "simple-bus";

		gcc: clock-controller@100000 {
			compatible = "qcom,gcc-sdx55";
			reg = <0x100000 0x1f0000>;
			#clock-cells = <1>;
			#reset-cells = <1>;
			#power-domain-cells = <1>;
			clock-names = "bi_tcxo", "sleep_clk";
			clocks = <&rpmhcc RPMH_CXO_CLK>, <&sleep_clk>;
		};

		blsp1_uart3: serial@831000 {
			compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
			reg = <0x00831000 0x200>;
			interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc 30>,
				 <&gcc 9>;
			clock-names = "core", "iface";
			status = "disabled";
		};

		usb_hsphy: phy@ff4000 {
			compatible = "qcom,usb-snps-hs-7nm-phy";
			reg = <0x00ff4000 0x114>;
			status = "disabled";
			#phy-cells = <0>;

			clocks = <&rpmhcc RPMH_CXO_CLK>;
			clock-names = "ref";

			resets = <&gcc GCC_QUSB2PHY_BCR>;
		};

		usb_qmpphy: phy@ff6000 {
			compatible = "qcom,sdx55-qmp-usb3-uni-phy";
			reg = <0x00ff6000 0x1c0>;
			status = "disabled";
			#address-cells = <1>;
			#size-cells = <1>;
			ranges;

			clocks = <&gcc GCC_USB3_PHY_AUX_CLK>,
				 <&gcc GCC_USB_PHY_CFG_AHB2PHY_CLK>,
				 <&gcc GCC_USB3_PRIM_CLKREF_CLK>;
			clock-names = "aux", "cfg_ahb", "ref";

			resets = <&gcc GCC_USB3PHY_PHY_BCR>,
				 <&gcc GCC_USB3_PHY_BCR>;
			reset-names = "phy", "common";

			usb_ssphy: phy@ff6200 {
				reg = <0x00ff6200 0x170>,
				      <0x00ff6400 0x200>,
				      <0x00ff6800 0x800>;
				#phy-cells = <0>;
				#clock-cells = <0>;
				clocks = <&gcc GCC_USB3_PHY_PIPE_CLK>;
				clock-names = "pipe0";
				clock-output-names = "usb3_uni_phy_pipe_clk_src";
			};
		};

		mc_virt: interconnect@1100000 {
			compatible = "qcom,sdx55-mc-virt";
			reg = <0x01100000 0x400000>;
			#interconnect-cells = <1>;
			qcom,bcm-voters = <&apps_bcm_voter>;
		};

		mem_noc: interconnect@9680000 {
			compatible = "qcom,sdx55-mem-noc";
			reg = <0x09680000 0x40000>;
			#interconnect-cells = <1>;
			qcom,bcm-voters = <&apps_bcm_voter>;
		};

		system_noc: interconnect@162c000 {
			compatible = "qcom,sdx55-system-noc";
			reg = <0x0162c000 0x31200>;
			#interconnect-cells = <1>;
			qcom,bcm-voters = <&apps_bcm_voter>;
		};

		qpic_bam: dma-controller@1b04000 {
			compatible = "qcom,bam-v1.7.0";
			reg = <0x01b04000 0x1c000>;
			interrupts = <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&rpmhcc RPMH_QPIC_CLK>;
			clock-names = "bam_clk";
			#dma-cells = <1>;
			qcom,ee = <0>;
			qcom,controlled-remotely;
			status = "disabled";
		};

		qpic_nand: nand-controller@1b30000 {
			compatible = "qcom,sdx55-nand";
			reg = <0x01b30000 0x10000>;
			#address-cells = <1>;
			#size-cells = <0>;
			clocks = <&rpmhcc RPMH_QPIC_CLK>,
				 <&nand_clk_dummy>;
			clock-names = "core", "aon";

			dmas = <&qpic_bam 0>,
			       <&qpic_bam 1>,
			       <&qpic_bam 2>;
			dma-names = "tx", "rx", "cmd";
			status = "disabled";
		};

		pcie0_phy: phy@1c07000 {
			compatible = "qcom,sdx55-qmp-pcie-phy";
			reg = <0x01c07000 0x1c4>;
			#address-cells = <1>;
			#size-cells = <1>;
			ranges;
			clocks = <&gcc GCC_PCIE_AUX_PHY_CLK_SRC>,
				 <&gcc GCC_PCIE_CFG_AHB_CLK>,
				 <&gcc GCC_PCIE_0_CLKREF_CLK>,
				 <&gcc GCC_PCIE_RCHNG_PHY_CLK>;
			clock-names = "aux", "cfg_ahb", "ref", "refgen";

			resets = <&gcc GCC_PCIE_PHY_BCR>;
			reset-names = "phy";

			assigned-clocks = <&gcc GCC_PCIE_RCHNG_PHY_CLK>;
			assigned-clock-rates = <100000000>;

			status = "disabled";

			pcie0_lane: lanes@1c06000 {
				reg = <0x01c06000 0x104>, /* tx0 */
				      <0x01c06200 0x328>, /* rx0 */
				      <0x01c07200 0x1e8>, /* pcs */
				      <0x01c06800 0x104>, /* tx1 */
				      <0x01c06a00 0x328>, /* rx1 */
				      <0x01c07600 0x800>; /* pcs_misc */
				clocks = <&gcc GCC_PCIE_PIPE_CLK>;
				clock-names = "pipe0";

				#phy-cells = <0>;
				clock-output-names = "pcie_pipe_clk";
			};
		};

		ipa: ipa@1e40000 {
			compatible = "qcom,sdx55-ipa";

			iommus = <&apps_smmu 0x5e0 0x0>,
				 <&apps_smmu 0x5e2 0x0>;
			reg = <0x1e40000 0x7000>,
			      <0x1e50000 0x4b20>,
			      <0x1e04000 0x2c000>;
			reg-names = "ipa-reg",
				    "ipa-shared",
				    "gsi";

			interrupts-extended = <&intc GIC_SPI 241 IRQ_TYPE_EDGE_RISING>,
					      <&intc GIC_SPI 47 IRQ_TYPE_LEVEL_HIGH>,
					      <&ipa_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
					      <&ipa_smp2p_in 1 IRQ_TYPE_EDGE_RISING>;
			interrupt-names = "ipa",
					  "gsi",
					  "ipa-clock-query",
					  "ipa-setup-ready";

			clocks = <&rpmhcc RPMH_IPA_CLK>;
			clock-names = "core";

			interconnects = <&system_noc MASTER_IPA &mc_virt SLAVE_EBI_CH0>,
					<&system_noc MASTER_IPA &system_noc SLAVE_OCIMEM>,
					<&mem_noc MASTER_AMPSS_M0 &system_noc SLAVE_IPA_CFG>;
			interconnect-names = "memory",
					     "imem",
					     "config";

			qcom,smem-states = <&ipa_smp2p_out 0>,
					   <&ipa_smp2p_out 1>;
			qcom,smem-state-names = "ipa-clock-enabled-valid",
						"ipa-clock-enabled";

			status = "disabled";
		};

		tcsr_mutex: hwlock@1f40000 {
			compatible = "qcom,tcsr-mutex";
			reg = <0x01f40000 0x40000>;
			#hwlock-cells = <1>;
		};

		tcsr: syscon@1fcb000 {
			compatible = "syscon";
			reg = <0x01fc0000 0x1000>;
		};

		sdhc_1: mmc@8804000 {
			compatible = "qcom,sdx55-sdhci", "qcom,sdhci-msm-v5";
			reg = <0x08804000 0x1000>;
			interrupts = <GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 227 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "hc_irq", "pwr_irq";
			clocks = <&gcc GCC_SDCC1_AHB_CLK>,
				 <&gcc GCC_SDCC1_APPS_CLK>;
			clock-names = "iface", "core";
			status = "disabled";
		};

		pcie_ep: pcie-ep@40000000 {
			compatible = "qcom,sdx55-pcie-ep";
			reg = <0x01c00000 0x3000>,
			      <0x40000000 0xf1d>,
			      <0x40000f20 0xc8>,
			      <0x40001000 0x1000>,
			      <0x40200000 0x100000>,
			      <0x01c03000 0x3000>;
			reg-names = "parf", "dbi", "elbi", "atu", "addr_space",
				    "mmio";

			qcom,perst-regs = <&tcsr 0xb258 0xb270>;

			clocks = <&gcc GCC_PCIE_AUX_CLK>,
				 <&gcc GCC_PCIE_CFG_AHB_CLK>,
				 <&gcc GCC_PCIE_MSTR_AXI_CLK>,
				 <&gcc GCC_PCIE_SLV_AXI_CLK>,
				 <&gcc GCC_PCIE_SLV_Q2A_AXI_CLK>,
				 <&gcc GCC_PCIE_SLEEP_CLK>,
				 <&gcc GCC_PCIE_0_CLKREF_CLK>;
			clock-names = "aux", "cfg", "bus_master", "bus_slave",
				      "slave_q2a", "sleep", "ref";

			interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "global", "doorbell";
			reset-gpios = <&tlmm 57 GPIO_ACTIVE_LOW>;
			wake-gpios = <&tlmm 53 GPIO_ACTIVE_LOW>;
			resets = <&gcc GCC_PCIE_BCR>;
			reset-names = "core";
			power-domains = <&gcc PCIE_GDSC>;
			phys = <&pcie0_lane>;
			phy-names = "pciephy";
			max-link-speed = <3>;
			num-lanes = <2>;

			status = "disabled";
		};

		remoteproc_mpss: remoteproc@4080000 {
			compatible = "qcom,sdx55-mpss-pas";
			reg = <0x04080000 0x4040>;

			interrupts-extended = <&intc GIC_SPI 250 IRQ_TYPE_EDGE_RISING>,
					      <&modem_smp2p_in 0 IRQ_TYPE_EDGE_RISING>,
					      <&modem_smp2p_in 1 IRQ_TYPE_EDGE_RISING>,
					      <&modem_smp2p_in 2 IRQ_TYPE_EDGE_RISING>,
					      <&modem_smp2p_in 3 IRQ_TYPE_EDGE_RISING>,
					      <&modem_smp2p_in 7 IRQ_TYPE_EDGE_RISING>;
			interrupt-names = "wdog", "fatal", "ready", "handover",
					  "stop-ack", "shutdown-ack";

			clocks = <&rpmhcc RPMH_CXO_CLK>;
			clock-names = "xo";

			power-domains = <&rpmhpd SDX55_CX>,
					<&rpmhpd SDX55_MSS>;
			power-domain-names = "cx", "mss";

			qcom,smem-states = <&modem_smp2p_out 0>;
			qcom,smem-state-names = "stop";

			status = "disabled";

			glink-edge {
				interrupts = <GIC_SPI 114 IRQ_TYPE_EDGE_RISING>;
				label = "mpss";
				qcom,remote-pid = <1>;
				mboxes = <&apcs 15>;
			};
		};

		usb: usb@a6f8800 {
			compatible = "qcom,sdx55-dwc3", "qcom,dwc3";
			reg = <0x0a6f8800 0x400>;
			status = "disabled";
			#address-cells = <1>;
			#size-cells = <1>;
			ranges;

			clocks = <&gcc GCC_USB30_SLV_AHB_CLK>,
				 <&gcc GCC_USB30_MASTER_CLK>,
				 <&gcc GCC_USB30_MSTR_AXI_CLK>,
				 <&gcc GCC_USB30_SLEEP_CLK>,
				 <&gcc GCC_USB30_MOCK_UTMI_CLK>;
			clock-names = "cfg_noc",
				      "core",
				      "iface",
				      "sleep",
				      "mock_utmi";

			assigned-clocks = <&gcc GCC_USB30_MOCK_UTMI_CLK>,
					  <&gcc GCC_USB30_MASTER_CLK>;
			assigned-clock-rates = <19200000>, <200000000>;

			interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "hs_phy_irq", "ss_phy_irq",
					  "dm_hs_phy_irq", "dp_hs_phy_irq";

			power-domains = <&gcc USB30_GDSC>;

			resets = <&gcc GCC_USB30_BCR>;

			usb_dwc3: dwc3@a600000 {
				compatible = "snps,dwc3";
				reg = <0x0a600000 0xcd00>;
				interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
				iommus = <&apps_smmu 0x1a0 0x0>;
				snps,dis_u2_susphy_quirk;
				snps,dis_enblslpm_quirk;
				phys = <&usb_hsphy>, <&usb_ssphy>;
				phy-names = "usb2-phy", "usb3-phy";
			};
		};

		pdc: interrupt-controller@b210000 {
			compatible = "qcom,sdx55-pdc", "qcom,pdc";
			reg = <0x0b210000 0x30000>;
			qcom,pdc-ranges = <0 179 52>;
			#interrupt-cells = <3>;
			interrupt-parent = <&intc>;
			interrupt-controller;
		};

		restart@c264000 {
			compatible = "qcom,pshold";
			reg = <0x0c264000 0x1000>;
		};

		spmi_bus: spmi@c440000 {
			compatible = "qcom,spmi-pmic-arb";
			reg = <0x0c440000 0x0000d00>,
			      <0x0c600000 0x2000000>,
			      <0x0e600000 0x0100000>,
			      <0x0e700000 0x00a0000>,
			      <0x0c40a000 0x0000700>;
			reg-names = "core", "chnls", "obsrvr", "intr", "cnfg";
			interrupt-names = "periph_irq";
			interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
			qcom,ee = <0>;
			qcom,channel = <0>;
			#address-cells = <2>;
			#size-cells = <0>;
			interrupt-controller;
			#interrupt-cells = <4>;
			cell-index = <0>;
		};

		tlmm: pinctrl@f100000 {
			compatible = "qcom,sdx55-pinctrl";
			reg = <0xf100000 0x300000>;
			interrupts = <GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH>;
			gpio-controller;
			#gpio-cells = <2>;
			interrupt-controller;
			#interrupt-cells = <2>;
			gpio-ranges = <&tlmm 0 0 109>;
		};

		sram@1468f000 {
			compatible = "qcom,sdx55-imem", "syscon", "simple-mfd";
			reg = <0x1468f000 0x1000>;

			#address-cells = <1>;
			#size-cells = <1>;

			ranges = <0x0 0x1468f000 0x1000>;

			pil-reloc@94c {
				compatible = "qcom,pil-reloc-info";
				reg = <0x94c 0x200>;
			};
		};

		apps_smmu: iommu@15000000 {
			compatible = "qcom,sdx55-smmu-500", "arm,mmu-500";
			reg = <0x15000000 0x20000>;
			#iommu-cells = <2>;
			#global-interrupts = <1>;
			interrupts = <GIC_SPI 65 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 70 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
		};

		intc: interrupt-controller@17800000 {
			compatible = "qcom,msm-qgic2";
			interrupt-controller;
			interrupt-parent = <&intc>;
			#interrupt-cells = <3>;
			reg = <0x17800000 0x1000>,
			      <0x17802000 0x1000>;
		};

		a7pll: clock@17808000 {
			compatible = "qcom,sdx55-a7pll";
			reg = <0x17808000 0x1000>;
			clocks = <&rpmhcc RPMH_CXO_CLK>;
			clock-names = "bi_tcxo";
			#clock-cells = <0>;
		};

		apcs: mailbox@17810000 {
			compatible = "qcom,sdx55-apcs-gcc", "syscon";
			reg = <0x17810000 0x2000>;
			#mbox-cells = <1>;
			clocks = <&rpmhcc RPMH_CXO_CLK>, <&a7pll>, <&gcc GPLL0>;
			clock-names = "ref", "pll", "aux";
			#clock-cells = <0>;
		};

		watchdog@17817000 {
			compatible = "qcom,apss-wdt-sdx55", "qcom,kpss-wdt";
			reg = <0x17817000 0x1000>;
			clocks = <&sleep_clk>;
		};

		timer@17820000 {
			#address-cells = <1>;
			#size-cells = <1>;
			ranges;
			compatible = "arm,armv7-timer-mem";
			reg = <0x17820000 0x1000>;
			clock-frequency = <19200000>;

			frame@17821000 {
				frame-number = <0>;
				interrupts = <GIC_SPI 7 0x4>,
					     <GIC_SPI 6 0x4>;
				reg = <0x17821000 0x1000>,
				      <0x17822000 0x1000>;
			};

			frame@17823000 {
				frame-number = <1>;
				interrupts = <GIC_SPI 8 0x4>;
				reg = <0x17823000 0x1000>;
				status = "disabled";
			};

			frame@17824000 {
				frame-number = <2>;
				interrupts = <GIC_SPI 9 0x4>;
				reg = <0x17824000 0x1000>;
				status = "disabled";
			};

			frame@17825000 {
				frame-number = <3>;
				interrupts = <GIC_SPI 10 0x4>;
				reg = <0x17825000 0x1000>;
				status = "disabled";
			};

			frame@17826000 {
				frame-number = <4>;
				interrupts = <GIC_SPI 11 0x4>;
				reg = <0x17826000 0x1000>;
				status = "disabled";
			};

			frame@17827000 {
				frame-number = <5>;
				interrupts = <GIC_SPI 12 0x4>;
				reg = <0x17827000 0x1000>;
				status = "disabled";
			};

			frame@17828000 {
				frame-number = <6>;
				interrupts = <GIC_SPI 13 0x4>;
				reg = <0x17828000 0x1000>;
				status = "disabled";
			};

			frame@17829000 {
				frame-number = <7>;
				interrupts = <GIC_SPI 14 0x4>;
				reg = <0x17829000 0x1000>;
				status = "disabled";
			};
		};

		apps_rsc: rsc@17840000 {
			compatible = "qcom,rpmh-rsc";
			reg = <0x17830000 0x10000>, <0x17840000 0x10000>;
			reg-names = "drv-0", "drv-1";
			interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
			qcom,tcs-offset = <0xd00>;
			qcom,drv-id = <1>;
			qcom,tcs-config = <ACTIVE_TCS  2>, <SLEEP_TCS   2>,
					  <WAKE_TCS    2>, <CONTROL_TCS 1>;

			rpmhcc: clock-controller {
				compatible = "qcom,sdx55-rpmh-clk";
				#clock-cells = <1>;
				clock-names = "xo";
				clocks = <&xo_board>;
			};

			rpmhpd: power-controller {
				compatible = "qcom,sdx55-rpmhpd";
				#power-domain-cells = <1>;
				operating-points-v2 = <&rpmhpd_opp_table>;

				rpmhpd_opp_table: opp-table {
					compatible = "operating-points-v2";

					rpmhpd_opp_ret: opp1 {
						opp-level = <RPMH_REGULATOR_LEVEL_RETENTION>;
					};

					rpmhpd_opp_min_svs: opp2 {
						opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>;
					};

					rpmhpd_opp_low_svs: opp3 {
						opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
					};

					rpmhpd_opp_svs: opp4 {
						opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
					};

					rpmhpd_opp_svs_l1: opp5 {
						opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
					};

					rpmhpd_opp_nom: opp6 {
						opp-level = <RPMH_REGULATOR_LEVEL_NOM>;
					};

					rpmhpd_opp_nom_l1: opp7 {
						opp-level = <RPMH_REGULATOR_LEVEL_NOM_L1>;
					};

					rpmhpd_opp_nom_l2: opp8 {
						opp-level = <RPMH_REGULATOR_LEVEL_NOM_L2>;
					};

					rpmhpd_opp_turbo: opp9 {
						opp-level = <RPMH_REGULATOR_LEVEL_TURBO>;
					};

					rpmhpd_opp_turbo_l1: opp10 {
						opp-level = <RPMH_REGULATOR_LEVEL_TURBO_L1>;
					};
				};
			};

			apps_bcm_voter: bcm-voter {
				compatible = "qcom,bcm-voter";
			};
		};
	};

	timer {
		compatible = "arm,armv7-timer";
		interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
			     <GIC_PPI 12 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
			     <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
			     <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
		clock-frequency = <19200000>;
	};
};


code:
// SPDX-License-Identifier: BSD-3-Clause
/*
 * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
 */
/dts-v1/;

#include "qcom-sdx65.dtsi"
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
#include <arm64/qcom/pmk8350.dtsi>
#include <arm64/qcom/pm8150b.dtsi>
#include "qcom-pmx65.dtsi"

/ {
	model = "Qualcomm Technologies, Inc. SDX65 MTP";
	compatible = "qcom,sdx65-mtp", "qcom,sdx65";
	qcom,board-id = <0x2010008 0x302>;

	aliases {
		serial0 = &blsp1_uart3;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

	reserved-memory {
		#address-cells = <1>;
		#size-cells = <1>;
		ranges;

		mpss_dsm: memory@8c400000 {
			no-map;
			reg = <0x8c400000 0x3200000>;
		};

		ipa_fw_mem: memory@8fced000 {
			no-map;
			reg = <0x8fced000 0x10000>;
		};

		mpss_adsp_mem: memory@90800000 {
			no-map;
			reg = <0x90800000 0x10000000>;
		};
	};

	vph_pwr: vph-pwr-regulator {
		compatible = "regulator-fixed";
		regulator-name = "vph_pwr";
		regulator-min-microvolt = <3700000>;
		regulator-max-microvolt = <3700000>;
	};

	vreg_bob_3p3: pmx65_bob {
		compatible = "regulator-fixed";
		regulator-name = "vreg_bob_3p3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		regulator-always-on;
		regulator-boot-on;

		vin-supply = <&vph_pwr>;
	};
};

&apps_rsc {
	pmx65-rpmh-regulators {
		compatible = "qcom,pmx65-rpmh-regulators";
		qcom,pmic-id = "b";

		vdd-s1-supply = <&vph_pwr>;
		vdd-s2-supply = <&vph_pwr>;
		vdd-s3-supply = <&vph_pwr>;
		vdd-s4-supply = <&vph_pwr>;
		vdd-s5-supply = <&vph_pwr>;
		vdd-s6-supply = <&vph_pwr>;
		vdd-s7-supply = <&vph_pwr>;
		vdd-s8-supply = <&vph_pwr>;
		vdd-l1-supply = <&vreg_s2b_1p224>;
		vdd-l2-l18-supply = <&vreg_s2b_1p224>;
		vdd-l3-supply = <&vreg_s8b_0p824>;
		vdd-l4-supply = <&vreg_s7b_0p936>;
		vdd-l5-l6-l16-supply = <&vreg_s4b_1p824>;
		vdd-l7-supply = <&vreg_s3b_0p776>;
		vdd-l8-l9-supply = <&vreg_s8b_0p824>;
		vdd-l10-supply = <&vreg_bob_3p3>;
		vdd-l11-l13-supply = <&vreg_bob_3p3>;
		vdd-l12-supply = <&vreg_s2b_1p224>;
		vdd-l14-supply = <&vreg_s3b_0p776>;
		vdd-l15-supply = <&vreg_s2b_1p224>;
		vdd-l17-supply = <&vreg_s8b_0p824>;
		vdd-l19-supply = <&vreg_s3b_0p776>;
		vdd-l20-supply = <&vreg_s7b_0p936>;
		vdd-l21-supply = <&vreg_s7b_0p936>;

		vreg_s2b_1p224: smps2 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1400000>;
		};

		vreg_s3b_0p776: smps3 {
			regulator-min-microvolt = <500000>;
			regulator-max-microvolt = <1040000>;
		};

		vreg_s4b_1p824: smps4 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2024000>;
		};

		vreg_s7b_0p936: smps7 {
			regulator-min-microvolt = <500000>;
			regulator-max-microvolt = <1040000>;
		};

		vreg_s8b_0p824: smps8 {
			regulator-min-microvolt = <304000>;
			regulator-max-microvolt = <1300000>;
		};

		vreg_l1b_1p2: ldo1 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		ldo2 {
			regulator-min-microvolt = <1128000>;
			regulator-max-microvolt = <1128000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		ldo3 {
			regulator-min-microvolt = <300000>;
			regulator-max-microvolt = <960000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		vreg_l4b_0p88: ldo4 {
			regulator-min-microvolt = <880000>;
			regulator-max-microvolt = <912000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		vreg_l5b_1p8: ldo5 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		ldo6 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		ldo7 {
			regulator-min-microvolt = <752000>;
			regulator-max-microvolt = <752000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		ldo8 {
			regulator-min-microvolt = <800000>;
			regulator-max-microvolt = <800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		ldo9 {
			regulator-min-microvolt = <800000>;
			regulator-max-microvolt = <800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		vreg_l10b_3p08: ldo10 {
			regulator-min-microvolt = <3088000>;
			regulator-max-microvolt = <3088000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		ldo11 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <2928000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		ldo12 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		ldo13 {
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <2928000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		ldo14 {
			regulator-min-microvolt = <600000>;
			regulator-max-microvolt = <800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		ldo15 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		ldo16 {
			regulator-min-microvolt = <1776000>;
			regulator-max-microvolt = <1776000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		ldo17 {
			regulator-min-microvolt = <300000>;
			regulator-max-microvolt = <960000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		ldo19 {
			regulator-min-microvolt = <752000>;
			regulator-max-microvolt = <752000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		ldo20 {
			regulator-min-microvolt = <912000>;
			regulator-max-microvolt = <912000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		ldo21 {
			regulator-min-microvolt = <912000>;
			regulator-max-microvolt = <912000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};
	};
};

&blsp1_uart3 {
	status = "okay";
};

&qpic_bam {
	status = "okay";
};

&qpic_nand {
	status = "okay";

	nand@0 {
		reg = <0>;

		nand-ecc-strength = <4>;
		nand-ecc-step-size = <512>;
		nand-bus-width = <8>;
		/* ico and efs2 partitions are secured */
		secure-regions = /bits/ 64 <0x500000 0x500000
					    0xa00000 0xb00000>;
	};
};

&remoteproc_mpss {
	status = "okay";
	memory-region = <&mpss_adsp_mem>;
};

&usb {
	status = "okay";
};

&usb_dwc3 {
	dr_mode = "peripheral";
};

&usb_hsphy {
	status = "okay";
	vdda-pll-supply = <&vreg_l4b_0p88>;
	vdda33-supply = <&vreg_l10b_3p08>;
	vdda18-supply = <&vreg_l5b_1p8>;
};

&usb_qmpphy {
	status = "okay";
	vdda-phy-supply = <&vreg_l4b_0p88>;
	vdda-pll-supply = <&vreg_l1b_1p2>;
};