code:
// SPDX-License-Identifier: GPL-2.0
#include <dt-bindings/input/input.h>

#include "qcom-msm8960.dtsi"

/ {
	model = "Qualcomm MSM8960 CDP";
	compatible = "qcom,msm8960-cdp", "qcom,msm8960";

	aliases {
		serial0 = &gsbi5_serial;
	};

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

	regulators {
		compatible = "simple-bus";

		ext_l2: gpio-regulator {
			compatible = "regulator-fixed";
			regulator-name = "ext_l2";
			gpio = <&msmgpio 91 0>;
			startup-delay-us = <10000>;
			enable-active-high;
		};
	};
};

&gsbi1 {
	qcom,mode = <GSBI_PROT_SPI>;
	pinctrl-names = "default";
	pinctrl-0 = <&spi1_default>;
	status = "okay";
};

&gsbi1_spi {
	status = "okay";

	ethernet@0 {
		compatible = "micrel,ks8851";
		reg = <0>;
		interrupt-parent = <&msmgpio>;
		interrupts = <90 IRQ_TYPE_LEVEL_LOW>;
		spi-max-frequency = <5400000>;
		vdd-supply = <&ext_l2>;
		vdd-io-supply = <&pm8921_lvs6>;
		reset-gpios = <&msmgpio 89 0>;
	};
};

&gsbi5 {
	qcom,mode = <GSBI_PROT_I2C_UART>;
	status = "okay";
};

&gsbi5_serial {
	status = "okay";
};

&msmgpio {
	spi1_default: spi1-default-state {
		 mosi-pins {
			pins = "gpio6";
			function = "gsbi1";
			drive-strength = <12>;
			bias-disable;
		 };

		 miso-pins {
			pins = "gpio7";
			function = "gsbi1";
			drive-strength = <12>;
			bias-disable;
		 };

		 cs-pins {
			pins = "gpio8";
			function = "gsbi1";
			drive-strength = <12>;
			bias-disable;
			output-low;
		 };

		 clk-pins {
			pins = "gpio9";
			function = "gsbi1";
			drive-strength = <12>;
			bias-disable;
		 };
	};
};

&pmicintc {
	keypad@148 {
		linux,keymap = <
			MATRIX_KEY(0, 0, KEY_VOLUMEUP)
			MATRIX_KEY(0, 1, KEY_VOLUMEDOWN)
			MATRIX_KEY(0, 2, KEY_CAMERA_FOCUS)
			MATRIX_KEY(0, 3, KEY_CAMERA)
			>;
		keypad,num-rows = <1>;
		keypad,num-columns = <5>;
	};
};

&rpm {
	regulators {
		compatible = "qcom,rpm-pm8921-regulators";
		vin_lvs1_3_6-supply = <&pm8921_s4>;
		vin_lvs2-supply = <&pm8921_s4>;
		vin_lvs4_5_7-supply = <&pm8921_s4>;
		vdd_ncp-supply = <&pm8921_l6>;
		vdd_l1_l2_l12_l18-supply = <&pm8921_s4>;
		vdd_l21_l23_l29-supply = <&pm8921_s8>;
		vdd_l24-supply = <&pm8921_s1>;
		vdd_l25-supply = <&pm8921_s1>;
		vdd_l27-supply = <&pm8921_s7>;
		vdd_l28-supply = <&pm8921_s7>;

		/* Buck SMPS */
		pm8921_s1: s1 {
			regulator-always-on;
			regulator-min-microvolt = <1225000>;
			regulator-max-microvolt = <1225000>;
			qcom,switch-mode-frequency = <3200000>;
			bias-pull-down;
		};

		pm8921_s2: s2 {
			regulator-min-microvolt = <1300000>;
			regulator-max-microvolt = <1300000>;
			qcom,switch-mode-frequency = <1600000>;
			bias-pull-down;
		};

		pm8921_s3: s3 {
			regulator-min-microvolt = <500000>;
			regulator-max-microvolt = <1150000>;
			qcom,switch-mode-frequency = <4800000>;
			bias-pull-down;
		};

		pm8921_s4: s4 {
			regulator-always-on;
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			qcom,switch-mode-frequency = <1600000>;
			bias-pull-down;
			qcom,force-mode = <QCOM_RPM_FORCE_MODE_AUTO>;
		};

		pm8921_s7: s7 {
			regulator-min-microvolt = <1150000>;
			regulator-max-microvolt = <1150000>;
			qcom,switch-mode-frequency = <3200000>;
			bias-pull-down;
		};

		pm8921_s8: s8 {
			regulator-always-on;
			regulator-min-microvolt = <2050000>;
			regulator-max-microvolt = <2050000>;
			qcom,switch-mode-frequency = <1600000>;
			bias-pull-down;
		};

		/* PMOS LDO */
		pm8921_l1: l1 {
			regulator-always-on;
			regulator-min-microvolt = <1050000>;
			regulator-max-microvolt = <1050000>;
			bias-pull-down;
		};

		pm8921_l2: l2 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			bias-pull-down;
		};

		pm8921_l3: l3 {
			regulator-min-microvolt = <3075000>;
			regulator-max-microvolt = <3075000>;
			bias-pull-down;
		};

		pm8921_l4: l4 {
			regulator-always-on;
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			bias-pull-down;
		};

		pm8921_l5: l5 {
			regulator-min-microvolt = <2950000>;
			regulator-max-microvolt = <2950000>;
			bias-pull-down;
		};

		pm8921_l6: l6 {
			regulator-min-microvolt = <2950000>;
			regulator-max-microvolt = <2950000>;
			bias-pull-down;
		};

		pm8921_l7: l7 {
			regulator-always-on;
			regulator-min-microvolt = <1850000>;
			regulator-max-microvolt = <2950000>;
			bias-pull-down;
		};

		pm8921_l8: l8 {
			regulator-min-microvolt = <2800000>;
			regulator-max-microvolt = <3000000>;
			bias-pull-down;
		};

		pm8921_l9: l9 {
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3000000>;
			bias-pull-down;
		};

		pm8921_l10: l10 {
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3000000>;
			bias-pull-down;
		};

		pm8921_l11: l11 {
			regulator-min-microvolt = <2850000>;
			regulator-max-microvolt = <2850000>;
			bias-pull-down;
		};

		pm8921_l12: l12 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			bias-pull-down;
		};

		pm8921_l14: l14 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			bias-pull-down;
		};

		pm8921_l15: l15 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
			bias-pull-down;
		};

		pm8921_l16: l16 {
			regulator-min-microvolt = <2800000>;
			regulator-max-microvolt = <2800000>;
			bias-pull-down;
		};

		pm8921_l17: l17 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
			bias-pull-down;
		};

		pm8921_l18: l18 {
			regulator-min-microvolt = <1300000>;
			regulator-max-microvolt = <1300000>;
			bias-pull-down;
		};

		pm8921_l21: l21 {
			regulator-min-microvolt = <1900000>;
			regulator-max-microvolt = <1900000>;
			bias-pull-down;
		};

		pm8921_l22: l22 {
			regulator-min-microvolt = <2750000>;
			regulator-max-microvolt = <2750000>;
			bias-pull-down;
		};

		pm8921_l23: l23 {
			regulator-always-on;
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			bias-pull-down;
		};

		pm8921_l24: l24 {
			regulator-min-microvolt = <750000>;
			regulator-max-microvolt = <1150000>;
			bias-pull-down;
		};

		pm8921_l25: l25 {
			regulator-always-on;
			regulator-min-microvolt = <1250000>;
			regulator-max-microvolt = <1250000>;
			bias-pull-down;
		};

		/* Low Voltage Switch */
		pm8921_lvs1: lvs1 {
			bias-pull-down;
		};

		pm8921_lvs2: lvs2 {
			bias-pull-down;
		};

		pm8921_lvs3: lvs3 {
			bias-pull-down;
		};

		pm8921_lvs4: lvs4 {
			bias-pull-down;
		};

		pm8921_lvs5: lvs5 {
			bias-pull-down;
		};

		pm8921_lvs6: lvs6 {
			bias-pull-down;
		};

		pm8921_lvs7: lvs7 {
			bias-pull-down;
		};

		pm8921_ncp: ncp {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			qcom,switch-mode-frequency = <1600000>;
		};
	};
};

/* eMMC */
&sdcc1 {
	status = "okay";
};

/* External micro SD card */
&sdcc3 {
	status = "okay";
};


code:
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;

#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/qcom,gcc-msm8960.h>
#include <dt-bindings/clock/qcom,lcc-msm8960.h>
#include <dt-bindings/mfd/qcom-rpm.h>
#include <dt-bindings/soc/qcom,gsbi.h>

/ {
	#address-cells = <1>;
	#size-cells = <1>;
	model = "Qualcomm MSM8960";
	compatible = "qcom,msm8960";
	interrupt-parent = <&intc>;

	cpus {
		#address-cells = <1>;
		#size-cells = <0>;
		interrupts = <GIC_PPI 14 0x304>;

		cpu@0 {
			compatible = "qcom,krait";
			enable-method = "qcom,kpss-acc-v1";
			device_type = "cpu";
			reg = <0>;
			next-level-cache = <&L2>;
			qcom,acc = <&acc0>;
			qcom,saw = <&saw0>;
		};

		cpu@1 {
			compatible = "qcom,krait";
			enable-method = "qcom,kpss-acc-v1";
			device_type = "cpu";
			reg = <1>;
			next-level-cache = <&L2>;
			qcom,acc = <&acc1>;
			qcom,saw = <&saw1>;
		};

		L2: l2-cache {
			compatible = "cache";
			cache-level = <2>;
		};
	};

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

	cpu-pmu {
		compatible = "qcom,krait-pmu";
		interrupts = <GIC_PPI 10 0x304>;
		qcom,no-pc-write;
	};

	clocks {
		cxo_board: cxo_board {
			compatible = "fixed-clock";
			#clock-cells = <0>;
			clock-frequency = <19200000>;
			clock-output-names = "cxo_board";
		};

		pxo_board: pxo_board {
			compatible = "fixed-clock";
			#clock-cells = <0>;
			clock-frequency = <27000000>;
			clock-output-names = "pxo_board";
		};

		sleep_clk {
			compatible = "fixed-clock";
			#clock-cells = <0>;
			clock-frequency = <32768>;
			clock-output-names = "sleep_clk";
		};
	};

	/* Temporary fixed regulator */
	vsdcc_fixed: vsdcc-regulator {
		compatible = "regulator-fixed";
		regulator-name = "SDCC Power";
		regulator-min-microvolt = <2700000>;
		regulator-max-microvolt = <2700000>;
		regulator-always-on;
	};

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

		intc: interrupt-controller@2000000 {
			compatible = "qcom,msm-qgic2";
			interrupt-controller;
			#interrupt-cells = <3>;
			reg = <0x02000000 0x1000>,
			      <0x02002000 0x1000>;
		};

		timer@200a000 {
			compatible = "qcom,kpss-timer",
				     "qcom,kpss-wdt-msm8960", "qcom,msm-timer";
			interrupts = <GIC_PPI 1 0x301>,
				     <GIC_PPI 2 0x301>,
				     <GIC_PPI 3 0x301>;
			reg = <0x0200a000 0x100>;
			clock-frequency = <27000000>,
					  <32768>;
			cpu-offset = <0x80000>;
		};

		msmgpio: pinctrl@800000 {
			compatible = "qcom,msm8960-pinctrl";
			gpio-controller;
			gpio-ranges = <&msmgpio 0 0 152>;
			#gpio-cells = <2>;
			interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-controller;
			#interrupt-cells = <2>;
			reg = <0x800000 0x4000>;
		};

		gcc: clock-controller@900000 {
			compatible = "qcom,gcc-msm8960";
			#clock-cells = <1>;
			#power-domain-cells = <1>;
			#reset-cells = <1>;
			reg = <0x900000 0x4000>;
			clocks = <&cxo_board>,
				 <&pxo_board>,
				 <&lcc PLL4>;
			clock-names = "cxo", "pxo", "pll4";
		};

		lcc: clock-controller@28000000 {
			compatible = "qcom,lcc-msm8960";
			reg = <0x28000000 0x1000>;
			#clock-cells = <1>;
			#reset-cells = <1>;
			clocks = <&pxo_board>,
				 <&gcc PLL4_VOTE>,
				 <0>,
				 <0>, <0>,
				 <0>, <0>,
				 <0>;
			clock-names = "pxo",
				      "pll4_vote",
				      "mi2s_codec_clk",
				      "codec_i2s_mic_codec_clk",
				      "spare_i2s_mic_codec_clk",
				      "codec_i2s_spkr_codec_clk",
				      "spare_i2s_spkr_codec_clk",
				      "pcm_codec_clk";
		};

		clock-controller@4000000 {
			compatible = "qcom,mmcc-msm8960";
			reg = <0x4000000 0x1000>;
			#clock-cells = <1>;
			#power-domain-cells = <1>;
			#reset-cells = <1>;
			clocks = <&pxo_board>,
				 <&gcc PLL3>,
				 <&gcc PLL8_VOTE>,
				 <0>,
				 <0>,
				 <0>,
				 <0>,
				 <0>;
			clock-names = "pxo",
				      "pll3",
				      "pll8_vote",
				      "dsi1pll",
				      "dsi1pllbyte",
				      "dsi2pll",
				      "dsi2pllbyte",
				      "hdmipll";
		};

		l2cc: clock-controller@2011000 {
			compatible = "qcom,kpss-gcc", "syscon";
			reg = <0x2011000 0x1000>;
		};

		rpm: rpm@108000 {
			compatible = "qcom,rpm-msm8960";
			reg = <0x108000 0x1000>;
			qcom,ipc = <&l2cc 0x8 2>;

			interrupts = <GIC_SPI 19 IRQ_TYPE_EDGE_RISING>,
				     <GIC_SPI 21 IRQ_TYPE_EDGE_RISING>,
				     <GIC_SPI 22 IRQ_TYPE_EDGE_RISING>;
			interrupt-names = "ack", "err", "wakeup";

			regulators {
				compatible = "qcom,rpm-pm8921-regulators";
			};
		};

		acc0: clock-controller@2088000 {
			compatible = "qcom,kpss-acc-v1";
			reg = <0x02088000 0x1000>, <0x02008000 0x1000>;
		};

		acc1: clock-controller@2098000 {
			compatible = "qcom,kpss-acc-v1";
			reg = <0x02098000 0x1000>, <0x02008000 0x1000>;
		};

		saw0: regulator@2089000 {
			compatible = "qcom,saw2";
			reg = <0x02089000 0x1000>, <0x02009000 0x1000>;
			regulator;
		};

		saw1: regulator@2099000 {
			compatible = "qcom,saw2";
			reg = <0x02099000 0x1000>, <0x02009000 0x1000>;
			regulator;
		};

		gsbi5: gsbi@16400000 {
			compatible = "qcom,gsbi-v1.0.0";
			cell-index = <5>;
			reg = <0x16400000 0x100>;
			clocks = <&gcc GSBI5_H_CLK>;
			clock-names = "iface";
			#address-cells = <1>;
			#size-cells = <1>;
			ranges;

			syscon-tcsr = <&tcsr>;

			gsbi5_serial: serial@16440000 {
				compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
				reg = <0x16440000 0x1000>,
				      <0x16400000 0x1000>;
				interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>;
				clocks = <&gcc GSBI5_UART_CLK>, <&gcc GSBI5_H_CLK>;
				clock-names = "core", "iface";
				status = "disabled";
			};
		};

		ssbi@500000 {
			compatible = "qcom,ssbi";
			reg = <0x500000 0x1000>;
			qcom,controller-type = "pmic-arbiter";

			pmicintc: pmic {
				compatible = "qcom,pm8921";
				interrupt-parent = <&msmgpio>;
				interrupts = <104 IRQ_TYPE_LEVEL_LOW>;
				#interrupt-cells = <2>;
				interrupt-controller;
				#address-cells = <1>;
				#size-cells = <0>;

				pwrkey@1c {
					compatible = "qcom,pm8921-pwrkey";
					reg = <0x1c>;
					interrupt-parent = <&pmicintc>;
					interrupts = <50 IRQ_TYPE_EDGE_RISING>,
						     <51 IRQ_TYPE_EDGE_RISING>;
					debounce = <15625>;
					pull-up;
				};

				keypad@148 {
					compatible = "qcom,pm8921-keypad";
					reg = <0x148>;
					interrupt-parent = <&pmicintc>;
					interrupts = <74 IRQ_TYPE_EDGE_RISING>,
						     <75 IRQ_TYPE_EDGE_RISING>;
					debounce = <15>;
					scan-delay = <32>;
					row-hold = <91500>;
				};

				rtc@11d {
					compatible = "qcom,pm8921-rtc";
					interrupt-parent = <&pmicintc>;
					interrupts = <39 IRQ_TYPE_EDGE_RISING>;
					reg = <0x11d>;
					allow-set-time;
				};
			};
		};

		rng@1a500000 {
			compatible = "qcom,prng";
			reg = <0x1a500000 0x200>;
			clocks = <&gcc PRNG_CLK>;
			clock-names = "core";
		};

		sdcc3: mmc@12180000 {
			compatible = "arm,pl18x", "arm,primecell";
			arm,primecell-periphid = <0x00051180>;
			status = "disabled";
			reg = <0x12180000 0x8000>;
			interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc SDC3_CLK>, <&gcc SDC3_H_CLK>;
			clock-names = "mclk", "apb_pclk";
			bus-width = <4>;
			cap-sd-highspeed;
			cap-mmc-highspeed;
			max-frequency = <192000000>;
			no-1-8-v;
			vmmc-supply = <&vsdcc_fixed>;
		};

		sdcc1: mmc@12400000 {
			status = "disabled";
			compatible = "arm,pl18x", "arm,primecell";
			arm,primecell-periphid = <0x00051180>;
			reg = <0x12400000 0x8000>;
			interrupts = <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc SDC1_CLK>, <&gcc SDC1_H_CLK>;
			clock-names = "mclk", "apb_pclk";
			bus-width = <8>;
			max-frequency = <96000000>;
			non-removable;
			cap-sd-highspeed;
			cap-mmc-highspeed;
			vmmc-supply = <&vsdcc_fixed>;
		};

		tcsr: syscon@1a400000 {
			compatible = "qcom,tcsr-msm8960", "syscon";
			reg = <0x1a400000 0x100>;
		};

		gsbi1: gsbi@16000000 {
			compatible = "qcom,gsbi-v1.0.0";
			cell-index = <1>;
			reg = <0x16000000 0x100>;
			clocks = <&gcc GSBI1_H_CLK>;
			clock-names = "iface";
			#address-cells = <1>;
			#size-cells = <1>;
			ranges;

			gsbi1_spi: spi@16080000 {
				compatible = "qcom,spi-qup-v1.1.1";
				#address-cells = <1>;
				#size-cells = <0>;
				reg = <0x16080000 0x1000>;
				interrupts = <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>;
				spi-max-frequency = <24000000>;
				cs-gpios = <&msmgpio 8 0>;

				clocks = <&gcc GSBI1_QUP_CLK>, <&gcc GSBI1_H_CLK>;
				clock-names = "core", "iface";
				status = "disabled";
			};
		};
	};
};

repo_name: angery/linux


code:
// SPDX-License-Identifier: GPL-2.0
#include "qcom-msm8974.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 = "LGE MSM 8974 HAMMERHEAD";
	compatible = "lge,hammerhead", "qcom,msm8974";
	chassis-type = "handset";

	aliases {
		serial0 = &blsp1_uart1;
		serial1 = &blsp2_uart4;
	};

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

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

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

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

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

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

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

		gpio = <&tlmm 26 GPIO_ACTIVE_HIGH>;
		enable-active-high;

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

&blsp1_i2c1 {
	status = "okay";
	clock-frequency = <100000>;

	charger: bq24192@6b {
		compatible = "ti,bq24192";
		reg = <0x6b>;
		interrupts-extended = <&spmi_bus 0 0xd5 0 IRQ_TYPE_EDGE_FALLING>;

		omit-battery-class;

		usb_otg_vbus: usb-otg-vbus { };
	};

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

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

		interrupt-parent = <&tlmm>;
		interrupts = <9 IRQ_TYPE_LEVEL_LOW>;

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

		maxim,alert-low-soc-level = <2>;
	};
};

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

	synaptics@70 {
		compatible = "syna,rmi4-i2c";
		reg = <0x70>;

		interrupts-extended = <&tlmm 5 IRQ_TYPE_EDGE_FALLING>;
		vdd-supply = <&pm8941_l22>;
		vio-supply = <&pm8941_lvs3>;

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

		#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_i2c3 {
	status = "okay";
	clock-frequency = <100000>;

	avago_apds993@39 {
		compatible = "avago,apds9930";
		reg = <0x39>;
		interrupts-extended = <&tlmm 61 IRQ_TYPE_EDGE_FALLING>;
		vdd-supply = <&pm8941_l17>;
		vddio-supply = <&pm8941_lvs1>;
		led-max-microamp = <100000>;
		amstaos,proximity-diodes = <0>;
	};
};

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

	led-controller@38 {
		compatible = "ti,lm3630a";
		status = "okay";
		reg = <0x38>;

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

		led@0 {
			reg = <0>;
			led-sources = <0 1>;
			label = "lcd-backlight";
			default-brightness = <200>;
		};
	};
};

&blsp2_i2c6 {
	status = "okay";
	clock-frequency = <100000>;

	mpu6515@68 {
		compatible = "invensense,mpu6515";
		reg = <0x68>;
		interrupts-extended = <&tlmm 73 IRQ_TYPE_EDGE_FALLING>;
		vddio-supply = <&pm8941_lvs1>;

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

		mount-matrix = "0", "-1", "0",
				"-1", "0", "0",
				"0", "0", "1";

		i2c-gate {
			#address-cells = <1>;
			#size-cells = <0>;
			ak8963@f {
				compatible = "asahi-kasei,ak8963";
				reg = <0x0f>;
				gpios = <&tlmm 67 GPIO_ACTIVE_HIGH>;
				vid-supply = <&pm8941_lvs1>;
				vdd-supply = <&pm8941_l17>;
			};

			bmp280@76 {
				compatible = "bosch,bmp280";
				reg = <0x76>;
				vdda-supply = <&pm8941_lvs1>;
				vddd-supply = <&pm8941_l17>;
			};
		};
	};
};

&blsp1_uart1 {
	status = "okay";
};

&blsp2_uart4 {
	status = "okay";

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

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

		host-wakeup-gpios = <&tlmm 42 GPIO_ACTIVE_HIGH>;
		device-wakeup-gpios = <&tlmm 62 GPIO_ACTIVE_HIGH>;
		shutdown-gpios = <&tlmm 41 GPIO_ACTIVE_HIGH>;
	};
};

&dsi0 {
	status = "okay";

	vdda-supply = <&pm8941_l2>;
	vdd-supply = <&pm8941_lvs3>;
	vddio-supply = <&pm8941_l12>;

	panel: panel@0 {
		reg = <0>;
		compatible = "lg,acx467akm-7";

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

		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 = <&pm8941_l12>;
};

&mdss {
	status = "okay";
};

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

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

	fuelgauge_pin: fuelgauge-int-state {
		pins = "gpio9";
		function = "normal";

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

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

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

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

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

	otg {
		gpio-hog;
		gpios = <35 GPIO_ACTIVE_HIGH>;
		output-high;
		line-name = "otg-gpio";
	};
};

&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@7 {
			reg = <7>;
			color = <LED_COLOR_ID_RED>;
		};

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

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

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

		pm8841_s1: s1 {
			regulator-min-microvolt = <675000>;
			regulator-max-microvolt = <1050000>;
		};

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

		pm8841_s3: s3 {
			regulator-min-microvolt = <1050000>;
			regulator-max-microvolt = <1050000>;
		};

		pm8841_s4: s4 {
			regulator-min-microvolt = <815000>;
			regulator-max-microvolt = <900000>;
		};
	};

	regulators-1 {
		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_l8_l16_l18_l19-supply = <&vreg_vph_pwr>;
		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-always-on;
			regulator-boot-on;
		};

		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 = <1225000>;
			regulator-max-microvolt = <1225000>;
		};

		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_l10: l10 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
		};

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

		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 = <2850000>;
			regulator-max-microvolt = <2850000>;
		};

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

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

		pm8941_l20: l20 {
			regulator-min-microvolt = <2950000>;
			regulator-max-microvolt = <2950000>;
			regulator-system-load = <200000>;
			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 = <3300000>;
		};

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

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

		pm8941_lvs1: lvs1 {};
		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";

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

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

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

		brcm,drive-strength = <10>;

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

&tlmm {
	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;
		};
	};

	mpu6515_pin: mpu6515-state {
		pins = "gpio73";
		function = "gpio";
		bias-disable;
		input-enable;
	};

	touch_pin: touch-state {
		int-pins {
			pins = "gpio5";
			function = "gpio";

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

		reset-pins {
			pins = "gpio8";
			function = "gpio";

			drive-strength = <2>;
			bias-pull-up;
		};
	};

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

	bt_pin: bt-state {
		hostwake-pins {
			pins = "gpio42";
			function = "gpio";
		};

		devwake-pins {
			pins = "gpio62";
			function = "gpio";
		};

		shutdown-pins {
			pins = "gpio41";
			function = "gpio";
		};
	};
};

&usb {
	status = "okay";

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

	extcon = <&charger>, <&usb_id>;
	vbus-supply = <&usb_otg_vbus>;

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

&usb_hs1_phy {
	status = "okay";

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

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


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

/ {
	model = "Sony Xperia Z1 Compact";
	compatible = "sony,xperia-amami", "qcom,msm8974";
	chassis-type = "handset";
};

&smbb {
	qcom,fast-charge-safe-current = <1300000>;
	qcom,fast-charge-current-limit = <1300000>;
	qcom,dc-current-limit = <1300000>;
};


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

/ {
	model = "Sony Xperia Z1";
	compatible = "sony,xperia-honami", "qcom,msm8974";
	chassis-type = "handset";
};


code:
// SPDX-License-Identifier: GPL-2.0
#include "qcom-msm8974.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>

/ {
	aliases {
		serial0 = &blsp1_uart2;
	};

	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>;
		};
	};

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

		ramoops@3e8e0000 {
			compatible = "ramoops";
			reg = <0x3e8e0000 0x200000>;

			console-size = <0x100000>;
			record-size = <0x10000>;
			ftrace-size = <0x10000>;
			pmsg-size = <0x80000>;
		};
	};
};

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

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

		interrupts-extended = <&tlmm 61 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>;

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

		rmi4-f11@11 {
			reg = <0x11>;
			touchscreen-inverted-x;
			syna,sensor-type = <1>;
		};
	};
};

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

	nfc@28 {
		compatible = "nxp,pn544-i2c";
		reg = <0x28>;

		interrupt-parent = <&tlmm>;
		interrupts = <59 IRQ_TYPE_EDGE_RISING>;

		enable-gpios = <&pm8941_gpios 23 GPIO_ACTIVE_HIGH>;
		firmware-gpios = <&tlmm 77 GPIO_ACTIVE_HIGH>;
	};
};

&blsp1_uart2 {
	status = "okay";
};

&blsp2_dma {
	qcom,controlled-remotely;
};

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

	/* sii8334 MHL HDMI bridge */
};

&pm8941_coincell {
	status = "okay";
	qcom,rset-ohms = <2100>;
	qcom,vset-millivolts = <3000>;
};

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

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

&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>;
		};
	};
};

&pm8941_wled {
	status = "okay";

	qcom,cs-out;
	qcom,current-limit = <20>;
	qcom,current-boost-limit = <805>;
	qcom,switching-freq = <1600>;
	qcom,ovp = <29>;
	qcom,num-strings = <2>;
};

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

		pm8841_s1: s1 {
			regulator-min-microvolt = <675000>;
			regulator-max-microvolt = <1050000>;
		};

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

		pm8841_s3: s3 {
			regulator-min-microvolt = <500000>;
			regulator-max-microvolt = <1050000>;
		};

		pm8841_s4: s4 {
			regulator-min-microvolt = <500000>;
			regulator-max-microvolt = <1050000>;
		};
	};

	regulators-1 {
		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-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 = <3300000>;
			regulator-max-microvolt = <3300000>;
		};

		pm8941_l20: l20 {
			regulator-min-microvolt = <2950000>;
			regulator-max-microvolt = <2950000>;
			regulator-system-load = <200000>;
			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>;
};

&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 {
	ts_int_pin: touch-int-state {
		pins = "gpio61";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
		input-enable;
	};

	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: sdc-on-state {
		clk-pins {
			pins = "sdc2_clk";
			drive-strength = <10>;
			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;
		};
	};
};

&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>;
};


code:
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;

#include <dt-bindings/interconnect/qcom,msm8974.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/qcom,gcc-msm8974.h>
#include <dt-bindings/clock/qcom,mmcc-msm8974.h>
#include <dt-bindings/clock/qcom,rpmcc.h>
#include <dt-bindings/reset/qcom,gcc-msm8974.h>
#include <dt-bindings/gpio/gpio.h>

/ {
	#address-cells = <1>;
	#size-cells = <1>;
	interrupt-parent = <&intc>;

	clocks {
		xo_board: xo_board {
			compatible = "fixed-clock";
			#clock-cells = <0>;
			clock-frequency = <19200000>;
		};

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

	cpus {
		#address-cells = <1>;
		#size-cells = <0>;
		interrupts = <GIC_PPI 9 0xf04>;

		CPU0: cpu@0 {
			compatible = "qcom,krait";
			enable-method = "qcom,kpss-acc-v2";
			device_type = "cpu";
			reg = <0>;
			next-level-cache = <&L2>;
			qcom,acc = <&acc0>;
			qcom,saw = <&saw0>;
			cpu-idle-states = <&CPU_SPC>;
		};

		CPU1: cpu@1 {
			compatible = "qcom,krait";
			enable-method = "qcom,kpss-acc-v2";
			device_type = "cpu";
			reg = <1>;
			next-level-cache = <&L2>;
			qcom,acc = <&acc1>;
			qcom,saw = <&saw1>;
			cpu-idle-states = <&CPU_SPC>;
		};

		CPU2: cpu@2 {
			compatible = "qcom,krait";
			enable-method = "qcom,kpss-acc-v2";
			device_type = "cpu";
			reg = <2>;
			next-level-cache = <&L2>;
			qcom,acc = <&acc2>;
			qcom,saw = <&saw2>;
			cpu-idle-states = <&CPU_SPC>;
		};

		CPU3: cpu@3 {
			compatible = "qcom,krait";
			enable-method = "qcom,kpss-acc-v2";
			device_type = "cpu";
			reg = <3>;
			next-level-cache = <&L2>;
			qcom,acc = <&acc3>;
			qcom,saw = <&saw3>;
			cpu-idle-states = <&CPU_SPC>;
		};

		L2: l2-cache {
			compatible = "cache";
			cache-level = <2>;
			qcom,saw = <&saw_l2>;
		};

		idle-states {
			CPU_SPC: spc {
				compatible = "qcom,idle-state-spc",
						"arm,idle-state";
				entry-latency-us = <150>;
				exit-latency-us = <200>;
				min-residency-us = <2000>;
			};
		};
	};

	firmware {
		scm {
			compatible = "qcom,scm-msm8974", "qcom,scm";
			clocks = <&gcc GCC_CE1_CLK>, <&gcc GCC_CE1_AXI_CLK>, <&gcc GCC_CE1_AHB_CLK>;
			clock-names = "core", "bus", "iface";
		};
	};

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

	pmu {
		compatible = "qcom,krait-pmu";
		interrupts = <GIC_PPI 7 0xf04>;
	};

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

		mpss_region: mpss@8000000 {
			reg = <0x08000000 0x5100000>;
			no-map;
		};

		mba_region: mba@d100000 {
			reg = <0x0d100000 0x100000>;
			no-map;
		};

		wcnss_region: wcnss@d200000 {
			reg = <0x0d200000 0xa00000>;
			no-map;
		};

		adsp_region: adsp@dc00000 {
			reg = <0x0dc00000 0x1900000>;
			no-map;
		};

		venus_region: memory@f500000 {
			reg = <0x0f500000 0x500000>;
			no-map;
		};

		smem_region: smem@fa00000 {
			reg = <0xfa00000 0x200000>;
			no-map;
		};

		tz_region: memory@fc00000 {
			reg = <0x0fc00000 0x160000>;
			no-map;
		};

		rfsa_mem: memory@fd60000 {
			reg = <0x0fd60000 0x20000>;
			no-map;
		};

		rmtfs@fd80000 {
			compatible = "qcom,rmtfs-mem";
			reg = <0x0fd80000 0x180000>;
			no-map;

			qcom,client-id = <1>;
		};
	};

	smem {
		compatible = "qcom,smem";

		memory-region = <&smem_region>;
		qcom,rpm-msg-ram = <&rpm_msg_ram>;

		hwlocks = <&tcsr_mutex 3>;
	};

	smp2p-adsp {
		compatible = "qcom,smp2p";
		qcom,smem = <443>, <429>;

		interrupt-parent = <&intc>;
		interrupts = <GIC_SPI 158 IRQ_TYPE_EDGE_RISING>;

		qcom,ipc = <&apcs 8 10>;

		qcom,local-pid = <0>;
		qcom,remote-pid = <2>;

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

		adsp_smp2p_in: slave-kernel {
			qcom,entry-name = "slave-kernel";

			interrupt-controller;
			#interrupt-cells = <2>;
		};
	};

	smp2p-modem {
		compatible = "qcom,smp2p";
		qcom,smem = <435>, <428>;

		interrupt-parent = <&intc>;
		interrupts = <GIC_SPI 27 IRQ_TYPE_EDGE_RISING>;

		qcom,ipc = <&apcs 8 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>;
		};
	};

	smp2p-wcnss {
		compatible = "qcom,smp2p";
		qcom,smem = <451>, <431>;

		interrupt-parent = <&intc>;
		interrupts = <GIC_SPI 143 IRQ_TYPE_EDGE_RISING>;

		qcom,ipc = <&apcs 8 18>;

		qcom,local-pid = <0>;
		qcom,remote-pid = <4>;

		wcnss_smp2p_out: master-kernel {
			qcom,entry-name = "master-kernel";

			#qcom,smem-state-cells = <1>;
		};

		wcnss_smp2p_in: slave-kernel {
			qcom,entry-name = "slave-kernel";

			interrupt-controller;
			#interrupt-cells = <2>;
		};
	};

	smsm {
		compatible = "qcom,smsm";

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

		qcom,ipc-1 = <&apcs 8 13>;
		qcom,ipc-2 = <&apcs 8 9>;
		qcom,ipc-3 = <&apcs 8 19>;

		apps_smsm: apps@0 {
			reg = <0>;

			#qcom,smem-state-cells = <1>;
		};

		modem_smsm: modem@1 {
			reg = <1>;
			interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>;

			interrupt-controller;
			#interrupt-cells = <2>;
		};

		adsp_smsm: adsp@2 {
			reg = <2>;
			interrupts = <GIC_SPI 157 IRQ_TYPE_EDGE_RISING>;

			interrupt-controller;
			#interrupt-cells = <2>;
		};

		wcnss_smsm: wcnss@7 {
			reg = <7>;
			interrupts = <GIC_SPI 144 IRQ_TYPE_EDGE_RISING>;

			interrupt-controller;
			#interrupt-cells = <2>;
		};
	};

	smd {
		compatible = "qcom,smd";

		rpm {
			interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>;
			qcom,ipc = <&apcs 8 0>;
			qcom,smd-edge = <15>;

			rpm_requests: rpm_requests {
				compatible = "qcom,rpm-msm8974";
				qcom,smd-channels = "rpm_requests";

				rpmcc: clock-controller {
					compatible = "qcom,rpmcc-msm8974", "qcom,rpmcc";
					#clock-cells = <1>;
				};
			};
		};
	};

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

		intc: interrupt-controller@f9000000 {
			compatible = "qcom,msm-qgic2";
			interrupt-controller;
			#interrupt-cells = <3>;
			reg = <0xf9000000 0x1000>,
			      <0xf9002000 0x1000>;
		};

		apcs: syscon@f9011000 {
			compatible = "syscon";
			reg = <0xf9011000 0x1000>;
		};

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

			frame@f9021000 {
				frame-number = <0>;
				interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
					     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
				reg = <0xf9021000 0x1000>,
				      <0xf9022000 0x1000>;
			};

			frame@f9023000 {
				frame-number = <1>;
				interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
				reg = <0xf9023000 0x1000>;
				status = "disabled";
			};

			frame@f9024000 {
				frame-number = <2>;
				interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
				reg = <0xf9024000 0x1000>;
				status = "disabled";
			};

			frame@f9025000 {
				frame-number = <3>;
				interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
				reg = <0xf9025000 0x1000>;
				status = "disabled";
			};

			frame@f9026000 {
				frame-number = <4>;
				interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
				reg = <0xf9026000 0x1000>;
				status = "disabled";
			};

			frame@f9027000 {
				frame-number = <5>;
				interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
				reg = <0xf9027000 0x1000>;
				status = "disabled";
			};

			frame@f9028000 {
				frame-number = <6>;
				interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
				reg = <0xf9028000 0x1000>;
				status = "disabled";
			};
		};

		saw0: power-controller@f9089000 {
			compatible = "qcom,msm8974-saw2-v2.1-cpu", "qcom,saw2";
			reg = <0xf9089000 0x1000>, <0xf9009000 0x1000>;
		};

		saw1: power-controller@f9099000 {
			compatible = "qcom,msm8974-saw2-v2.1-cpu", "qcom,saw2";
			reg = <0xf9099000 0x1000>, <0xf9009000 0x1000>;
		};

		saw2: power-controller@f90a9000 {
			compatible = "qcom,msm8974-saw2-v2.1-cpu", "qcom,saw2";
			reg = <0xf90a9000 0x1000>, <0xf9009000 0x1000>;
		};

		saw3: power-controller@f90b9000 {
			compatible = "qcom,msm8974-saw2-v2.1-cpu", "qcom,saw2";
			reg = <0xf90b9000 0x1000>, <0xf9009000 0x1000>;
		};

		saw_l2: power-controller@f9012000 {
			compatible = "qcom,saw2";
			reg = <0xf9012000 0x1000>;
			regulator;
		};

		acc0: clock-controller@f9088000 {
			compatible = "qcom,kpss-acc-v2";
			reg = <0xf9088000 0x1000>, <0xf9008000 0x1000>;
		};

		acc1: clock-controller@f9098000 {
			compatible = "qcom,kpss-acc-v2";
			reg = <0xf9098000 0x1000>, <0xf9008000 0x1000>;
		};

		acc2: clock-controller@f90a8000 {
			compatible = "qcom,kpss-acc-v2";
			reg = <0xf90a8000 0x1000>, <0xf9008000 0x1000>;
		};

		acc3: clock-controller@f90b8000 {
			compatible = "qcom,kpss-acc-v2";
			reg = <0xf90b8000 0x1000>, <0xf9008000 0x1000>;
		};

		sdhc_1: mmc@f9824900 {
			compatible = "qcom,msm8974-sdhci", "qcom,sdhci-msm-v4";
			reg = <0xf9824900 0x11c>, <0xf9824000 0x800>;
			reg-names = "hc", "core";
			interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "hc_irq", "pwr_irq";
			clocks = <&gcc GCC_SDCC1_AHB_CLK>,
				 <&gcc GCC_SDCC1_APPS_CLK>,
				 <&xo_board>;
			clock-names = "iface", "core", "xo";
			bus-width = <8>;
			non-removable;

			status = "disabled";
		};

		sdhc_3: mmc@f9864900 {
			compatible = "qcom,msm8974-sdhci", "qcom,sdhci-msm-v4";
			reg = <0xf9864900 0x11c>, <0xf9864000 0x800>;
			reg-names = "hc", "core";
			interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "hc_irq", "pwr_irq";
			clocks = <&gcc GCC_SDCC3_AHB_CLK>,
				 <&gcc GCC_SDCC3_APPS_CLK>,
				 <&xo_board>;
			clock-names = "iface", "core", "xo";
			bus-width = <4>;

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

			status = "disabled";
		};

		sdhc_2: mmc@f98a4900 {
			compatible = "qcom,msm8974-sdhci", "qcom,sdhci-msm-v4";
			reg = <0xf98a4900 0x11c>, <0xf98a4000 0x800>;
			reg-names = "hc", "core";
			interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
				     <GIC_SPI 221 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "hc_irq", "pwr_irq";
			clocks = <&gcc GCC_SDCC2_AHB_CLK>,
				 <&gcc GCC_SDCC2_APPS_CLK>,
				 <&xo_board>;
			clock-names = "iface", "core", "xo";
			bus-width = <4>;

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

			status = "disabled";
		};

		blsp1_uart1: serial@f991d000 {
			compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
			reg = <0xf991d000 0x1000>;
			interrupts = <GIC_SPI 107 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP1_UART1_APPS_CLK>, <&gcc GCC_BLSP1_AHB_CLK>;
			clock-names = "core", "iface";
			status = "disabled";
		};

		blsp1_uart2: serial@f991e000 {
			compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
			reg = <0xf991e000 0x1000>;
			interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP1_UART2_APPS_CLK>, <&gcc GCC_BLSP1_AHB_CLK>;
			clock-names = "core", "iface";
			pinctrl-names = "default";
			pinctrl-0 = <&blsp1_uart2_default>;
			status = "disabled";
		};

		blsp1_i2c1: i2c@f9923000 {
			status = "disabled";
			compatible = "qcom,i2c-qup-v2.1.1";
			reg = <0xf9923000 0x1000>;
			interrupts = <0 95 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP1_QUP1_I2C_APPS_CLK>, <&gcc GCC_BLSP1_AHB_CLK>;
			clock-names = "core", "iface";
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&blsp1_i2c1_default>;
			pinctrl-1 = <&blsp1_i2c1_sleep>;
			#address-cells = <1>;
			#size-cells = <0>;
		};

		blsp1_i2c2: i2c@f9924000 {
			status = "disabled";
			compatible = "qcom,i2c-qup-v2.1.1";
			reg = <0xf9924000 0x1000>;
			interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP1_QUP2_I2C_APPS_CLK>, <&gcc GCC_BLSP1_AHB_CLK>;
			clock-names = "core", "iface";
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&blsp1_i2c2_default>;
			pinctrl-1 = <&blsp1_i2c2_sleep>;
			#address-cells = <1>;
			#size-cells = <0>;
		};

		blsp1_i2c3: i2c@f9925000 {
			status = "disabled";
			compatible = "qcom,i2c-qup-v2.1.1";
			reg = <0xf9925000 0x1000>;
			interrupts = <0 97 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP1_QUP3_I2C_APPS_CLK>, <&gcc GCC_BLSP1_AHB_CLK>;
			clock-names = "core", "iface";
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&blsp1_i2c3_default>;
			pinctrl-1 = <&blsp1_i2c3_sleep>;
			#address-cells = <1>;
			#size-cells = <0>;
		};

		blsp1_i2c6: i2c@f9928000 {
			status = "disabled";
			compatible = "qcom,i2c-qup-v2.1.1";
			reg = <0xf9928000 0x1000>;
			interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP1_QUP6_I2C_APPS_CLK>, <&gcc GCC_BLSP1_AHB_CLK>;
			clock-names = "core", "iface";
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&blsp1_i2c6_default>;
			pinctrl-1 = <&blsp1_i2c6_sleep>;
			#address-cells = <1>;
			#size-cells = <0>;
		};

		blsp2_dma: dma-controller@f9944000 {
			compatible = "qcom,bam-v1.4.0";
			reg = <0xf9944000 0x19000>;
			interrupts = <GIC_SPI 239 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP2_AHB_CLK>;
			clock-names = "bam_clk";
			#dma-cells = <1>;
			qcom,ee = <0>;
		};

		blsp2_uart1: serial@f995d000 {
			compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
			reg = <0xf995d000 0x1000>;
			interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP2_UART1_APPS_CLK>, <&gcc GCC_BLSP2_AHB_CLK>;
			clock-names = "core", "iface";
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&blsp2_uart1_default>;
			pinctrl-1 = <&blsp2_uart1_sleep>;
			status = "disabled";
		};

		blsp2_uart2: serial@f995e000 {
			compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
			reg = <0xf995e000 0x1000>;
			interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP2_UART2_APPS_CLK>, <&gcc GCC_BLSP2_AHB_CLK>;
			clock-names = "core", "iface";
			status = "disabled";
		};

		blsp2_uart4: serial@f9960000 {
			compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
			reg = <0xf9960000 0x1000>;
			interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP2_UART4_APPS_CLK>, <&gcc GCC_BLSP2_AHB_CLK>;
			clock-names = "core", "iface";
			pinctrl-names = "default";
			pinctrl-0 = <&blsp2_uart4_default>;
			status = "disabled";
		};

		blsp2_i2c2: i2c@f9964000 {
			status = "disabled";
			compatible = "qcom,i2c-qup-v2.1.1";
			reg = <0xf9964000 0x1000>;
			interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP2_QUP2_I2C_APPS_CLK>, <&gcc GCC_BLSP2_AHB_CLK>;
			clock-names = "core", "iface";
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&blsp2_i2c2_default>;
			pinctrl-1 = <&blsp2_i2c2_sleep>;
			#address-cells = <1>;
			#size-cells = <0>;
		};

		blsp2_i2c5: i2c@f9967000 {
			status = "disabled";
			compatible = "qcom,i2c-qup-v2.1.1";
			reg = <0xf9967000 0x1000>;
			interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP2_QUP5_I2C_APPS_CLK>, <&gcc GCC_BLSP2_AHB_CLK>;
			clock-names = "core", "iface";
			dmas = <&blsp2_dma 20>, <&blsp2_dma 21>;
			dma-names = "tx", "rx";
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&blsp2_i2c5_default>;
			pinctrl-1 = <&blsp2_i2c5_sleep>;
			#address-cells = <1>;
			#size-cells = <0>;
		};

		blsp2_i2c6: i2c@f9968000 {
			status = "disabled";
			compatible = "qcom,i2c-qup-v2.1.1";
			reg = <0xf9968000 0x1000>;
			interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP2_QUP6_I2C_APPS_CLK>, <&gcc GCC_BLSP2_AHB_CLK>;
			clock-names = "core", "iface";
			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&blsp2_i2c6_default>;
			pinctrl-1 = <&blsp2_i2c6_sleep>;
			#address-cells = <1>;
			#size-cells = <0>;
		};

		usb: usb@f9a55000 {
			compatible = "qcom,ci-hdrc";
			reg = <0xf9a55000 0x200>,
			      <0xf9a55200 0x200>;
			interrupts = <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_USB_HS_AHB_CLK>,
				 <&gcc GCC_USB_HS_SYSTEM_CLK>;
			clock-names = "iface", "core";
			assigned-clocks = <&gcc GCC_USB_HS_SYSTEM_CLK>;
			assigned-clock-rates = <75000000>;
			resets = <&gcc GCC_USB_HS_BCR>;
			reset-names = "core";
			phy_type = "ulpi";
			dr_mode = "otg";
			ahb-burst-config = <0>;
			phy-names = "usb-phy";
			status = "disabled";
			#reset-cells = <1>;

			ulpi {
				usb_hs1_phy: phy@a {
					compatible = "qcom,usb-hs-phy-msm8974",
						     "qcom,usb-hs-phy";
					#phy-cells = <0>;
					clocks = <&xo_board>, <&gcc GCC_USB2A_PHY_SLEEP_CLK>;
					clock-names = "ref", "sleep";
					resets = <&gcc GCC_USB2A_PHY_BCR>, <&usb 0>;
					reset-names = "phy", "por";
					status = "disabled";
				};

				usb_hs2_phy: phy@b {
					compatible = "qcom,usb-hs-phy-msm8974",
						     "qcom,usb-hs-phy";
					#phy-cells = <0>;
					clocks = <&xo_board>, <&gcc GCC_USB2B_PHY_SLEEP_CLK>;
					clock-names = "ref", "sleep";
					resets = <&gcc GCC_USB2B_PHY_BCR>, <&usb 1>;
					reset-names = "phy", "por";
					status = "disabled";
				};
			};
		};

		rng@f9bff000 {
			compatible = "qcom,prng";
			reg = <0xf9bff000 0x200>;
			clocks = <&gcc GCC_PRNG_AHB_CLK>;
			clock-names = "core";
		};

		pronto: remoteproc@fb21b000 {
			compatible = "qcom,pronto-v2-pil", "qcom,pronto";
			reg = <0xfb204000 0x2000>, <0xfb202000 0x1000>, <0xfb21b000 0x3000>;
			reg-names = "ccu", "dxe", "pmu";

			memory-region = <&wcnss_region>;

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

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

			status = "disabled";

			iris {
				compatible = "qcom,wcn3680";

				clocks = <&rpmcc RPM_SMD_CXO_A2>;
				clock-names = "xo";
			};

			smd-edge {
				interrupts = <GIC_SPI 142 IRQ_TYPE_EDGE_RISING>;

				qcom,ipc = <&apcs 8 17>;
				qcom,smd-edge = <6>;

				wcnss {
					compatible = "qcom,wcnss";
					qcom,smd-channels = "WCNSS_CTRL";
					status = "disabled";

					qcom,mmio = <&pronto>;

					bt {
						compatible = "qcom,wcnss-bt";
					};

					wifi {
						compatible = "qcom,wcnss-wlan";

						interrupts = <GIC_SPI 145 IRQ_TYPE_EDGE_RISING>,
							     <GIC_SPI 146 IRQ_TYPE_EDGE_RISING>;
						interrupt-names = "tx", "rx";

						qcom,smem-states = <&apps_smsm 10>, <&apps_smsm 9>;
						qcom,smem-state-names = "tx-enable",
									"tx-rings-empty";
					};
				};
			};
		};

		sram@fc190000 {
			compatible = "qcom,msm8974-rpm-stats";
			reg = <0xfc190000 0x10000>;
		};

		etf@fc307000 {
			compatible = "arm,coresight-tmc", "arm,primecell";
			reg = <0xfc307000 0x1000>;

			clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
			clock-names = "apb_pclk", "atclk";

			out-ports {
				port {
					etf_out: endpoint {
						remote-endpoint = <&replicator_in>;
					};
				};
			};

			in-ports {
				port {
					etf_in: endpoint {
						remote-endpoint = <&merger_out>;
					};
				};
			};
		};

		tpiu@fc318000 {
			compatible = "arm,coresight-tpiu", "arm,primecell";
			reg = <0xfc318000 0x1000>;

			clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
			clock-names = "apb_pclk", "atclk";

			in-ports {
				port {
					tpiu_in: endpoint {
						remote-endpoint = <&replicator_out1>;
					};
				 };
			};
		};

		funnel@fc31a000 {
			compatible = "arm,coresight-dynamic-funnel", "arm,primecell";
			reg = <0xfc31a000 0x1000>;

			clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
			clock-names = "apb_pclk", "atclk";

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

				/*
				 * Not described input ports:
				 * 0 - not-connected
				 * 1 - connected trought funnel to Multimedia CPU
				 * 2 - connected to Wireless CPU
				 * 3 - not-connected
				 * 4 - not-connected
				 * 6 - not-connected
				 * 7 - connected to STM
				 */
				port@5 {
					reg = <5>;
					funnel1_in5: endpoint {
						remote-endpoint = <&kpss_out>;
					};
				};
			};

			out-ports {
				port {
					funnel1_out: endpoint {
						remote-endpoint = <&merger_in1>;
					};
				};
			};
		};

		funnel@fc31b000 {
			compatible = "arm,coresight-dynamic-funnel", "arm,primecell";
			reg = <0xfc31b000 0x1000>;

			clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
			clock-names = "apb_pclk", "atclk";

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

				/*
				 * Not described input ports:
				 * 0 - connected trought funnel to Audio, Modem and
				 *     Resource and Power Manager CPU's
				 * 2...7 - not-connected
				 */
				port@1 {
					reg = <1>;
					merger_in1: endpoint {
						remote-endpoint = <&funnel1_out>;
					};
				};
			};

			out-ports {
				port {
					merger_out: endpoint {
						remote-endpoint = <&etf_in>;
					};
				};
			};
		};

		replicator@fc31c000 {
			compatible = "arm,coresight-dynamic-replicator", "arm,primecell";
			reg = <0xfc31c000 0x1000>;

			clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
			clock-names = "apb_pclk", "atclk";

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

				port@0 {
					reg = <0>;
					replicator_out0: endpoint {
						remote-endpoint = <&etr_in>;
					};
				};
				port@1 {
					reg = <1>;
					replicator_out1: endpoint {
						remote-endpoint = <&tpiu_in>;
					};
				};
			};

			in-ports {
				port {
					replicator_in: endpoint {
						remote-endpoint = <&etf_out>;
					};
				};
			};
		};

		etr@fc322000 {
			compatible = "arm,coresight-tmc", "arm,primecell";
			reg = <0xfc322000 0x1000>;

			clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
			clock-names = "apb_pclk", "atclk";

			in-ports {
				port {
					etr_in: endpoint {
						remote-endpoint = <&replicator_out0>;
					};
				};
			};
		};

		etm@fc33c000 {
			compatible = "arm,coresight-etm4x", "arm,primecell";
			reg = <0xfc33c000 0x1000>;

			clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
			clock-names = "apb_pclk", "atclk";

			cpu = <&CPU0>;

			out-ports {
				port {
					etm0_out: endpoint {
						remote-endpoint = <&kpss_in0>;
					};
				};
			};
		};

		etm@fc33d000 {
			compatible = "arm,coresight-etm4x", "arm,primecell";
			reg = <0xfc33d000 0x1000>;

			clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
			clock-names = "apb_pclk", "atclk";

			cpu = <&CPU1>;

			out-ports {
				port {
					etm1_out: endpoint {
						remote-endpoint = <&kpss_in1>;
					};
				};
			};
		};

		etm@fc33e000 {
			compatible = "arm,coresight-etm4x", "arm,primecell";
			reg = <0xfc33e000 0x1000>;

			clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
			clock-names = "apb_pclk", "atclk";

			cpu = <&CPU2>;

			out-ports {
				port {
					etm2_out: endpoint {
						remote-endpoint = <&kpss_in2>;
					};
				};
			};
		};

		etm@fc33f000 {
			compatible = "arm,coresight-etm4x", "arm,primecell";
			reg = <0xfc33f000 0x1000>;

			clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
			clock-names = "apb_pclk", "atclk";

			cpu = <&CPU3>;

			out-ports {
				port {
					etm3_out: endpoint {
						remote-endpoint = <&kpss_in3>;
					};
				};
			};
		};

		/* KPSS funnel, only 4 inputs are used */
		funnel@fc345000 {
			compatible = "arm,coresight-dynamic-funnel", "arm,primecell";
			reg = <0xfc345000 0x1000>;

			clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
			clock-names = "apb_pclk", "atclk";

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

				port@0 {
					reg = <0>;
					kpss_in0: endpoint {
						remote-endpoint = <&etm0_out>;
					};
				};
				port@1 {
					reg = <1>;
					kpss_in1: endpoint {
						remote-endpoint = <&etm1_out>;
					};
				};
				port@2 {
					reg = <2>;
					kpss_in2: endpoint {
						remote-endpoint = <&etm2_out>;
					};
				};
				port@3 {
					reg = <3>;
					kpss_in3: endpoint {
						remote-endpoint = <&etm3_out>;
					};
				};
			};

			out-ports {
				port {
					kpss_out: endpoint {
						remote-endpoint = <&funnel1_in5>;
					};
				};
			};
		};

		gcc: clock-controller@fc400000 {
			compatible = "qcom,gcc-msm8974";
			#clock-cells = <1>;
			#reset-cells = <1>;
			#power-domain-cells = <1>;
			reg = <0xfc400000 0x4000>;
		};

		rpm_msg_ram: sram@fc428000 {
			compatible = "qcom,rpm-msg-ram";
			reg = <0xfc428000 0x4000>;
		};

		bimc: interconnect@fc380000 {
			reg = <0xfc380000 0x6a000>;
			compatible = "qcom,msm8974-bimc";
			#interconnect-cells = <1>;
			clock-names = "bus", "bus_a";
			clocks = <&rpmcc RPM_SMD_BIMC_CLK>,
			         <&rpmcc RPM_SMD_BIMC_A_CLK>;
		};

		snoc: interconnect@fc460000 {
			reg = <0xfc460000 0x4000>;
			compatible = "qcom,msm8974-snoc";
			#interconnect-cells = <1>;
			clock-names = "bus", "bus_a";
			clocks = <&rpmcc RPM_SMD_SNOC_CLK>,
			         <&rpmcc RPM_SMD_SNOC_A_CLK>;
		};

		pnoc: interconnect@fc468000 {
			reg = <0xfc468000 0x4000>;
			compatible = "qcom,msm8974-pnoc";
			#interconnect-cells = <1>;
			clock-names = "bus", "bus_a";
			clocks = <&rpmcc RPM_SMD_PNOC_CLK>,
			         <&rpmcc RPM_SMD_PNOC_A_CLK>;
		};

		ocmemnoc: interconnect@fc470000 {
			reg = <0xfc470000 0x4000>;
			compatible = "qcom,msm8974-ocmemnoc";
			#interconnect-cells = <1>;
			clock-names = "bus", "bus_a";
			clocks = <&rpmcc RPM_SMD_OCMEMGX_CLK>,
			         <&rpmcc RPM_SMD_OCMEMGX_A_CLK>;
		};

		mmssnoc: interconnect@fc478000 {
			reg = <0xfc478000 0x4000>;
			compatible = "qcom,msm8974-mmssnoc";
			#interconnect-cells = <1>;
			clock-names = "bus", "bus_a";
			clocks = <&mmcc MMSS_S0_AXI_CLK>,
			         <&mmcc MMSS_S0_AXI_CLK>;
		};

		cnoc: interconnect@fc480000 {
			reg = <0xfc480000 0x4000>;
			compatible = "qcom,msm8974-cnoc";
			#interconnect-cells = <1>;
			clock-names = "bus", "bus_a";
			clocks = <&rpmcc RPM_SMD_CNOC_CLK>,
			         <&rpmcc RPM_SMD_CNOC_A_CLK>;
		};

		tsens: thermal-sensor@fc4a9000 {
			compatible = "qcom,msm8974-tsens", "qcom,tsens-v0_1";
			reg = <0xfc4a9000 0x1000>, /* TM */
			      <0xfc4a8000 0x1000>; /* SROT */
			nvmem-cells = <&tsens_calib>, <&tsens_backup>;
			nvmem-cell-names = "calib", "calib_backup";
			#qcom,sensors = <11>;
			interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "uplow";
			#thermal-sensor-cells = <1>;
		};

		restart@fc4ab000 {
			compatible = "qcom,pshold";
			reg = <0xfc4ab000 0x4>;
		};

		qfprom: qfprom@fc4bc000 {
			compatible = "qcom,msm8974-qfprom", "qcom,qfprom";
			reg = <0xfc4bc000 0x1000>;
			#address-cells = <1>;
			#size-cells = <1>;
			tsens_calib: calib@d0 {
				reg = <0xd0 0x18>;
			};
			tsens_backup: backup@440 {
				reg = <0x440 0x10>;
			};
		};

		spmi_bus: spmi@fc4cf000 {
			compatible = "qcom,spmi-pmic-arb";
			reg-names = "core", "intr", "cnfg";
			reg = <0xfc4cf000 0x1000>,
			      <0xfc4cb000 0x1000>,
			      <0xfc4ca000 0x1000>;
			interrupt-names = "periph_irq";
			interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>;
			qcom,ee = <0>;
			qcom,channel = <0>;
			#address-cells = <2>;
			#size-cells = <0>;
			interrupt-controller;
			#interrupt-cells = <4>;
		};

		bam_dmux_dma: dma-controller@fc834000 {
			compatible = "qcom,bam-v1.4.0";
			reg = <0xfc834000 0x7000>;
			interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
			#dma-cells = <1>;
			qcom,ee = <0>;

			num-channels = <6>;
			qcom,num-ees = <1>;
			qcom,powered-remotely;
		};

		remoteproc_mss: remoteproc@fc880000 {
			compatible = "qcom,msm8974-mss-pil";
			reg = <0xfc880000 0x100>, <0xfc820000 0x020>;
			reg-names = "qdsp6", "rmb";

			interrupts-extended = <&intc GIC_SPI 24 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>;
			interrupt-names = "wdog", "fatal", "ready", "handover", "stop-ack";

			clocks = <&gcc GCC_MSS_Q6_BIMC_AXI_CLK>,
				 <&gcc GCC_MSS_CFG_AHB_CLK>,
				 <&gcc GCC_BOOT_ROM_AHB_CLK>,
				 <&xo_board>;
			clock-names = "iface", "bus", "mem", "xo";

			resets = <&gcc GCC_MSS_RESTART>;
			reset-names = "mss_restart";

			qcom,halt-regs = <&tcsr_mutex 0x1180 0x1200 0x1280>;

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

			status = "disabled";

			mba {
				memory-region = <&mba_region>;
			};

			mpss {
				memory-region = <&mpss_region>;
			};

			bam_dmux: bam-dmux {
				compatible = "qcom,bam-dmux";

				interrupt-parent = <&modem_smsm>;
				interrupts = <1 IRQ_TYPE_EDGE_BOTH>, <11 IRQ_TYPE_EDGE_BOTH>;
				interrupt-names = "pc", "pc-ack";

				qcom,smem-states = <&apps_smsm 1>, <&apps_smsm 11>;
				qcom,smem-state-names = "pc", "pc-ack";

				dmas = <&bam_dmux_dma 4>, <&bam_dmux_dma 5>;
				dma-names = "tx", "rx";
			};

			smd-edge {
				interrupts = <GIC_SPI 25 IRQ_TYPE_EDGE_RISING>;

				qcom,ipc = <&apcs 8 12>;
				qcom,smd-edge = <0>;

				label = "modem";
			};
		};

		tcsr_mutex: hwlock@fd484000 {
			compatible = "qcom,msm8974-tcsr-mutex", "qcom,tcsr-mutex", "syscon";
			reg = <0xfd484000 0x2000>;
			#hwlock-cells = <1>;
		};

		tcsr: syscon@fd4a0000 {
			compatible = "qcom,tcsr-msm8974", "syscon";
			reg = <0xfd4a0000 0x10000>;
		};

		tlmm: pinctrl@fd510000 {
			compatible = "qcom,msm8974-pinctrl";
			reg = <0xfd510000 0x4000>;
			gpio-controller;
			gpio-ranges = <&tlmm 0 0 146>;
			#gpio-cells = <2>;
			interrupt-controller;
			#interrupt-cells = <2>;
			interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;

			sdc1_off: sdc1-off-state {
				clk-pins {
					pins = "sdc1_clk";
					bias-disable;
					drive-strength = <2>;
				};

				cmd-pins {
					pins = "sdc1_cmd";
					bias-pull-up;
					drive-strength = <2>;
				};

				data-pins {
					pins = "sdc1_data";
					bias-pull-up;
					drive-strength = <2>;
				};
			};

			sdc2_off: sdc2-off-state {
				clk-pins {
					pins = "sdc2_clk";
					bias-disable;
					drive-strength = <2>;
				};

				cmd-pins {
					pins = "sdc2_cmd";
					bias-pull-up;
					drive-strength = <2>;
				};

				data-pins {
					pins = "sdc2_data";
					bias-pull-up;
					drive-strength = <2>;
				};

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

			blsp1_uart2_default: blsp1-uart2-default-state {
				rx-pins {
					pins = "gpio5";
					function = "blsp_uart2";
					drive-strength = <2>;
					bias-pull-up;
				};

				tx-pins {
					pins = "gpio4";
					function = "blsp_uart2";
					drive-strength = <4>;
					bias-disable;
				};
			};

			blsp2_uart1_default: blsp2-uart1-default-state {
				tx-rts-pins {
					pins = "gpio41", "gpio44";
					function = "blsp_uart7";
					drive-strength = <2>;
					bias-disable;
				};

				rx-cts-pins {
					pins = "gpio42", "gpio43";
					function = "blsp_uart7";
					drive-strength = <2>;
					bias-pull-up;
				};
			};

			blsp2_uart1_sleep: blsp2-uart1-sleep-state {
				pins = "gpio41", "gpio42", "gpio43", "gpio44";
				function = "gpio";
				drive-strength = <2>;
				bias-pull-down;
			};

			blsp2_uart4_default: blsp2-uart4-default-state {
				tx-rts-pins {
					pins = "gpio53", "gpio56";
					function = "blsp_uart10";
					drive-strength = <2>;
					bias-disable;
				};

				rx-cts-pins {
					pins = "gpio54", "gpio55";
					function = "blsp_uart10";
					drive-strength = <2>;
					bias-pull-up;
				};
			};

			blsp1_i2c1_default: blsp1-i2c1-default-state {
				pins = "gpio2", "gpio3";
				function = "blsp_i2c1";
				drive-strength = <2>;
				bias-disable;
			};

			blsp1_i2c1_sleep: blsp1-i2c1-sleep-state {
				pins = "gpio2", "gpio3";
				function = "blsp_i2c1";
				drive-strength = <2>;
				bias-pull-up;
			};

			blsp1_i2c2_default: blsp1-i2c2-default-state {
				pins = "gpio6", "gpio7";
				function = "blsp_i2c2";
				drive-strength = <2>;
				bias-disable;
			};

			blsp1_i2c2_sleep: blsp1-i2c2-sleep-state {
				pins = "gpio6", "gpio7";
				function = "blsp_i2c2";
				drive-strength = <2>;
				bias-pull-up;
			};

			blsp1_i2c3_default: blsp1-i2c3-default-state {
				pins = "gpio10", "gpio11";
				function = "blsp_i2c3";
				drive-strength = <2>;
				bias-disable;
			};

			blsp1_i2c3_sleep: blsp1-i2c3-sleep-state {
				pins = "gpio10", "gpio11";
				function = "blsp_i2c3";
				drive-strength = <2>;
				bias-pull-up;
			};

			/* BLSP1_I2C4 info is missing */

			/* BLSP1_I2C5 info is missing */

			blsp1_i2c6_default: blsp1-i2c6-default-state {
				pins = "gpio29", "gpio30";
				function = "blsp_i2c6";
				drive-strength = <2>;
				bias-disable;
			};

			blsp1_i2c6_sleep: blsp1-i2c6-sleep-state {
				pins = "gpio29", "gpio30";
				function = "blsp_i2c6";
				drive-strength = <2>;
				bias-pull-up;
			};
			/* 6 interfaces per QUP, BLSP2 indexes are numbered (n)+6 */

			/* BLSP2_I2C1 info is missing */

			blsp2_i2c2_default: blsp2-i2c2-default-state {
				pins = "gpio47", "gpio48";
				function = "blsp_i2c8";
				drive-strength = <2>;
				bias-disable;
			};

			blsp2_i2c2_sleep: blsp2-i2c2-sleep-state {
				pins = "gpio47", "gpio48";
				function = "blsp_i2c8";
				drive-strength = <2>;
				bias-pull-up;
			};

			/* BLSP2_I2C3 info is missing */

			/* BLSP2_I2C4 info is missing */

			blsp2_i2c5_default: blsp2-i2c5-default-state {
				pins = "gpio83", "gpio84";
				function = "blsp_i2c11";
				drive-strength = <2>;
				bias-disable;
			};

			blsp2_i2c5_sleep: blsp2-i2c5-sleep-state {
				pins = "gpio83", "gpio84";
				function = "blsp_i2c11";
				drive-strength = <2>;
				bias-pull-up;
			};

			blsp2_i2c6_default: blsp2-i2c6-default-state {
				pins = "gpio87", "gpio88";
				function = "blsp_i2c12";
				drive-strength = <2>;
				bias-disable;
			};

			blsp2_i2c6_sleep: blsp2-i2c6-sleep-state {
				pins = "gpio87", "gpio88";
				function = "blsp_i2c12";
				drive-strength = <2>;
				bias-pull-up;
			};

			cci_default: cci-default-state {
				cci_i2c0_default: cci-i2c0-default-pins {
					pins = "gpio19", "gpio20";
					function = "cci_i2c0";
					drive-strength = <2>;
					bias-disable;
				};

				cci_i2c1_default: cci-i2c1-default-pins {
					pins = "gpio21", "gpio22";
					function = "cci_i2c1";
					drive-strength = <2>;
					bias-disable;
				};
			};

			cci_sleep: cci-sleep-state {
				cci_i2c0_sleep: cci-i2c0-sleep-pins {
					pins = "gpio19", "gpio20";
					function = "gpio";
					drive-strength = <2>;
					bias-disable;
				};

				cci_i2c1_sleep: cci-i2c1-sleep-pins {
					pins = "gpio21", "gpio22";
					function = "gpio";
					drive-strength = <2>;
					bias-disable;
				};
			};

			spi8_default: spi8_default-state {
				mosi-pins {
					pins = "gpio45";
					function = "blsp_spi8";
				};
				miso-pins {
					pins = "gpio46";
					function = "blsp_spi8";
				};
				cs-pins {
					pins = "gpio47";
					function = "blsp_spi8";
				};
				clk-pins {
					pins = "gpio48";
					function = "blsp_spi8";
				};
			};
		};

		mmcc: clock-controller@fd8c0000 {
			compatible = "qcom,mmcc-msm8974";
			#clock-cells = <1>;
			#reset-cells = <1>;
			#power-domain-cells = <1>;
			reg = <0xfd8c0000 0x6000>;
		};

		mdss: mdss@fd900000 {
			compatible = "qcom,mdss";
			reg = <0xfd900000 0x100>, <0xfd924000 0x1000>;
			reg-names = "mdss_phys", "vbif_phys";

			power-domains = <&mmcc MDSS_GDSC>;

			clocks = <&mmcc MDSS_AHB_CLK>,
				 <&mmcc MDSS_AXI_CLK>,
				 <&mmcc MDSS_VSYNC_CLK>;
			clock-names = "iface", "bus", "vsync";

			interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;

			interrupt-controller;
			#interrupt-cells = <1>;

			status = "disabled";

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

			mdp: mdp@fd900000 {
				compatible = "qcom,mdp5";
				reg = <0xfd900100 0x22000>;
				reg-names = "mdp_phys";

				interrupt-parent = <&mdss>;
				interrupts = <0>;

				clocks = <&mmcc MDSS_AHB_CLK>,
					 <&mmcc MDSS_AXI_CLK>,
					 <&mmcc MDSS_MDP_CLK>,
					 <&mmcc MDSS_VSYNC_CLK>;
				clock-names = "iface", "bus", "core", "vsync";

				interconnects = <&mmssnoc MNOC_MAS_MDP_PORT0 &bimc BIMC_SLV_EBI_CH0>;
				interconnect-names = "mdp0-mem";

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

					port@0 {
						reg = <0>;
						mdp5_intf1_out: endpoint {
							remote-endpoint = <&dsi0_in>;
						};
					};
				};
			};

			dsi0: dsi@fd922800 {
				compatible = "qcom,mdss-dsi-ctrl";
				reg = <0xfd922800 0x1f8>;
				reg-names = "dsi_ctrl";

				interrupt-parent = <&mdss>;
				interrupts = <4>;

				assigned-clocks = <&mmcc BYTE0_CLK_SRC>, <&mmcc PCLK0_CLK_SRC>;
				assigned-clock-parents = <&dsi0_phy 0>, <&dsi0_phy 1>;

				clocks = <&mmcc MDSS_MDP_CLK>,
					 <&mmcc MDSS_AHB_CLK>,
					 <&mmcc MDSS_AXI_CLK>,
					 <&mmcc MDSS_BYTE0_CLK>,
					 <&mmcc MDSS_PCLK0_CLK>,
					 <&mmcc MDSS_ESC0_CLK>,
					 <&mmcc MMSS_MISC_AHB_CLK>;
				clock-names = "mdp_core",
					      "iface",
					      "bus",
					      "byte",
					      "pixel",
					      "core",
					      "core_mmss";

				phys = <&dsi0_phy>;

				status = "disabled";

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

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

					port@0 {
						reg = <0>;
						dsi0_in: endpoint {
							remote-endpoint = <&mdp5_intf1_out>;
						};
					};

					port@1 {
						reg = <1>;
						dsi0_out: endpoint {
						};
					};
				};
			};

			dsi0_phy: phy@fd922a00 {
				compatible = "qcom,dsi-phy-28nm-hpm";
				reg = <0xfd922a00 0xd4>,
				      <0xfd922b00 0x280>,
				      <0xfd922d80 0x30>;
				reg-names = "dsi_pll",
					    "dsi_phy",
					    "dsi_phy_regulator";

				#clock-cells = <1>;
				#phy-cells = <0>;

				clocks = <&mmcc MDSS_AHB_CLK>, <&xo_board>;
				clock-names = "iface", "ref";

				status = "disabled";
			};
		};

		cci: cci@fda0c000 {
			compatible = "qcom,msm8974-cci";
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0xfda0c000 0x1000>;
			interrupts = <GIC_SPI 50 IRQ_TYPE_EDGE_RISING>;
			clocks = <&mmcc CAMSS_TOP_AHB_CLK>,
				 <&mmcc CAMSS_CCI_CCI_AHB_CLK>,
				 <&mmcc CAMSS_CCI_CCI_CLK>;
			clock-names = "camss_top_ahb",
				      "cci_ahb",
				      "cci";

			pinctrl-names = "default", "sleep";
			pinctrl-0 = <&cci_default>;
			pinctrl-1 = <&cci_sleep>;

			status = "disabled";

			cci_i2c0: i2c-bus@0 {
				reg = <0>;
				clock-frequency = <100000>;
				#address-cells = <1>;
				#size-cells = <0>;
			};

			cci_i2c1: i2c-bus@1 {
				reg = <1>;
				clock-frequency = <100000>;
				#address-cells = <1>;
				#size-cells = <0>;
			};
		};

		gpu: adreno@fdb00000 {
			compatible = "qcom,adreno-330.1", "qcom,adreno";
			reg = <0xfdb00000 0x10000>;
			reg-names = "kgsl_3d0_reg_memory";

			interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "kgsl_3d0_irq";

			clocks = <&mmcc OXILI_GFX3D_CLK>,
				 <&mmcc OXILICX_AHB_CLK>,
				 <&mmcc OXILICX_AXI_CLK>;
			clock-names = "core", "iface", "mem_iface";

			sram = <&gmu_sram>;
			power-domains = <&mmcc OXILICX_GDSC>;
			operating-points-v2 = <&gpu_opp_table>;

			interconnects = <&mmssnoc MNOC_MAS_GRAPHICS_3D &bimc BIMC_SLV_EBI_CH0>,
					<&ocmemnoc OCMEM_VNOC_MAS_GFX3D &ocmemnoc OCMEM_SLV_OCMEM>;
			interconnect-names = "gfx-mem", "ocmem";

			// iommus = <&gpu_iommu 0>;

			status = "disabled";

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

				opp-320000000 {
					opp-hz = /bits/ 64 <320000000>;
				};

				opp-200000000 {
					opp-hz = /bits/ 64 <200000000>;
				};

				opp-27000000 {
					opp-hz = /bits/ 64 <27000000>;
				};
			};
		};

		sram@fdd00000 {
			compatible = "qcom,msm8974-ocmem";
			reg = <0xfdd00000 0x2000>,
			      <0xfec00000 0x180000>;
			reg-names = "ctrl", "mem";
			ranges = <0 0xfec00000 0x180000>;
			clocks = <&rpmcc RPM_SMD_OCMEMGX_CLK>,
				 <&mmcc OCMEMCX_OCMEMNOC_CLK>;
			clock-names = "core", "iface";

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

			gmu_sram: gmu-sram@0 {
				reg = <0x0 0x100000>;
			};
		};

		remoteproc_adsp: remoteproc@fe200000 {
			compatible = "qcom,msm8974-adsp-pil";
			reg = <0xfe200000 0x100>;

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

			clocks = <&xo_board>;
			clock-names = "xo";

			memory-region = <&adsp_region>;

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

			status = "disabled";

			smd-edge {
				interrupts = <GIC_SPI 156 IRQ_TYPE_EDGE_RISING>;

				qcom,ipc = <&apcs 8 8>;
				qcom,smd-edge = <1>;
				label = "lpass";
			};
		};

		imem: sram@fe805000 {
			compatible = "qcom,msm8974-imem", "syscon", "simple-mfd";
			reg = <0xfe805000 0x1000>;

			reboot-mode {
				compatible = "syscon-reboot-mode";
				offset = <0x65c>;
			};
		};
	};

	thermal-zones {
		cpu0-thermal {
			polling-delay-passive = <250>;
			polling-delay = <1000>;

			thermal-sensors = <&tsens 5>;

			trips {
				cpu_alert0: trip0 {
					temperature = <75000>;
					hysteresis = <2000>;
					type = "passive";
				};
				cpu_crit0: trip1 {
					temperature = <110000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};
		};

		cpu1-thermal {
			polling-delay-passive = <250>;
			polling-delay = <1000>;

			thermal-sensors = <&tsens 6>;

			trips {
				cpu_alert1: trip0 {
					temperature = <75000>;
					hysteresis = <2000>;
					type = "passive";
				};
				cpu_crit1: trip1 {
					temperature = <110000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};
		};

		cpu2-thermal {
			polling-delay-passive = <250>;
			polling-delay = <1000>;

			thermal-sensors = <&tsens 7>;

			trips {
				cpu_alert2: trip0 {
					temperature = <75000>;
					hysteresis = <2000>;
					type = "passive";
				};
				cpu_crit2: trip1 {
					temperature = <110000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};
		};

		cpu3-thermal {
			polling-delay-passive = <250>;
			polling-delay = <1000>;

			thermal-sensors = <&tsens 8>;

			trips {
				cpu_alert3: trip0 {
					temperature = <75000>;
					hysteresis = <2000>;
					type = "passive";
				};
				cpu_crit3: trip1 {
					temperature = <110000>;
					hysteresis = <2000>;
					type = "critical";
				};
			};
		};

		q6-dsp-thermal {
			polling-delay-passive = <250>;
			polling-delay = <1000>;

			thermal-sensors = <&tsens 1>;

			trips {
				q6_dsp_alert0: trip-point0 {
					temperature = <90000>;
					hysteresis = <2000>;
					type = "hot";
				};
			};
		};

		modemtx-thermal {
			polling-delay-passive = <250>;
			polling-delay = <1000>;

			thermal-sensors = <&tsens 2>;

			trips {
				modemtx_alert0: trip-point0 {
					temperature = <90000>;
					hysteresis = <2000>;
					type = "hot";
				};
			};
		};

		video-thermal {
			polling-delay-passive = <250>;
			polling-delay = <1000>;

			thermal-sensors = <&tsens 3>;

			trips {
				video_alert0: trip-point0 {
					temperature = <95000>;
					hysteresis = <2000>;
					type = "hot";
				};
			};
		};

		wlan-thermal {
			polling-delay-passive = <250>;
			polling-delay = <1000>;

			thermal-sensors = <&tsens 4>;

			trips {
				wlan_alert0: trip-point0 {
					temperature = <105000>;
					hysteresis = <2000>;
					type = "hot";
				};
			};
		};

		gpu-top-thermal {
			polling-delay-passive = <250>;
			polling-delay = <1000>;

			thermal-sensors = <&tsens 9>;

			trips {
				gpu1_alert0: trip-point0 {
					temperature = <90000>;
					hysteresis = <2000>;
					type = "hot";
				};
			};
		};

		gpu-bottom-thermal {
			polling-delay-passive = <250>;
			polling-delay = <1000>;

			thermal-sensors = <&tsens 10>;

			trips {
				gpu2_alert0: trip-point0 {
					temperature = <90000>;
					hysteresis = <2000>;
					type = "hot";
				};
			};
		};
	};

	timer {
		compatible = "arm,armv7-timer";
		interrupts = <GIC_PPI 2 0xf08>,
			     <GIC_PPI 3 0xf08>,
			     <GIC_PPI 4 0xf08>,
			     <GIC_PPI 1 0xf08>;
		clock-frequency = <19200000>;
	};

	vreg_boost: vreg-boost {
		compatible = "regulator-fixed";

		regulator-name = "vreg-boost";
		regulator-min-microvolt = <3150000>;
		regulator-max-microvolt = <3150000>;

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

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

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

	vreg_vph_pwr: vreg-vph-pwr {
		compatible = "regulator-fixed";
		regulator-name = "vph-pwr";

		regulator-min-microvolt = <3600000>;
		regulator-max-microvolt = <3600000>;

		regulator-always-on;
	};
};


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 = "Fairphone 2";
	compatible = "fairphone,fp2", "qcom,msm8974pro", "qcom,msm8974";
	chassis-type = "handset";

	aliases {
		mmc0 = &sdhc_1;
		mmc1 = &sdhc_2;
		serial0 = &blsp1_uart2;
	};

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

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

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

		key-camera-snapshot {
			label = "camera_snapshot";
			gpios = <&pm8941_gpios 1 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_CAMERA>;
			wakeup-source;
			debounce-interval = <15>;
		};

		key-volume-down {
			label = "volume_down";
			gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEDOWN>;
			wakeup-source;
			debounce-interval = <15>;
		};

		key-volume-up {
			label = "volume_up";
			gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEUP>;
			wakeup-source;
			debounce-interval = <15>;
		};
	};

	vibrator {
		compatible = "gpio-vibrator";
		enable-gpios = <&tlmm 86 GPIO_ACTIVE_HIGH>;
		vcc-supply = <&pm8941_l18>;
	};
};

&blsp1_i2c2 {
	status = "okay";

	touchscreen@41 {
		compatible = "ilitek,ili2120";
		reg = <0x41>;
		interrupt-parent = <&tlmm>;
		interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
		reset-gpios = <&tlmm 55 GPIO_ACTIVE_LOW>;

		touchscreen-size-x = <1080>;
		touchscreen-size-y = <1920>;
	};
};

&blsp1_uart2 {
	status = "okay";
};

&imem {
	reboot-mode {
		mode-normal = <0x77665501>;
		mode-bootloader = <0x77665500>;
		mode-recovery = <0x77665502>;
	};
};

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

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

&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@7 {
			reg = <7>;
			color = <LED_COLOR_ID_RED>;
		};

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

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

&pronto {
	status = "okay";

	vddmx-supply = <&pm8841_s1>;
	vddcx-supply = <&pm8841_s2>;
	vddpx-supply = <&pm8941_s3>;

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

	iris {
		vddxo-supply = <&pm8941_l6>;
		vddrfa-supply = <&pm8941_l11>;
		vddpa-supply = <&pm8941_l19>;
		vdddig-supply = <&pm8941_s3>;
	};

	smd-edge {
		qcom,remote-pid = <4>;
		label = "pronto";

		wcnss {
			status = "okay";
		};
	};
};

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

&remoteproc_mss {
	status = "okay";
	cx-supply = <&pm8841_s2>;
	mss-supply = <&pm8841_s3>;
	mx-supply = <&pm8841_s1>;
	pll-supply = <&pm8941_l12>;
};

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

		pm8841_s1: s1 {
			regulator-min-microvolt = <675000>;
			regulator-max-microvolt = <1050000>;
		};

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

		pm8841_s3: s3 {
			regulator-min-microvolt = <1050000>;
			regulator-max-microvolt = <1050000>;
		};
	};

	regulators-1 {
		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-always-on;
			regulator-boot-on;
		};

		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 = <1225000>;
			regulator-max-microvolt = <1225000>;
		};

		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_l10: l10 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
		};

		pm8941_l11: l11 {
			regulator-min-microvolt = <1225000>;
			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 = <2850000>;
			regulator-max-microvolt = <2850000>;
		};

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

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

		pm8941_l20: l20 {
			regulator-min-microvolt = <2950000>;
			regulator-max-microvolt = <2950000>;
			regulator-system-load = <200000>;
			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 = <3300000>;
		};

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

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

&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>;

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

&smbb {
	usb-charge-current-limit = <1500000>;
	qcom,fast-charge-safe-current = <1500000>;
	qcom,fast-charge-current-limit = <1500000>;
	qcom,fast-charge-safe-voltage = <4380000>;
	qcom,fast-charge-high-threshold-voltage = <4350000>;
	qcom,auto-recharge-threshold-voltage = <4240000>;
	qcom,minimum-input-voltage = <4450000>;
};

&tlmm {
	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 = <10>;
			bias-disable;
		};

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

	wcnss_pin_a: wcnss-pin-active-state {
		wlan-pins {
			pins =  "gpio36", "gpio37", "gpio38", "gpio39", "gpio40";
			function = "wlan";

			drive-strength = <6>;
			bias-pull-down;
		};

		bt-pins {
			pins = "gpio35", "gpio43", "gpio44";
			function = "bt";

			drive-strength = <2>;
			bias-pull-down;
		};

		fm-pins {
			pins = "gpio41", "gpio42";
			function = "fm";

			drive-strength = <2>;
			bias-pull-down;
		};
	};
};

&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>;
};


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/pinctrl/qcom,pmic-gpio.h>

/ {
	model = "OnePlus One";
	compatible = "oneplus,bacon", "qcom,msm8974pro", "qcom,msm8974";
	chassis-type = "handset";
	qcom,msm-id = <194 0x10000>;
	qcom,board-id = <8 0>;

	aliases {
		serial0 = &blsp1_uart2;
	};

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

&blsp1_i2c1 {
	status = "okay";

	fuel-gauge@55 {
		compatible = "ti,bq27541";
		reg = <0x55>;
		power-supplies = <&bq24196_charger>;
	};
};

&blsp1_i2c2 {
	status = "okay";

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

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

		interrupts-extended = <&tlmm 61 IRQ_TYPE_EDGE_FALLING>;
		vdd-supply = <&pm8941_l22>;
		vio-supply = <&pm8941_lvs3>;

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

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

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

		rmi4-f12@12 {
			reg = <0x12>;
			syna,sensor-type = <1>;
			/*
			 * Touchscreen size is 2040x1080, y-values between
			 * 1920-2040 are used for touchkey (menu, home & back).
			 * For now clip it off so we don't get touch events
			 * outside of the display area.
			 */
			syna,clip-y-high = <1920>;
		};
	};
};

&blsp1_i2c6 {
	status = "okay";

	bq24196_charger: charger@6b {
		compatible = "ti,bq24196";
		reg = <0x6b>;
		interrupts-extended = <&tlmm 31 IRQ_TYPE_EDGE_FALLING>;
		omit-battery-class;
	};
};

&blsp1_uart2 {
	status = "okay";
};

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

&pm8941_coincell {
	qcom,rset-ohms = <800>;
	qcom,vset-millivolts = <3200>;

	status = "okay";
};

&pronto {
	vddmx-supply = <&pm8841_s1>;
	vddcx-supply = <&pm8841_s2>;
	vddpx-supply = <&pm8941_s3>;

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

	status = "okay";

	iris {
		vddxo-supply = <&pm8941_l6>;
		vddrfa-supply = <&pm8941_l11>;
		vddpa-supply = <&pm8941_l19>;
		vdddig-supply = <&pm8941_s3>;
	};

	smd-edge {
		qcom,remote-pid = <4>;
		label = "pronto";

		wcnss {
			status = "okay";
		};
	};
};

&remoteproc_adsp {
	cx-supply = <&pm8841_s2>;

	status = "okay";
};

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

		pm8841_s1: s1 {
			regulator-min-microvolt = <675000>;
			regulator-max-microvolt = <1050000>;
		};

		pm8841_s2: s2 {
			regulator-min-microvolt = <875000>;
			regulator-max-microvolt = <1050000>;
			regulator-always-on;
		};

		pm8841_s3: s3 {
			regulator-min-microvolt = <1050000>;
			regulator-max-microvolt = <1050000>;
		};
	};

	regulators-1 {
		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_l8_l16_l18_l19-supply = <&vreg_vph_pwr>;
		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;
			regulator-allow-set-load;
		};

		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 = <1225000>;
			regulator-max-microvolt = <1225000>;
		};

		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_l10: l10 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
		};

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

		pm8941_l12: l12 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;

			regulator-always-on;
			regulator-boot-on;
			regulator-allow-set-load;
		};

		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 = <2850000>;
			regulator-max-microvolt = <2850000>;
		};

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

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

		pm8941_l20: l20 {
			regulator-min-microvolt = <2950000>;
			regulator-max-microvolt = <2950000>;

			regulator-system-load = <200000>;
			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>;
			regulator-allow-set-load;
		};

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

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

			regulator-boot-on;
		};

		pm8941_lvs3: lvs3 {};
	};
};

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

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

	status = "okay";
};

&tlmm {
	sdc1_on: sdc1-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;
		};
	};

	touch_default_state: touch-default-state {
		int-pins {
			pins = "gpio61";
			function = "gpio";
			drive-strength = <2>;
			bias-disable;
			input-enable;
		};

		reset-pins {
			pins = "gpio60";
			function = "gpio";
			drive-strength = <2>;
			bias-pull-up;
		};
	};

	wcnss_pin_a: wcnss-pin-active-state {
		wlan-pins {
			pins = "gpio36", "gpio37", "gpio38", "gpio39", "gpio40";
			function = "wlan";
			drive-strength = <6>;
			bias-pull-down;
		};

		bt-pins {
			pins = "gpio35", "gpio43", "gpio44";
			function = "bt";
			drive-strength = <2>;
			bias-pull-down;
		};
	};
};

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

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

	status = "okay";
};

&usb_hs1_phy {
	status = "okay";

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

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