code:
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017, The Linux Foundation. All rights reserved.
 */

#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/qcom,gcc-ipq8074.h>

/ {
	#address-cells = <2>;
	#size-cells = <2>;

	model = "Qualcomm Technologies, Inc. IPQ8074";
	compatible = "qcom,ipq8074";
	interrupt-parent = <&intc>;

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

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

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

		CPU0: cpu@0 {
			device_type = "cpu";
			compatible = "arm,cortex-a53";
			reg = <0x0>;
			next-level-cache = <&L2_0>;
			enable-method = "psci";
		};

		CPU1: cpu@1 {
			device_type = "cpu";
			compatible = "arm,cortex-a53";
			enable-method = "psci";
			reg = <0x1>;
			next-level-cache = <&L2_0>;
		};

		CPU2: cpu@2 {
			device_type = "cpu";
			compatible = "arm,cortex-a53";
			enable-method = "psci";
			reg = <0x2>;
			next-level-cache = <&L2_0>;
		};

		CPU3: cpu@3 {
			device_type = "cpu";
			compatible = "arm,cortex-a53";
			enable-method = "psci";
			reg = <0x3>;
			next-level-cache = <&L2_0>;
		};

		L2_0: l2-cache {
			compatible = "cache";
			cache-level = <0x2>;
		};
	};

	pmu {
		compatible = "arm,cortex-a53-pmu";
		interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
	};

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

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

		smem@4ab00000 {
			compatible = "qcom,smem";
			reg = <0x0 0x4ab00000 0x0 0x00100000>;
			no-map;

			hwlocks = <&tcsr_mutex 0>;
		};

		memory@4ac00000 {
			no-map;
			reg = <0x0 0x4ac00000 0x0 0x00400000>;
		};
	};

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

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

		ssphy_1: phy@58000 {
			compatible = "qcom,ipq8074-qmp-usb3-phy";
			reg = <0x00058000 0x1c4>;
			#address-cells = <1>;
			#size-cells = <1>;
			ranges;

			clocks = <&gcc GCC_USB1_AUX_CLK>,
				<&gcc GCC_USB1_PHY_CFG_AHB_CLK>,
				<&xo>;
			clock-names = "aux", "cfg_ahb", "ref";

			resets = <&gcc GCC_USB1_PHY_BCR>,
				<&gcc GCC_USB3PHY_1_PHY_BCR>;
			reset-names = "phy","common";
			status = "disabled";

			usb1_ssphy: phy@58200 {
				reg = <0x00058200 0x130>,     /* Tx */
				      <0x00058400 0x200>,     /* Rx */
				      <0x00058800 0x1f8>,     /* PCS */
				      <0x00058600 0x044>;     /* PCS misc */
				#phy-cells = <0>;
				#clock-cells = <0>;
				clocks = <&gcc GCC_USB1_PIPE_CLK>;
				clock-names = "pipe0";
				clock-output-names = "gcc_usb1_pipe_clk_src";
			};
		};

		qusb_phy_1: phy@59000 {
			compatible = "qcom,ipq8074-qusb2-phy";
			reg = <0x00059000 0x180>;
			#phy-cells = <0>;

			clocks = <&gcc GCC_USB1_PHY_CFG_AHB_CLK>,
				 <&xo>;
			clock-names = "cfg_ahb", "ref";

			resets = <&gcc GCC_QUSB2_1_PHY_BCR>;
			status = "disabled";
		};

		ssphy_0: phy@78000 {
			compatible = "qcom,ipq8074-qmp-usb3-phy";
			reg = <0x00078000 0x1c4>;
			#address-cells = <1>;
			#size-cells = <1>;
			ranges;

			clocks = <&gcc GCC_USB0_AUX_CLK>,
				<&gcc GCC_USB0_PHY_CFG_AHB_CLK>,
				<&xo>;
			clock-names = "aux", "cfg_ahb", "ref";

			resets = <&gcc GCC_USB0_PHY_BCR>,
				<&gcc GCC_USB3PHY_0_PHY_BCR>;
			reset-names = "phy","common";
			status = "disabled";

			usb0_ssphy: phy@78200 {
				reg = <0x00078200 0x130>,     /* Tx */
				      <0x00078400 0x200>,     /* Rx */
				      <0x00078800 0x1f8>,     /* PCS */
				      <0x00078600 0x044>;     /* PCS misc */
				#phy-cells = <0>;
				#clock-cells = <0>;
				clocks = <&gcc GCC_USB0_PIPE_CLK>;
				clock-names = "pipe0";
				clock-output-names = "gcc_usb0_pipe_clk_src";
			};
		};

		qusb_phy_0: phy@79000 {
			compatible = "qcom,ipq8074-qusb2-phy";
			reg = <0x00079000 0x180>;
			#phy-cells = <0>;

			clocks = <&gcc GCC_USB0_PHY_CFG_AHB_CLK>,
				 <&xo>;
			clock-names = "cfg_ahb", "ref";

			resets = <&gcc GCC_QUSB2_0_PHY_BCR>;
			status = "disabled";
		};

		pcie_qmp0: phy@86000 {
			compatible = "qcom,ipq8074-qmp-pcie-phy";
			reg = <0x00086000 0x1c4>;
			#address-cells = <1>;
			#size-cells = <1>;
			ranges;

			clocks = <&gcc GCC_PCIE0_AUX_CLK>,
				<&gcc GCC_PCIE0_AHB_CLK>;
			clock-names = "aux", "cfg_ahb";
			resets = <&gcc GCC_PCIE0_PHY_BCR>,
				<&gcc GCC_PCIE0PHY_PHY_BCR>;
			reset-names = "phy",
				      "common";
			status = "disabled";

			pcie_phy0: phy@86200 {
				reg = <0x86200 0x16c>,
				      <0x86400 0x200>,
				      <0x86800 0x4f4>;
				#phy-cells = <0>;
				#clock-cells = <0>;
				clocks = <&gcc GCC_PCIE0_PIPE_CLK>;
				clock-names = "pipe0";
				clock-output-names = "pcie_0_pipe_clk";
			};
		};

		pcie_qmp1: phy@8e000 {
			compatible = "qcom,ipq8074-qmp-pcie-phy";
			reg = <0x0008e000 0x1c4>;
			#address-cells = <1>;
			#size-cells = <1>;
			ranges;

			clocks = <&gcc GCC_PCIE1_AUX_CLK>,
				<&gcc GCC_PCIE1_AHB_CLK>;
			clock-names = "aux", "cfg_ahb";
			resets = <&gcc GCC_PCIE1_PHY_BCR>,
				<&gcc GCC_PCIE1PHY_PHY_BCR>;
			reset-names = "phy",
				      "common";
			status = "disabled";

			pcie_phy1: phy@8e200 {
				reg = <0x8e200 0x16c>,
				      <0x8e400 0x200>,
				      <0x8e800 0x4f4>;
				#phy-cells = <0>;
				#clock-cells = <0>;
				clocks = <&gcc GCC_PCIE1_PIPE_CLK>;
				clock-names = "pipe0";
				clock-output-names = "pcie_1_pipe_clk";
			};
		};

		mdio: mdio@90000 {
			compatible = "qcom,ipq4019-mdio";
			reg = <0x00090000 0x64>;
			#address-cells = <1>;
			#size-cells = <0>;

			clocks = <&gcc GCC_MDIO_AHB_CLK>;
			clock-names = "gcc_mdio_ahb_clk";

			status = "disabled";
		};

		prng: rng@e3000 {
			compatible = "qcom,prng-ee";
			reg = <0x000e3000 0x1000>;
			clocks = <&gcc GCC_PRNG_AHB_CLK>;
			clock-names = "core";
			status = "disabled";
		};

		tsens: thermal-sensor@4a9000 {
			compatible = "qcom,ipq8074-tsens";
			reg = <0x4a9000 0x1000>, /* TM */
			      <0x4a8000 0x1000>; /* SROT */
			interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "combined";
			#qcom,sensors = <16>;
			#thermal-sensor-cells = <1>;
		};

		cryptobam: dma-controller@704000 {
			compatible = "qcom,bam-v1.7.0";
			reg = <0x00704000 0x20000>;
			interrupts = <GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_CRYPTO_AHB_CLK>;
			clock-names = "bam_clk";
			#dma-cells = <1>;
			qcom,ee = <1>;
			qcom,controlled-remotely;
			status = "disabled";
		};

		crypto: crypto@73a000 {
			compatible = "qcom,crypto-v5.1";
			reg = <0x0073a000 0x6000>;
			clocks = <&gcc GCC_CRYPTO_AHB_CLK>,
				 <&gcc GCC_CRYPTO_AXI_CLK>,
				 <&gcc GCC_CRYPTO_CLK>;
			clock-names = "iface", "bus", "core";
			dmas = <&cryptobam 2>, <&cryptobam 3>;
			dma-names = "rx", "tx";
			status = "disabled";
		};

		tlmm: pinctrl@1000000 {
			compatible = "qcom,ipq8074-pinctrl";
			reg = <0x01000000 0x300000>;
			interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>;
			gpio-controller;
			gpio-ranges = <&tlmm 0 0 70>;
			#gpio-cells = <0x2>;
			interrupt-controller;
			#interrupt-cells = <0x2>;

			serial_4_pins: serial4-state {
				pins = "gpio23", "gpio24";
				function = "blsp4_uart1";
				drive-strength = <8>;
				bias-disable;
			};

			i2c_0_pins: i2c-0-state {
				pins = "gpio42", "gpio43";
				function = "blsp1_i2c";
				drive-strength = <8>;
				bias-disable;
			};

			spi_0_pins: spi-0-state {
				pins = "gpio38", "gpio39", "gpio40", "gpio41";
				function = "blsp0_spi";
				drive-strength = <8>;
				bias-disable;
			};

			hsuart_pins: hsuart-state {
				pins = "gpio46", "gpio47", "gpio48", "gpio49";
				function = "blsp2_uart";
				drive-strength = <8>;
				bias-disable;
			};

			qpic_pins: qpic-state {
				pins = "gpio1", "gpio3", "gpio4",
				       "gpio5", "gpio6", "gpio7",
				       "gpio8", "gpio10", "gpio11",
				       "gpio12", "gpio13", "gpio14",
				       "gpio15", "gpio16", "gpio17";
				function = "qpic";
				drive-strength = <8>;
				bias-disable;
			};
		};

		gcc: gcc@1800000 {
			compatible = "qcom,gcc-ipq8074";
			reg = <0x01800000 0x80000>;
			clocks = <&xo>, <&sleep_clk>;
			clock-names = "xo", "sleep_clk";
			#clock-cells = <1>;
			#power-domain-cells = <1>;
			#reset-cells = <1>;
		};

		tcsr_mutex: hwlock@1905000 {
			compatible = "qcom,tcsr-mutex";
			reg = <0x01905000 0x20000>;
			#hwlock-cells = <1>;
		};

		spmi_bus: spmi@200f000 {
			compatible = "qcom,spmi-pmic-arb";
			reg = <0x0200f000 0x001000>,
			      <0x02400000 0x800000>,
			      <0x02c00000 0x800000>,
			      <0x03800000 0x200000>,
			      <0x0200a000 0x000700>;
			reg-names = "core", "chnls", "obsrvr", "intr", "cnfg";
			interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "periph_irq";
			qcom,ee = <0>;
			qcom,channel = <0>;
			#address-cells = <2>;
			#size-cells = <0>;
			interrupt-controller;
			#interrupt-cells = <4>;
			cell-index = <0>;
		};

		sdhc_1: mmc@7824900 {
			compatible = "qcom,sdhci-msm-v4";
			reg = <0x7824900 0x500>, <0x7824000 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>;
			clock-names = "iface", "core", "xo";
			resets = <&gcc GCC_SDCC1_BCR>;
			max-frequency = <384000000>;
			mmc-ddr-1_8v;
			mmc-hs200-1_8v;
			mmc-hs400-1_8v;
			bus-width = <8>;

			status = "disabled";
		};

		blsp_dma: dma-controller@7884000 {
			compatible = "qcom,bam-v1.7.0";
			reg = <0x07884000 0x2b000>;
			interrupts = <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP1_AHB_CLK>;
			clock-names = "bam_clk";
			#dma-cells = <1>;
			qcom,ee = <0>;
		};

		blsp1_uart1: serial@78af000 {
			compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
			reg = <0x078af000 0x200>;
			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_uart3: serial@78b1000 {
			compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
			reg = <0x078b1000 0x200>;
			interrupts = <GIC_SPI 306 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP1_UART3_APPS_CLK>,
				<&gcc GCC_BLSP1_AHB_CLK>;
			clock-names = "core", "iface";
			dmas = <&blsp_dma 4>,
				<&blsp_dma 5>;
			dma-names = "tx", "rx";
			pinctrl-0 = <&hsuart_pins>;
			pinctrl-names = "default";
			status = "disabled";
		};

		blsp1_uart5: serial@78b3000 {
			compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
			reg = <0x078b3000 0x200>;
			interrupts = <GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP1_UART5_APPS_CLK>,
				 <&gcc GCC_BLSP1_AHB_CLK>;
			clock-names = "core", "iface";
			pinctrl-0 = <&serial_4_pins>;
			pinctrl-names = "default";
			status = "disabled";
		};

		blsp1_spi1: spi@78b5000 {
			compatible = "qcom,spi-qup-v2.2.1";
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0x078b5000 0x600>;
			interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
			spi-max-frequency = <50000000>;
			clocks = <&gcc GCC_BLSP1_QUP1_SPI_APPS_CLK>,
				<&gcc GCC_BLSP1_AHB_CLK>;
			clock-names = "core", "iface";
			dmas = <&blsp_dma 12>, <&blsp_dma 13>;
			dma-names = "tx", "rx";
			pinctrl-0 = <&spi_0_pins>;
			pinctrl-names = "default";
			status = "disabled";
		};

		blsp1_i2c2: i2c@78b6000 {
			compatible = "qcom,i2c-qup-v2.2.1";
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0x078b6000 0x600>;
			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";
			clock-frequency = <400000>;
			dmas = <&blsp_dma 14>, <&blsp_dma 15>;
			dma-names = "tx", "rx";
			pinctrl-0 = <&i2c_0_pins>;
			pinctrl-names = "default";
			status = "disabled";
		};

		blsp1_i2c3: i2c@78b7000 {
			compatible = "qcom,i2c-qup-v2.2.1";
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0x078b7000 0x600>;
			interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP1_QUP3_I2C_APPS_CLK>,
				 <&gcc GCC_BLSP1_AHB_CLK>;
			clock-names = "core", "iface";
			clock-frequency = <100000>;
			dmas = <&blsp_dma 16>, <&blsp_dma 17>;
			dma-names = "tx", "rx";
			status = "disabled";
		};

		blsp1_i2c5: i2c@78b9000 {
			compatible = "qcom,i2c-qup-v2.2.1";
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0x78b9000 0x600>;
			interrupts = <GIC_SPI 299 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP1_QUP5_I2C_APPS_CLK>,
				 <&gcc GCC_BLSP1_AHB_CLK>;
			clock-names = "core", "iface";
			clock-frequency = <400000>;
			dmas = <&blsp_dma 20>, <&blsp_dma 21>;
			dma-names = "tx", "rx";
			status = "disabled";
		};

		blsp1_i2c6: i2c@78ba000 {
			compatible = "qcom,i2c-qup-v2.2.1";
			#address-cells = <1>;
			#size-cells = <0>;
			reg = <0x078ba000 0x600>;
			interrupts = <GIC_SPI 300 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_BLSP1_QUP6_I2C_APPS_CLK>,
				 <&gcc GCC_BLSP1_AHB_CLK>;
			clock-names = "core", "iface";
			clock-frequency = <100000>;
			dmas = <&blsp_dma 22>, <&blsp_dma 23>;
			dma-names = "tx", "rx";
			status = "disabled";
		};

		qpic_bam: dma-controller@7984000 {
			compatible = "qcom,bam-v1.7.0";
			reg = <0x07984000 0x1a000>;
			interrupts = <GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&gcc GCC_QPIC_AHB_CLK>;
			clock-names = "bam_clk";
			#dma-cells = <1>;
			qcom,ee = <0>;
			status = "disabled";
		};

		qpic_nand: nand-controller@79b0000 {
			compatible = "qcom,ipq8074-nand";
			reg = <0x079b0000 0x10000>;
			#address-cells = <1>;
			#size-cells = <0>;
			clocks = <&gcc GCC_QPIC_CLK>,
				 <&gcc GCC_QPIC_AHB_CLK>;
			clock-names = "core", "aon";

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

		usb_0: usb@8af8800 {
			compatible = "qcom,ipq8074-dwc3", "qcom,dwc3";
			reg = <0x08af8800 0x400>;
			#address-cells = <1>;
			#size-cells = <1>;
			ranges;

			clocks = <&gcc GCC_SYS_NOC_USB0_AXI_CLK>,
				<&gcc GCC_USB0_MASTER_CLK>,
				<&gcc GCC_USB0_SLEEP_CLK>,
				<&gcc GCC_USB0_MOCK_UTMI_CLK>;
			clock-names = "cfg_noc",
				"core",
				"sleep",
				"mock_utmi";

			assigned-clocks = <&gcc GCC_SYS_NOC_USB0_AXI_CLK>,
					  <&gcc GCC_USB0_MASTER_CLK>,
					  <&gcc GCC_USB0_MOCK_UTMI_CLK>;
			assigned-clock-rates = <133330000>,
						<133330000>,
						<19200000>;

			power-domains = <&gcc USB0_GDSC>;

			resets = <&gcc GCC_USB0_BCR>;
			status = "disabled";

			dwc_0: usb@8a00000 {
				compatible = "snps,dwc3";
				reg = <0x8a00000 0xcd00>;
				interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
				phys = <&qusb_phy_0>, <&usb0_ssphy>;
				phy-names = "usb2-phy", "usb3-phy";
				snps,is-utmi-l1-suspend;
				snps,hird-threshold = /bits/ 8 <0x0>;
				snps,dis_u2_susphy_quirk;
				snps,dis_u3_susphy_quirk;
				dr_mode = "host";
			};
		};

		usb_1: usb@8cf8800 {
			compatible = "qcom,ipq8074-dwc3", "qcom,dwc3";
			reg = <0x08cf8800 0x400>;
			#address-cells = <1>;
			#size-cells = <1>;
			ranges;

			clocks = <&gcc GCC_SYS_NOC_USB1_AXI_CLK>,
				<&gcc GCC_USB1_MASTER_CLK>,
				<&gcc GCC_USB1_SLEEP_CLK>,
				<&gcc GCC_USB1_MOCK_UTMI_CLK>;
			clock-names = "cfg_noc",
				"core",
				"sleep",
				"mock_utmi";

			assigned-clocks = <&gcc GCC_SYS_NOC_USB1_AXI_CLK>,
					  <&gcc GCC_USB1_MASTER_CLK>,
					  <&gcc GCC_USB1_MOCK_UTMI_CLK>;
			assigned-clock-rates = <133330000>,
						<133330000>,
						<19200000>;

			power-domains = <&gcc USB1_GDSC>;

			resets = <&gcc GCC_USB1_BCR>;
			status = "disabled";

			dwc_1: usb@8c00000 {
				compatible = "snps,dwc3";
				reg = <0x8c00000 0xcd00>;
				interrupts = <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>;
				phys = <&qusb_phy_1>, <&usb1_ssphy>;
				phy-names = "usb2-phy", "usb3-phy";
				snps,is-utmi-l1-suspend;
				snps,hird-threshold = /bits/ 8 <0x0>;
				snps,dis_u2_susphy_quirk;
				snps,dis_u3_susphy_quirk;
				dr_mode = "host";
			};
		};

		intc: interrupt-controller@b000000 {
			compatible = "qcom,msm-qgic2";
			#address-cells = <1>;
			#size-cells = <1>;
			interrupt-controller;
			#interrupt-cells = <0x3>;
			reg = <0x0b000000 0x1000>, <0x0b002000 0x1000>;
			ranges = <0 0xb00a000 0xffd>;

			v2m@0 {
				compatible = "arm,gic-v2m-frame";
				msi-controller;
				reg = <0x0 0xffd>;
			};
		};

		watchdog: watchdog@b017000 {
			compatible = "qcom,kpss-wdt";
			reg = <0xb017000 0x1000>;
			interrupts = <GIC_SPI 3 IRQ_TYPE_EDGE_RISING>;
			clocks = <&sleep_clk>;
			timeout-sec = <30>;
		};

		apcs_glb: mailbox@b111000 {
			compatible = "qcom,ipq8074-apcs-apps-global";
			reg = <0x0b111000 0x1000>;
			clocks = <&a53pll>, <&xo>;
			clock-names = "pll", "xo";

			#clock-cells = <1>;
			#mbox-cells = <1>;
		};

		a53pll: clock@b116000 {
			compatible = "qcom,ipq8074-a53pll";
			reg = <0x0b116000 0x40>;
			#clock-cells = <0>;
			clocks = <&xo>;
			clock-names = "xo";
		};

		timer@b120000 {
			#address-cells = <1>;
			#size-cells = <1>;
			ranges;
			compatible = "arm,armv7-timer-mem";
			reg = <0x0b120000 0x1000>;

			frame@b120000 {
				frame-number = <0>;
				interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
					     <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
				reg = <0x0b121000 0x1000>,
				      <0x0b122000 0x1000>;
			};

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

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

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

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

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

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

		pcie1: pci@10000000 {
			compatible = "qcom,pcie-ipq8074";
			reg =  <0x10000000 0xf1d>,
			       <0x10000f20 0xa8>,
			       <0x00088000 0x2000>,
			       <0x10100000 0x1000>;
			reg-names = "dbi", "elbi", "parf", "config";
			device_type = "pci";
			linux,pci-domain = <1>;
			bus-range = <0x00 0xff>;
			num-lanes = <1>;
			#address-cells = <3>;
			#size-cells = <2>;

			phys = <&pcie_phy1>;
			phy-names = "pciephy";

			ranges = <0x81000000 0 0x10200000 0x10200000
				  0 0x100000   /* downstream I/O */
				  0x82000000 0 0x10300000 0x10300000
				  0 0xd00000>; /* non-prefetchable memory */

			interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "msi";
			#interrupt-cells = <1>;
			interrupt-map-mask = <0 0 0 0x7>;
			interrupt-map = <0 0 0 1 &intc 0 142
					 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
					<0 0 0 2 &intc 0 143
					 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
					<0 0 0 3 &intc 0 144
					 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
					<0 0 0 4 &intc 0 145
					 IRQ_TYPE_LEVEL_HIGH>; /* int_d */

			clocks = <&gcc GCC_SYS_NOC_PCIE1_AXI_CLK>,
				 <&gcc GCC_PCIE1_AXI_M_CLK>,
				 <&gcc GCC_PCIE1_AXI_S_CLK>,
				 <&gcc GCC_PCIE1_AHB_CLK>,
				 <&gcc GCC_PCIE1_AUX_CLK>;
			clock-names = "iface",
				      "axi_m",
				      "axi_s",
				      "ahb",
				      "aux";
			resets = <&gcc GCC_PCIE1_PIPE_ARES>,
				 <&gcc GCC_PCIE1_SLEEP_ARES>,
				 <&gcc GCC_PCIE1_CORE_STICKY_ARES>,
				 <&gcc GCC_PCIE1_AXI_MASTER_ARES>,
				 <&gcc GCC_PCIE1_AXI_SLAVE_ARES>,
				 <&gcc GCC_PCIE1_AHB_ARES>,
				 <&gcc GCC_PCIE1_AXI_MASTER_STICKY_ARES>;
			reset-names = "pipe",
				      "sleep",
				      "sticky",
				      "axi_m",
				      "axi_s",
				      "ahb",
				      "axi_m_sticky";
			status = "disabled";
		};

		pcie0: pci@20000000 {
			compatible = "qcom,pcie-ipq8074";
			reg = <0x20000000 0xf1d>,
			      <0x20000f20 0xa8>,
			      <0x00080000 0x2000>,
			      <0x20100000 0x1000>;
			reg-names = "dbi", "elbi", "parf", "config";
			device_type = "pci";
			linux,pci-domain = <0>;
			bus-range = <0x00 0xff>;
			num-lanes = <1>;
			#address-cells = <3>;
			#size-cells = <2>;

			phys = <&pcie_phy0>;
			phy-names = "pciephy";

			ranges = <0x81000000 0 0x20200000 0x20200000
				  0 0x100000   /* downstream I/O */
				  0x82000000 0 0x20300000 0x20300000
				  0 0xd00000>; /* non-prefetchable memory */

			interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
			interrupt-names = "msi";
			#interrupt-cells = <1>;
			interrupt-map-mask = <0 0 0 0x7>;
			interrupt-map = <0 0 0 1 &intc 0 75
					 IRQ_TYPE_LEVEL_HIGH>, /* int_a */
					<0 0 0 2 &intc 0 78
					 IRQ_TYPE_LEVEL_HIGH>, /* int_b */
					<0 0 0 3 &intc 0 79
					 IRQ_TYPE_LEVEL_HIGH>, /* int_c */
					<0 0 0 4 &intc 0 83
					 IRQ_TYPE_LEVEL_HIGH>; /* int_d */

			clocks = <&gcc GCC_SYS_NOC_PCIE0_AXI_CLK>,
				 <&gcc GCC_PCIE0_AXI_M_CLK>,
				 <&gcc GCC_PCIE0_AXI_S_CLK>,
				 <&gcc GCC_PCIE0_AHB_CLK>,
				 <&gcc GCC_PCIE0_AUX_CLK>;

			clock-names = "iface",
				      "axi_m",
				      "axi_s",
				      "ahb",
				      "aux";
			resets = <&gcc GCC_PCIE0_PIPE_ARES>,
				 <&gcc GCC_PCIE0_SLEEP_ARES>,
				 <&gcc GCC_PCIE0_CORE_STICKY_ARES>,
				 <&gcc GCC_PCIE0_AXI_MASTER_ARES>,
				 <&gcc GCC_PCIE0_AXI_SLAVE_ARES>,
				 <&gcc GCC_PCIE0_AHB_ARES>,
				 <&gcc GCC_PCIE0_AXI_MASTER_STICKY_ARES>;
			reset-names = "pipe",
				      "sleep",
				      "sticky",
				      "axi_m",
				      "axi_s",
				      "ahb",
				      "axi_m_sticky";
			status = "disabled";
		};
	};

	timer {
		compatible = "arm,armv8-timer";
		interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
			     <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
			     <GIC_PPI 4 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
			     <GIC_PPI 1 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>;
	};

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

			thermal-sensors = <&tsens 4>;
		};

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

			thermal-sensors = <&tsens 5>;
		};

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

			thermal-sensors = <&tsens 6>;
		};

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

			thermal-sensors = <&tsens 7>;
		};

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

			thermal-sensors = <&tsens 8>;
		};

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

			thermal-sensors = <&tsens 9>;
		};

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

			thermal-sensors = <&tsens 10>;
		};

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

			thermal-sensors = <&tsens 11>;
		};

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

			thermal-sensors = <&tsens 12>;
		};

		cluster_thermal: cluster-thermal {
			polling-delay-passive = <250>;
			polling-delay = <1000>;

			thermal-sensors = <&tsens 13>;
		};

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

			thermal-sensors = <&tsens 14>;
		};

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

			thermal-sensors = <&tsens 15>;
		};
	};
};


code:
// SPDX-License-Identifier: GPL-2.0-only

/dts-v1/;

#include "msm8916-pm8916.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>

/ {
	model = "Alcatel OneTouch Idol 3 (4.7)";
	compatible = "alcatel,idol347", "qcom,msm8916";
	chassis-type = "handset";

	aliases {
		serial0 = &blsp1_uart2;
	};

	chosen {
		stdout-path = "serial0";
	};

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

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

		label = "GPIO Buttons";

		button-volume-up {
			label = "Volume Up";
			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEUP>;
		};
	};

	gpio-leds {
		compatible = "gpio-leds";

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

		led-0 {
			gpios = <&msmgpio 32 GPIO_ACTIVE_HIGH>;
			linux,default-trigger = "torch";
			function = LED_FUNCTION_TORCH;
		};
	};

	usb_id: usb-id {
		compatible = "linux,extcon-usb-gpio";
		id-gpio = <&msmgpio 69 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&usb_id_default>;
	};
};

&blsp1_uart2 {
	status = "okay";
};

&blsp_i2c4 {
	status = "okay";

	touchscreen@26 {
		compatible = "mstar,msg2638";
		reg = <0x26>;
		interrupt-parent = <&msmgpio>;
		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
		reset-gpios = <&msmgpio 100 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&ts_int_reset_default>;
		vdd-supply = <&pm8916_l17>;
		vddio-supply = <&pm8916_l5>;
		touchscreen-size-x = <2048>;
		touchscreen-size-y = <2048>;
	};
};

&blsp_i2c5 {
	status = "okay";

	magnetometer@c {
		compatible = "asahi-kasei,ak09911";
		reg = <0x0c>;
		vdd-supply = <&pm8916_l17>;
		vid-supply = <&pm8916_l6>;
		reset-gpios = <&msmgpio 8 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&mag_reset_default>;
		mount-matrix = "0", "1", "0",
			       "-1", "0", "0",
			       "0", "0", "1";
	};

	accelerometer@f {
		compatible = "kionix,kxtj21009";
		reg = <0x0f>;
		vdd-supply = <&pm8916_l17>;
		vddio-supply = <&pm8916_l6>;
		interrupt-parent = <&msmgpio>;
		interrupts = <31 IRQ_TYPE_EDGE_RISING>;
		pinctrl-names = "default";
		pinctrl-0 = <&accel_int_default>;
		mount-matrix = "-1", "0", "0",
			       "0", "1", "0",
			       "0", "0", "-1";
	};

	proximity@48 {
		compatible = "sensortek,stk3310";
		reg = <0x48>;
		interrupt-parent = <&msmgpio>;
		interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
		pinctrl-names = "default";
		pinctrl-0 = <&proximity_int_default>;
	};

	gyroscope@68 {
		compatible = "bosch,bmg160";
		reg = <0x68>;
		vdd-supply = <&pm8916_l17>;
		vddio-supply = <&pm8916_l6>;
		interrupt-parent = <&msmgpio>;
		interrupts = <97 IRQ_TYPE_EDGE_RISING>,
			     <98 IRQ_TYPE_EDGE_RISING>;
		pinctrl-names = "default";
		pinctrl-0 = <&gyro_int_default>;
	};
};

&blsp_i2c6 {
	status = "okay";

	led-controller@68 {
		compatible = "si-en,sn3190";
		reg = <0x68>;
		shutdown-gpios = <&msmgpio 89 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&led_enable_default &led_shutdown_default>;
		#address-cells = <1>;
		#size-cells = <0>;

		led@1 {
			reg = <1>;
			led-max-microamp = <5000>;
			function = LED_FUNCTION_INDICATOR;
			color = <LED_COLOR_ID_WHITE>;
		};
	};
};

&pm8916_resin {
	status = "okay";
	linux,code = <KEY_VOLUMEDOWN>;
};

&pm8916_vib {
	status = "okay";
};

&pronto {
	status = "okay";
};

&sdhc_1 {
	status = "okay";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
};

&sdhc_2 {
	status = "okay";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;

	cd-gpios = <&msmgpio 38 GPIO_ACTIVE_LOW>;
};

&usb {
	status = "okay";
	extcon = <&usb_id>, <&usb_id>;
};

&usb_hs_phy {
	extcon = <&usb_id>;
};

&smd_rpm_regulators {
	vdd_l1_l2_l3-supply = <&pm8916_s3>;
	vdd_l4_l5_l6-supply = <&pm8916_s4>;
	vdd_l7-supply = <&pm8916_s4>;

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

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

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

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

	l4 {
		regulator-min-microvolt = <2050000>;
		regulator-max-microvolt = <2050000>;
	};

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

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

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

	l8 {
		regulator-min-microvolt = <2850000>;
		regulator-max-microvolt = <2900000>;
	};

	l9 {
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	l10 {
		regulator-min-microvolt = <2700000>;
		regulator-max-microvolt = <2800000>;
	};

	l11 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2950000>;
		regulator-allow-set-load;
		regulator-system-load = <200000>;
	};

	l12 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2950000>;
	};

	l13 {
		regulator-min-microvolt = <3075000>;
		regulator-max-microvolt = <3075000>;
	};

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

	l15 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;
	};

	l16 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;
	};

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

	l18 {
		regulator-min-microvolt = <2700000>;
		regulator-max-microvolt = <2700000>;
	};
};

&msmgpio {
	accel_int_default: accel-int-default-state {
		pins = "gpio31";
		function = "gpio";

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

	gpio_keys_default: gpio-keys-default-state {
		pins = "gpio107";
		function = "gpio";

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

	gpio_leds_default: gpio-leds-default-state {
		pins = "gpio32";
		function = "gpio";

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

	gyro_int_default: gyro-int-default-state {
		pins = "gpio97", "gpio98";
		function = "gpio";

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

	/*
	 * The OEM wired an additional GPIO to be asserted so that
	 * the si-en,sn3190 LED IC works. Since this GPIO is not
	 * part of the IC datasheet nor supported by the driver,
	 * force it asserted here.
	 */
	led_enable_default: led-enable-default-state {
		pins = "gpio102";
		function = "gpio";

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

	led_shutdown_default: led-shutdown-default-state {
		pins = "gpio89";
		function = "gpio";

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

	mag_reset_default: mag-reset-default-state {
		pins = "gpio8";
		function = "gpio";

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

	proximity_int_default: proximity-int-default-state {
		pins = "gpio12";
		function = "gpio";

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

	ts_int_reset_default: ts-int-reset-default-state {
		pins = "gpio13", "gpio100";
		function = "gpio";

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

	usb_id_default: usb-id-default-state {
		pins = "gpio69";
		function = "gpio";

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

repo_name: angery/linux


code:
// SPDX-License-Identifier: GPL-2.0-only

/dts-v1/;

#include "msm8916-pm8916.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
	model = "Asus Zenfone 2 Laser";
	compatible = "asus,z00l", "qcom,msm8916";
	chassis-type = "handset";

	aliases {
		serial0 = &blsp1_uart2;
	};

	chosen {
		stdout-path = "serial0";
	};

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

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

		label = "GPIO Buttons";

		button-volume-up {
			label = "Volume Up";
			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEUP>;
			debounce-interval = <15>;
		};

		button-volume-down {
			label = "Volume Down";
			gpios = <&msmgpio 117 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEDOWN>;
			debounce-interval = <15>;
		};
	};

	reg_sd_vmmc: regulator-sdcard-vmmc {
		compatible = "regulator-fixed";
		regulator-name = "sdcard-vmmc";
		regulator-min-microvolt = <2950000>;
		regulator-max-microvolt = <2950000>;

		gpio = <&msmgpio 87 GPIO_ACTIVE_HIGH>;
		enable-active-high;

		startup-delay-us = <200>;

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

	usb_id: usb-id {
		compatible = "linux,extcon-usb-gpio";
		id-gpios = <&msmgpio 110 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&usb_id_default>;
	};
};

&blsp_i2c2 {
	status = "okay";

	magnetometer@c {
		compatible = "asahi-kasei,ak09911";
		reg = <0x0c>;

		vdd-supply = <&pm8916_l8>;
		vid-supply = <&pm8916_l6>;

		reset-gpios = <&msmgpio 112 GPIO_ACTIVE_LOW>;

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

	imu@68 {
		compatible = "invensense,mpu6515";
		reg = <0x68>;

		interrupt-parent = <&msmgpio>;
		interrupts = <36 IRQ_TYPE_EDGE_RISING>;

		vdd-supply = <&pm8916_l17>;
		vddio-supply = <&pm8916_l6>;

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

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

&blsp_i2c5 {
	status = "okay";

	touchscreen@38 {
		compatible = "edt,edt-ft5306";
		reg = <0x38>;

		interrupt-parent = <&msmgpio>;
		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;

		reset-gpios = <&msmgpio 12 GPIO_ACTIVE_LOW>;

		vcc-supply = <&pm8916_l11>;
		iovcc-supply = <&pm8916_l6>;

		touchscreen-size-x = <720>;
		touchscreen-size-y = <1280>;

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

&blsp1_uart2 {
	status = "okay";
};

&pronto {
	status = "okay";
};

&sdhc_1 {
	status = "okay";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
};

&sdhc_2 {
	status = "okay";
	vmmc-supply = <&reg_sd_vmmc>;

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
	cd-gpios = <&msmgpio 38 GPIO_ACTIVE_LOW>;
};

&usb {
	status = "okay";
	extcon = <&usb_id>, <&usb_id>;
};

&usb_hs_phy {
	extcon = <&usb_id>;
};

&smd_rpm_regulators {
	vdd_l1_l2_l3-supply = <&pm8916_s3>;
	vdd_l4_l5_l6-supply = <&pm8916_s4>;
	vdd_l7-supply = <&pm8916_s4>;

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

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

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

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

	l4 {
		regulator-min-microvolt = <2050000>;
		regulator-max-microvolt = <2050000>;
	};

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

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

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

	l8 {
		regulator-min-microvolt = <2850000>;
		regulator-max-microvolt = <2900000>;
	};

	l9 {
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	l10 {
		regulator-min-microvolt = <2700000>;
		regulator-max-microvolt = <2800000>;
	};

	l11 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2950000>;
		regulator-allow-set-load;
		regulator-system-load = <200000>;
	};

	l12 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2950000>;
	};

	l13 {
		regulator-min-microvolt = <3075000>;
		regulator-max-microvolt = <3075000>;
	};

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

	l15 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;
	};

	l16 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;
	};

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

	l18 {
		regulator-min-microvolt = <2700000>;
		regulator-max-microvolt = <2700000>;
	};
};

&msmgpio {
	gpio_keys_default: gpio-keys-default-state {
		pins = "gpio107", "gpio117";
		function = "gpio";

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

	imu_default: imu-default-state {
		pins = "gpio36";
		function = "gpio";

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

	mag_reset_default: mag-reset-default-state {
		pins = "gpio112";
		function = "gpio";

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

	sd_vmmc_en_default: sd-vmmc-en-default-state {
		pins = "gpio87";
		function = "gpio";

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

	touchscreen_default: touchscreen-default-state {
		touch-pins {
			pins = "gpio13";
			function = "gpio";

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

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

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

	usb_id_default: usb-id-default-state {
		pins = "gpio110";
		function = "gpio";

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


code:
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2021 Stephan Gerhold
 */

/dts-v1/;

#include "msm8916-pm8916.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/sound/apq8016-lpass.h>

/*
 * Note: The original firmware from Huawei can only boot 32-bit kernels.
 * To boot this device tree using arm64 it is necessary to flash 64-bit TZ/HYP
 * firmware (e.g. taken from the DragonBoard 410c).
 * See https://wiki.postmarketos.org/wiki/Huawei_Ascend_G7_(huawei-g7)
 * for suggested installation instructions.
 */

/ {
	model = "Huawei Ascend G7";
	compatible = "huawei,g7", "qcom,msm8916";
	chassis-type = "handset";

	aliases {
		serial0 = &blsp1_uart2;
	};

	chosen {
		stdout-path = "serial0";
	};

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

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

		label = "GPIO Buttons";

		button-volume-up {
			label = "Volume Up";
			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEUP>;
		};
	};

	leds {
		compatible = "gpio-leds";

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

		led-0 {
			gpios = <&msmgpio 8 GPIO_ACTIVE_HIGH>;
			color = <LED_COLOR_ID_RED>;
			default-state = "off";
			function = LED_FUNCTION_INDICATOR;
		};

		led-1 {
			gpios = <&msmgpio 9 GPIO_ACTIVE_HIGH>;
			color = <LED_COLOR_ID_GREEN>;
			default-state = "off";
			function = LED_FUNCTION_INDICATOR;
		};

		led-2 {
			gpios = <&msmgpio 10 GPIO_ACTIVE_HIGH>;
			color = <LED_COLOR_ID_BLUE>;
			default-state = "off";
			function = LED_FUNCTION_INDICATOR;
		};
	};

	usb_id: usb-id {
		compatible = "linux,extcon-usb-gpio";
		id-gpio = <&msmgpio 117 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&usb_id_default>;
	};
};

&blsp_i2c2 {
	status = "okay";

	magnetometer@c {
		compatible = "asahi-kasei,ak09911";
		reg = <0x0c>;

		vdd-supply = <&pm8916_l17>;
		vid-supply = <&pm8916_l6>;

		reset-gpios = <&msmgpio 36 GPIO_ACTIVE_LOW>;

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

	accelerometer@1e {
		compatible = "kionix,kx023-1025";
		reg = <0x1e>;

		interrupt-parent = <&msmgpio>;
		interrupts = <115 IRQ_TYPE_EDGE_RISING>;

		vdd-supply = <&pm8916_l17>;
		vddio-supply = <&pm8916_l6>;

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

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

	proximity@39 {
		compatible = "avago,apds9930";
		reg = <0x39>;

		interrupt-parent = <&msmgpio>;
		interrupts = <113 IRQ_TYPE_EDGE_FALLING>;

		vdd-supply = <&pm8916_l17>;
		vddio-supply = <&pm8916_l6>;

		led-max-microamp = <100000>;
		amstaos,proximity-diodes = <1>;

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

	regulator@3e {
		compatible = "ti,tps65132";
		reg = <0x3e>;

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

		reg_lcd_pos: outp {
			regulator-name = "outp";
			regulator-min-microvolt = <5400000>;
			regulator-max-microvolt = <5400000>;
			enable-gpios = <&msmgpio 97 GPIO_ACTIVE_HIGH>;
			regulator-active-discharge = <1>;
		};

		reg_lcd_neg: outn {
			regulator-name = "outn";
			regulator-min-microvolt = <5400000>;
			regulator-max-microvolt = <5400000>;
			enable-gpios = <&msmgpio 32 GPIO_ACTIVE_HIGH>;
			regulator-active-discharge = <1>;
		};
	};
};

&blsp_i2c5 {
	status = "okay";

	rmi4@70 {
		compatible = "syna,rmi4-i2c";
		reg = <0x70>;
		#address-cells = <1>;
		#size-cells = <0>;

		interrupt-parent = <&msmgpio>;
		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;

		vdd-supply = <&pm8916_l17>;
		vio-supply = <&pm8916_l16>;

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

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

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

		rmi4-f11@11 {
			reg = <0x11>;
			syna,sensor-type = <1>; /* Touchscreen */
		};
	};
};

&blsp_i2c6 {
	status = "okay";

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

		interrupt-parent = <&msmgpio>;
		interrupts = <21 IRQ_TYPE_EDGE_RISING>;

		enable-gpios = <&msmgpio 20 GPIO_ACTIVE_HIGH>;
		firmware-gpios = <&msmgpio 2 GPIO_ACTIVE_HIGH>;

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

&blsp1_uart2 {
	status = "okay";
};

&lpass {
	status = "okay";
};

&pm8916_resin {
	status = "okay";
	linux,code = <KEY_VOLUMEDOWN>;
};

&pm8916_vib {
	status = "okay";
};

&pronto {
	status = "okay";
};

&sdhc_1 {
	status = "okay";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
};

&sdhc_2 {
	status = "okay";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdhc2_cd_default>;
	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdhc2_cd_default>;

	/*
	 * The Huawei device tree sets cd-gpios = <&msmgpio 38 GPIO_ACTIVE_HIGH>.
	 * However, gpio38 does not change its state when inserting/removing the
	 * SD card, it's just low all the time. The Huawei kernel seems to use
	 * polling for SD card detection instead.
	 *
	 * However, looking closer at the GPIO debug output it turns out that
	 * gpio56 switches its state when inserting/removing the SD card.
	 * It behaves just like gpio38 normally does. Usually GPIO56 is used as
	 * "UIM2_PRESENT", i.e. to check if a second SIM card is inserted.
	 * Maybe Huawei decided to replace the second SIM card slot with the
	 * SD card slot and forgot to re-route to gpio38.
	 */
	cd-gpios = <&msmgpio 56 GPIO_ACTIVE_LOW>;
};

&sound {
	status = "okay";

	model = "msm8916";
	audio-routing =
		"AMIC1", "MIC BIAS External1",
		"AMIC2", "MIC BIAS External2",
		"AMIC3", "MIC BIAS External1";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&cdc_pdm_lines_act>;
	pinctrl-1 = <&cdc_pdm_lines_sus>;

	primary-dai-link {
		link-name = "WCD";
		cpu {
			sound-dai = <&lpass MI2S_PRIMARY>;
		};
		codec {
			sound-dai = <&lpass_codec 0>, <&wcd_codec 0>;
		};
	};

	tertiary-dai-link {
		link-name = "WCD-Capture";
		cpu {
			sound-dai = <&lpass MI2S_TERTIARY>;
		};
		codec {
			sound-dai = <&lpass_codec 1>, <&wcd_codec 1>;
		};
	};
};

&usb {
	status = "okay";
	extcon = <&usb_id>, <&usb_id>;
};

&usb_hs_phy {
	extcon = <&usb_id>;
};

&wcd_codec {
	qcom,micbias-lvl = <2800>;
	qcom,mbhc-vthreshold-low = <75 150 237 450 500>;
	qcom,mbhc-vthreshold-high = <75 150 237 450 500>;
	qcom,hphl-jack-type-normally-open;
};

&smd_rpm_regulators {
	vdd_l1_l2_l3-supply = <&pm8916_s3>;
	vdd_l4_l5_l6-supply = <&pm8916_s4>;
	vdd_l7-supply = <&pm8916_s4>;

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

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

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

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

	l4 {
		regulator-min-microvolt = <2050000>;
		regulator-max-microvolt = <2050000>;
	};

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

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

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

	l8 {
		regulator-min-microvolt = <2950000>;
		regulator-max-microvolt = <2950000>;
	};

	l9 {
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	l10 {
		regulator-min-microvolt = <2700000>;
		regulator-max-microvolt = <2800000>;
	};

	l11 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2950000>;
		regulator-allow-set-load;
		regulator-system-load = <200000>;
	};

	l12 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2950000>;
	};

	l13 {
		regulator-min-microvolt = <3075000>;
		regulator-max-microvolt = <3075000>;
	};

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

	l15 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;
	};

	l16 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
	};

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

	l18 {
		regulator-min-microvolt = <2700000>;
		regulator-max-microvolt = <2700000>;
	};
};

&msmgpio {
	accel_irq_default: accel-irq-default-state {
		pins = "gpio115";
		function = "gpio";

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

	gpio_keys_default: gpio-keys-default-state {
		pins = "gpio107";
		function = "gpio";

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

	gpio_leds_default: gpio-leds-default-state {
		pins = "gpio8", "gpio9", "gpio10";
		function = "gpio";

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

	nfc_default: nfc-default-state {
		pins = "gpio2", "gpio20", "gpio21";
		function = "gpio";

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

	mag_reset_default: mag-reset-default-state {
		pins = "gpio36";
		function = "gpio";

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

	prox_irq_default: prox-irq-default-state {
		pins = "gpio113";
		function = "gpio";

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

	reg_lcd_en_default: reg-lcd-en-default-state {
		pins = "gpio32", "gpio97";
		function = "gpio";

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

	sdhc2_cd_default: sdhc2-cd-default-state {
		pins = "gpio56";
		function = "gpio";

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

	ts_irq_default: ts-irq-default-state {
		pins = "gpio13";
		function = "gpio";

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

	usb_id_default: usb-id-default-state {
		pins = "gpio117";
		function = "gpio";

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


code:
// SPDX-License-Identifier: GPL-2.0-only

/dts-v1/;

#include "msm8916-pm8916.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/leds/common.h>

/ {
	model = "Longcheer L8150";
	compatible = "longcheer,l8150", "qcom,msm8916-v1-qrd/9-v1", "qcom,msm8916";
	chassis-type = "handset";

	aliases {
		serial0 = &blsp1_uart2;
	};

	chosen {
		stdout-path = "serial0";
	};

	reserved-memory {
		/* wcnss.mdt is not relocatable, so it must be loaded at 0x8b600000 */
		/delete-node/ wcnss@89300000;

		wcnss_mem: wcnss@8b600000 {
			reg = <0x0 0x8b600000 0x0 0x600000>;
			no-map;
		};
	};

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

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

		label = "GPIO Buttons";

		button-volume-up {
			label = "Volume Up";
			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEUP>;
		};
	};

	reg_ctp: regulator-ctp {
		compatible = "regulator-fixed";
		regulator-name = "ctp";

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

		gpio = <&msmgpio 17 GPIO_ACTIVE_HIGH>;
		enable-active-high;

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

	flash-led-controller {
		compatible = "sgmicro,sgm3140";
		flash-gpios = <&msmgpio 31 GPIO_ACTIVE_HIGH>;
		enable-gpios = <&msmgpio 32 GPIO_ACTIVE_HIGH>;

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

		flash_led: led {
			function = LED_FUNCTION_FLASH;
			color = <LED_COLOR_ID_WHITE>;
			flash-max-timeout-us = <250000>;
		};
	};
};

&blsp_i2c1 {
	status = "okay";

	led-controller@45 {
		compatible = "awinic,aw2013";
		reg = <0x45>;
		#address-cells = <1>;
		#size-cells = <0>;

		vcc-supply = <&pm8916_l17>;

		led@0 {
			reg = <0>;
			led-max-microamp = <5000>;
			function = LED_FUNCTION_INDICATOR;
			color = <LED_COLOR_ID_RED>;
		};

		led@1 {
			reg = <1>;
			led-max-microamp = <5000>;
			function = LED_FUNCTION_INDICATOR;
			color = <LED_COLOR_ID_GREEN>;
		};

		led@2 {
			reg = <2>;
			led-max-microamp = <5000>;
			function = LED_FUNCTION_INDICATOR;
			color = <LED_COLOR_ID_BLUE>;
		};
	};
};

&blsp_i2c2 {
	status = "okay";

	accelerometer@10 {
		compatible = "bosch,bmc156_accel";
		reg = <0x10>;

		/*
		 * For some reason the interrupt line is usually not connected
		 * to the BMC156. However, there are two pads next to the chip
		 * that can be shorted to make it work if needed.
		 *
		 * interrupt-parent = <&msmgpio>;
		 * interrupts = <116 IRQ_TYPE_EDGE_RISING>;
		 */

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

		vdd-supply = <&pm8916_l17>;
		vddio-supply = <&pm8916_l6>;

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

	magnetometer@12 {
		compatible = "bosch,bmc156_magn";
		reg = <0x12>;

		interrupt-parent = <&msmgpio>;
		interrupts = <113 IRQ_TYPE_EDGE_RISING>;

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

		vdd-supply = <&pm8916_l17>;
		vddio-supply = <&pm8916_l6>;
	};

	light-sensor@23 {
		compatible = "liteon,ltr559";
		reg = <0x23>;
		proximity-near-level = <75>;

		interrupt-parent = <&msmgpio>;
		interrupts = <115 IRQ_TYPE_EDGE_FALLING>;

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

		vdd-supply = <&pm8916_l17>;
		vio-supply = <&pm8916_l6>;
	};

	gyroscope@68 {
		compatible = "bosch,bmg160";
		reg = <0x68>;

		interrupt-parent = <&msmgpio>;
		interrupts = <23 IRQ_TYPE_EDGE_RISING>,
			     <22 IRQ_TYPE_EDGE_RISING>;

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

		vdd-supply = <&pm8916_l17>;
		vddio-supply = <&pm8916_l6>;
	};
};

&blsp_i2c5 {
	status = "okay";

	rmi4@20 {
		compatible = "syna,rmi4-i2c";
		reg = <0x20>;
		#address-cells = <1>;
		#size-cells = <0>;

		interrupt-parent = <&msmgpio>;
		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;

		vdd-supply = <&reg_ctp>;
		vio-supply = <&pm8916_l6>;

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

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

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

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

&blsp1_uart2 {
	status = "okay";
};

&pm8916_resin {
	status = "okay";
	linux,code = <KEY_VOLUMEDOWN>;
};

&pm8916_usbin {
	status = "okay";
};

&pm8916_vib {
	status = "okay";
};

&pronto {
	status = "okay";
};

&sdhc_1 {
	status = "okay";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
};

&sdhc_2 {
	status = "okay";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on>;
	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off>;

	non-removable;
};

&usb {
	status = "okay";
	dr_mode = "peripheral";
	extcon = <&pm8916_usbin>;
};

&usb_hs_phy {
	extcon = <&pm8916_usbin>;
};

&smd_rpm_regulators {
	vdd_l1_l2_l3-supply = <&pm8916_s3>;
	vdd_l4_l5_l6-supply = <&pm8916_s4>;
	vdd_l7-supply = <&pm8916_s4>;

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

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

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

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

	l4 {
		regulator-min-microvolt = <2050000>;
		regulator-max-microvolt = <2050000>;
	};

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

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

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

	l8 {
		regulator-min-microvolt = <2850000>;
		regulator-max-microvolt = <2900000>;
	};

	l9 {
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	l10 {
		regulator-min-microvolt = <2700000>;
		regulator-max-microvolt = <2800000>;
	};

	l11 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2950000>;
		regulator-allow-set-load;
		regulator-system-load = <200000>;
	};

	l12 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2950000>;
	};

	l13 {
		regulator-min-microvolt = <3075000>;
		regulator-max-microvolt = <3075000>;
	};

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

	l15 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;
	};

	l16 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;
	};

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

	l18 {
		regulator-min-microvolt = <2700000>;
		regulator-max-microvolt = <2700000>;
	};
};

&msmgpio {
	accel_int_default: accel-int-default-state {
		pins = "gpio116";
		function = "gpio";

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

	camera_flash_default: camera-flash-default-state {
		pins = "gpio31", "gpio32";
		function = "gpio";

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

	ctp_pwr_en_default: ctp-pwr-en-default-state {
		pins = "gpio17";
		function = "gpio";

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

	gpio_keys_default: gpio-keys-default-state {
		pins = "gpio107";
		function = "gpio";

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

	gyro_int_default: gyro-int-default-state {
		pins = "gpio22", "gpio23";
		function = "gpio";

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

	light_int_default: light-int-default-state {
		pins = "gpio115";
		function = "gpio";

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

	magn_int_default: magn-int-default-state {
		pins = "gpio113";
		function = "gpio";

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

	tp_int_default: tp-int-default-state {
		pins = "gpio13";
		function = "gpio";

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


code:
// SPDX-License-Identifier: GPL-2.0-only

/dts-v1/;

#include "msm8916-pm8916.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>

/ {
	model = "BQ Aquaris X5 (Longcheer L8910)";
	compatible = "longcheer,l8910", "qcom,msm8916";
	chassis-type = "handset";

	aliases {
		serial0 = &blsp1_uart2;
	};

	chosen {
		stdout-path = "serial0";
	};

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

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

		label = "GPIO Buttons";

		button-volume-up {
			label = "Volume Up";
			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEUP>;
		};
	};

	leds {
		compatible = "gpio-leds";

		led-0 {
			gpios = <&msmgpio 17 GPIO_ACTIVE_HIGH>;
			color = <LED_COLOR_ID_WHITE>;
			default-state = "off";
			function = LED_FUNCTION_KBD_BACKLIGHT;

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

	usb_id: usb-id {
		compatible = "linux,extcon-usb-gpio";
		id-gpio = <&msmgpio 110 GPIO_ACTIVE_HIGH>;
		pinctrl-names = "default";
		pinctrl-0 = <&usb_id_default>;
	};
};

&blsp_i2c3 {
	status = "okay";

	magnetometer@d {
		compatible = "asahi-kasei,ak09911";
		reg = <0x0d>;

		vdd-supply = <&pm8916_l17>;
		vid-supply = <&pm8916_l6>;

		reset-gpios = <&msmgpio 111 GPIO_ACTIVE_LOW>;

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

	imu@68 {
		compatible = "bosch,bmi160";
		reg = <0x68>;

		vdd-supply = <&pm8916_l17>;
		vddio-supply = <&pm8916_l6>;

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

&blsp1_uart2 {
	status = "okay";
};

&pm8916_resin {
	status = "okay";
	linux,code = <KEY_VOLUMEDOWN>;
};

&pm8916_vib {
	status = "okay";
};

&pronto {
	status = "okay";
};

&sdhc_1 {
	status = "okay";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
};

&sdhc_2 {
	status = "okay";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;

	cd-gpios = <&msmgpio 38 GPIO_ACTIVE_LOW>;
};

&usb {
	status = "okay";
	extcon = <&usb_id>, <&usb_id>;
};

&usb_hs_phy {
	extcon = <&usb_id>;
};

&smd_rpm_regulators {
	vdd_l1_l2_l3-supply = <&pm8916_s3>;
	vdd_l4_l5_l6-supply = <&pm8916_s4>;
	vdd_l7-supply = <&pm8916_s4>;

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

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

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

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

	l4 {
		regulator-min-microvolt = <2050000>;
		regulator-max-microvolt = <2050000>;
	};

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

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

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

	l8 {
		regulator-min-microvolt = <2850000>;
		regulator-max-microvolt = <2900000>;
	};

	l9 {
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	l10 {
		regulator-min-microvolt = <2700000>;
		regulator-max-microvolt = <2800000>;
	};

	l11 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2950000>;
		regulator-allow-set-load;
		regulator-system-load = <200000>;
	};

	l12 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2950000>;
	};

	l13 {
		regulator-min-microvolt = <3075000>;
		regulator-max-microvolt = <3075000>;
	};

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

	l15 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;
	};

	l16 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;
	};

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

	l18 {
		regulator-min-microvolt = <2700000>;
		regulator-max-microvolt = <2700000>;
	};
};

&msmgpio {
	button_backlight_default: button-backlight-default-state {
		pins = "gpio17";
		function = "gpio";

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

	gpio_keys_default: gpio-keys-default-state {
		pins = "gpio107";
		function = "gpio";

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

	mag_reset_default: mag-reset-default-state {
		pins = "gpio111";
		function = "gpio";

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

	usb_id_default: usb-id-default-state {
		pins = "gpio110";
		function = "gpio";

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


code:
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
 */

/dts-v1/;

#include "msm8916-pm8916.dtsi"

/ {
	model = "Qualcomm Technologies, Inc. MSM 8916 MTP";
	compatible = "qcom,msm8916-mtp", "qcom,msm8916-mtp/1", "qcom,msm8916";

	aliases {
		serial0 = &blsp1_uart2;
		usid0 = &pm8916_0;
	};

	chosen {
		stdout-path = "serial0";
	};
};

&blsp1_uart2 {
	status = "okay";
};


code:
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 */

&msmgpio {

	blsp1_uart1_default: blsp1-uart1-default-state {
		/* TX, RX, CTS_N, RTS_N */
		pins = "gpio0", "gpio1", "gpio2", "gpio3";
		function = "blsp_uart1";

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

	blsp1_uart1_sleep: blsp1-uart1-sleep-state {
		pins = "gpio0", "gpio1", "gpio2", "gpio3";
		function = "gpio";

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

	blsp1_uart2_default: blsp1-uart2-default-state {
		pins = "gpio4", "gpio5";
		function = "blsp_uart2";

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

	blsp1_uart2_sleep: blsp1-uart2-sleep-state {
		pins = "gpio4", "gpio5";
		function = "gpio";

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

	spi1_default: spi1-default-state {
		spi-pins {
			pins = "gpio0", "gpio1", "gpio3";
			function = "blsp_spi1";

			drive-strength = <12>;
			bias-disable;
		};
		cs-pins {
			pins = "gpio2";
			function = "gpio";

			drive-strength = <16>;
			bias-disable;
			output-high;
		};
	};

	spi1_sleep: spi1-sleep-state {
		pins = "gpio0", "gpio1", "gpio2", "gpio3";
		function = "gpio";

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

	spi2_default: spi2-default-state {
		spi-pins {
			pins = "gpio4", "gpio5", "gpio7";
			function = "blsp_spi2";

			drive-strength = <12>;
			bias-disable;
		};
		cs-pins {
			pins = "gpio6";
			function = "gpio";

			drive-strength = <16>;
			bias-disable;
			output-high;
		};
	};

	spi2_sleep: spi2-sleep-state {
		pins = "gpio4", "gpio5", "gpio6", "gpio7";
		function = "gpio";

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

	spi3_default: spi3-default-state {
		spi-pins {
			pins = "gpio8", "gpio9", "gpio11";
			function = "blsp_spi3";

			drive-strength = <12>;
			bias-disable;
		};
		cs-pins {
			pins = "gpio10";
			function = "gpio";

			drive-strength = <16>;
			bias-disable;
			output-high;
		};
	};

	spi3_sleep: spi3-sleep-state {
		pins = "gpio8", "gpio9", "gpio10", "gpio11";
		function = "gpio";

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

	spi4_default: spi4-default-state {
		spi-pins {
			pins = "gpio12", "gpio13", "gpio15";
			function = "blsp_spi4";

			drive-strength = <12>;
			bias-disable;
		};
		cs-pins {
			pins = "gpio14";
			function = "gpio";

			drive-strength = <16>;
			bias-disable;
			output-high;
		};
	};

	spi4_sleep: spi4-sleep-state {
		pins = "gpio12", "gpio13", "gpio14", "gpio15";
		function = "gpio";

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

	spi5_default: spi5-default-state {
		spi-pins {
			pins = "gpio16", "gpio17", "gpio19";
			function = "blsp_spi5";

			drive-strength = <12>;
			bias-disable;
		};
		cs-pins {
			pins = "gpio18";
			function = "gpio";

			drive-strength = <16>;
			bias-disable;
			output-high;
		};
	};

	spi5_sleep: spi5-sleep-state {
		pins = "gpio16", "gpio17", "gpio18", "gpio19";
		function = "gpio";

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

	spi6_default: spi6-default-state {
		spi-pins {
			pins = "gpio20", "gpio21", "gpio23";
			function = "blsp_spi6";

			drive-strength = <12>;
			bias-disable;
		};
		cs-pins {
			pins = "gpio22";
			function = "gpio";

			drive-strength = <16>;
			bias-disable;
			output-high;
		};
	};

	spi6_sleep: spi6-sleep-state {
		pins = "gpio20", "gpio21", "gpio22", "gpio23";
		function = "gpio";

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

	i2c1_default: i2c1-default-state {
		pins = "gpio2", "gpio3";
		function = "blsp_i2c1";

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

	i2c1_sleep: i2c1-sleep-state {
		pins = "gpio2", "gpio3";
		function = "gpio";

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

	i2c2_default: i2c2-default-state {
		pins = "gpio6", "gpio7";
		function = "blsp_i2c2";

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

	i2c2_sleep: i2c2-sleep-state {
		pins = "gpio6", "gpio7";
		function = "gpio";

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

	i2c3_default: i2c3-default-state {
		pins = "gpio10", "gpio11";
		function = "blsp_i2c3";

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

	i2c3_sleep: i2c3-sleep-state {
		pins = "gpio10", "gpio11";
		function = "gpio";

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

	i2c4_default: i2c4-default-state {
		pins = "gpio14", "gpio15";
		function = "blsp_i2c4";

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

	i2c4_sleep: i2c4-sleep-state {
		pins = "gpio14", "gpio15";
		function = "gpio";

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

	i2c5_default: i2c5-default-state {
		pins = "gpio18", "gpio19";
		function = "blsp_i2c5";

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

	i2c5_sleep: i2c5-sleep-state {
		pins = "gpio18", "gpio19";
		function = "gpio";

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

	i2c6_default: i2c6-default-state {
		pins = "gpio22", "gpio23";
		function = "blsp_i2c6";

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

	i2c6_sleep: i2c6-sleep-state {
		pins = "gpio22", "gpio23";
		function = "gpio";

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

	pmx-sdc1-clk-state {
		sdc1_clk_on: clk-on-pins {
			pins = "sdc1_clk";

			bias-disable;
			drive-strength = <16>;
		};
		sdc1_clk_off: clk-off-pins {
			pins = "sdc1_clk";

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

	pmx-sdc1-cmd-state {
		sdc1_cmd_on: cmd-on-pins {
			pins = "sdc1_cmd";

			bias-pull-up;
			drive-strength = <10>;
		};
		sdc1_cmd_off: cmd-off-pins {
			pins = "sdc1_cmd";

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

	pmx-sdc1-data-state {
		sdc1_data_on: data-on-pins {
			pins = "sdc1_data";

			bias-pull-up;
			drive-strength = <10>;
		};
		sdc1_data_off: data-off-pins {
			pins = "sdc1_data";

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

	pmx-sdc2-clk-state {
		sdc2_clk_on: clk-on-pins {
			pins = "sdc2_clk";

			bias-disable;
			drive-strength = <16>;
		};
		sdc2_clk_off: clk-off-pins {
			pins = "sdc2_clk";

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

	pmx-sdc2-cmd-state {
		sdc2_cmd_on: cmd-on-pins {
			pins = "sdc2_cmd";

			bias-pull-up;
			drive-strength = <10>;
		};
		sdc2_cmd_off: cmd-off-pins {
			pins = "sdc2_cmd";

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

	pmx-sdc2-data-state {
		sdc2_data_on: data-on-pins {
			pins = "sdc2_data";

			bias-pull-up;
			drive-strength = <10>;
		};
		sdc2_data_off: data-off-pins {
			pins = "sdc2_data";

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

	pmx-sdc2-cd-pin-state {
		sdc2_cd_on: cd-on-pins {
			pins = "gpio38";
			function = "gpio";

			drive-strength = <2>;
			bias-pull-up;
		};
		sdc2_cd_off: cd-off-pins {
			pins = "gpio38";
			function = "gpio";

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

	cdc-pdm-lines-state {
		cdc_pdm_lines_act: pdm-lines-on-pins {
			pins = "gpio63", "gpio64", "gpio65", "gpio66",
			       "gpio67", "gpio68";
			function = "cdc_pdm0";

			drive-strength = <8>;
			bias-disable;
		};
		cdc_pdm_lines_sus: pdm-lines-off-pins {
			pins = "gpio63", "gpio64", "gpio65", "gpio66",
			       "gpio67", "gpio68";
			function = "cdc_pdm0";

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

	ext-pri-tlmm-lines-state {
		ext_pri_tlmm_lines_act: ext-pa-on-pins {
			pins = "gpio113", "gpio114", "gpio115", "gpio116";
			function = "pri_mi2s";

			drive-strength = <8>;
			bias-disable;
		};
		ext_pri_tlmm_lines_sus: ext-pa-off-pins {
			pins = "gpio113", "gpio114", "gpio115", "gpio116";
			function = "pri_mi2s";

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

	ext-pri-ws-line-state {
		ext_pri_ws_act: ext-pa-on-pins {
			pins = "gpio110";
			function = "pri_mi2s_ws";

			drive-strength = <8>;
			bias-disable;
		};
		ext_pri_ws_sus: ext-pa-off-pins {
			pins = "gpio110";
			function = "pri_mi2s_ws";

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

	ext-mclk-tlmm-lines-state {
		ext_mclk_tlmm_lines_act: mclk-lines-on-pins {
			pins = "gpio116";
			function = "pri_mi2s";

			drive-strength = <8>;
			bias-disable;
		};
		ext_mclk_tlmm_lines_sus: mclk-lines-off-pins {
			pins = "gpio116";
			function = "pri_mi2s";

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

	/* secondary Mi2S */
	ext-sec-tlmm-lines-state {
		ext_sec_tlmm_lines_act: tlmm-lines-on-pins {
			pins = "gpio112", "gpio117", "gpio118", "gpio119";
			function = "sec_mi2s";

			drive-strength = <8>;
			bias-disable;
		};
		ext_sec_tlmm_lines_sus: tlmm-lines-off-pins {
			pins = "gpio112", "gpio117", "gpio118", "gpio119";
			function = "sec_mi2s";

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

	cdc_dmic_lines_act: cdc-dmic-lines-on-state {
		clk-pins {
			pins = "gpio0";
			function = "dmic0_clk";

			drive-strength = <8>;
		};
		data-pins {
			pins = "gpio1";
			function = "dmic0_data";

			drive-strength = <8>;
		};
	};
	cdc_dmic_lines_sus: cdc-dmic-lines-off-state {
		clk-pins {
			pins = "gpio0";
			function = "dmic0_clk";

			drive-strength = <2>;
			bias-disable;
		};
		data-pins {
			pins = "gpio1";
			function = "dmic0_data";

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

	wcnss_pin_a: wcnss-active-state {
		pins = "gpio40", "gpio41", "gpio42", "gpio43", "gpio44";
		function = "wcss_wlan";

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

	cci0_default: cci0-default-state {
		pins = "gpio29", "gpio30";
		function = "cci_i2c";

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

	camera_front_default: camera-front-default-state {
		pwdn-pins {
			pins = "gpio33";
			function = "gpio";

			drive-strength = <16>;
			bias-disable;
		};
		rst-pins {
			pins = "gpio28";
			function = "gpio";

			drive-strength = <16>;
			bias-disable;
		};
		mclk1-pins {
			pins = "gpio27";
			function = "cam_mclk1";

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

	camera_rear_default: camera-rear-default-state {
		pwdn-pins {
			pins = "gpio34";
			function = "gpio";

			drive-strength = <16>;
			bias-disable;
		};
		rst-pins {
			pins = "gpio35";
			function = "gpio";

			drive-strength = <16>;
			bias-disable;
		};
		mclk0-pins {
			pins = "gpio26";
			function = "cam_mclk0";

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


code:
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8916-pm8916.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>

/ {
	aliases {
		serial0 = &blsp1_uart2;
	};

	chosen {
		stdout-path = "serial0";
	};

	reserved-memory {
		/* Additional memory used by Samsung firmware modifications */
		tz-apps@85500000 {
			reg = <0x0 0x85500000 0x0 0xb00000>;
			no-map;
		};
	};

	clk_pwm: pwm {
		compatible = "clk-pwm";
		#pwm-cells = <2>;

		clocks = <&gcc GCC_GP2_CLK>;

		pinctrl-names = "default";
		pinctrl-0 = <&motor_pwm_default>;
		status = "disabled";
	};

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

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

		label = "GPIO Buttons";

		button-volume-up {
			label = "Volume Up";
			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEUP>;
		};

		button-home {
			label = "Home";
			gpios = <&msmgpio 109 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_HOMEPAGE>;
		};
	};

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

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

		label = "GPIO Hall Effect Sensor";

		event-hall-sensor {
			label = "Hall Effect Sensor";
			gpios = <&msmgpio 52 GPIO_ACTIVE_LOW>;
			linux,input-type = <EV_SW>;
			linux,code = <SW_LID>;
			linux,can-disable;
		};
	};

	/*
	 * NOTE: A5 connects GPIO 76 to a reglator powering the motor
	 * driver IC but A3 connects the same signal to an ENABLE pin of
	 * the driver.
	 */
	reg_motor_vdd: regulator-motor-vdd {
		compatible = "regulator-fixed";
		regulator-name = "motor_vdd";
		regulator-min-microvolt = <3000000>;
		regulator-max-microvolt = <3000000>;

		gpio = <&msmgpio 76 GPIO_ACTIVE_HIGH>;
		enable-active-high;

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

	reg_vdd_tsp_a: regulator-vdd-tsp-a {
		compatible = "regulator-fixed";
		regulator-name = "vdd_tsp_a";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		gpio = <&msmgpio 73 GPIO_ACTIVE_HIGH>;
		enable-active-high;

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

	i2c-muic {
		compatible = "i2c-gpio";
		sda-gpios = <&msmgpio 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		scl-gpios = <&msmgpio 106 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;

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

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

		muic: extcon@25 {
			compatible = "siliconmitus,sm5502-muic";

			reg = <0x25>;
			interrupt-parent = <&msmgpio>;
			interrupts = <12 IRQ_TYPE_EDGE_FALLING>;

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

	i2c-tkey {
		compatible = "i2c-gpio";
		sda-gpios = <&msmgpio 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		scl-gpios = <&msmgpio 17 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;

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

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

		touchkey: touchkey@20 {
			/* Note: Actually an ABOV MCU that implements same interface */
			compatible = "coreriver,tc360-touchkey";
			reg = <0x20>;

			interrupt-parent = <&msmgpio>;
			interrupts = <98 IRQ_TYPE_EDGE_FALLING>;

			/* vcc/vdd-supply are board-specific */
			vddio-supply = <&pm8916_l6>;

			linux,keycodes = <KEY_APPSELECT KEY_BACK>;

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

	i2c-nfc {
		compatible = "i2c-gpio";
		sda-gpios = <&msmgpio 0 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		scl-gpios = <&msmgpio 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;

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

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

		nfc@27 {
			compatible = "samsung,s3fwrn5-i2c";
			reg = <0x27>;

			interrupt-parent = <&msmgpio>;
			interrupts = <21 IRQ_TYPE_EDGE_RISING>;

			en-gpios = <&msmgpio 20 GPIO_ACTIVE_LOW>;
			wake-gpios = <&msmgpio 49 GPIO_ACTIVE_HIGH>;

			clocks = <&rpmcc RPM_SMD_BB_CLK2_PIN>;

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

	vibrator: vibrator {
		compatible = "pwm-vibrator";

		pwms = <&clk_pwm 0 100000>;
		pwm-names = "enable";

		vcc-supply = <&reg_motor_vdd>;
		status = "disabled";
	};
};

&blsp_i2c2 {
	status = "okay";

	accelerometer: accelerometer@10 {
		compatible = "bosch,bmc150_accel";
		reg = <0x10>;
		interrupt-parent = <&msmgpio>;
		interrupts = <115 IRQ_TYPE_EDGE_RISING>;

		vdd-supply = <&pm8916_l17>;
		vddio-supply = <&pm8916_l5>;

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

	magnetometer@12 {
		compatible = "bosch,bmc150_magn";
		reg = <0x12>;

		vdd-supply = <&pm8916_l17>;
		vddio-supply = <&pm8916_l5>;
	};
};

&blsp_i2c4 {
	status = "okay";

	battery@35 {
		compatible = "richtek,rt5033-battery";
		reg = <0x35>;
		interrupt-parent = <&msmgpio>;
		interrupts = <121 IRQ_TYPE_EDGE_BOTH>;

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

&blsp1_uart2 {
	status = "okay";
};

&dsi0 {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&mdss_default>;
	pinctrl-1 = <&mdss_sleep>;
};

&mdss {
	status = "okay";
};

&pm8916_resin {
	status = "okay";
	linux,code = <KEY_VOLUMEDOWN>;
};

&pronto {
	status = "okay";
};

&sdhc_1 {
	status = "okay";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
};

&sdhc_2 {
	status = "okay";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;

	cd-gpios = <&msmgpio 38 GPIO_ACTIVE_LOW>;
};

&usb {
	status = "okay";
	extcon = <&muic>, <&muic>;
};

&usb_hs_phy {
	extcon = <&muic>;
};

&smd_rpm_regulators {
	vdd_l1_l2_l3-supply = <&pm8916_s3>;
	vdd_l4_l5_l6-supply = <&pm8916_s4>;
	vdd_l7-supply = <&pm8916_s4>;

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

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

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

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

	l4 {
		regulator-min-microvolt = <2050000>;
		regulator-max-microvolt = <2050000>;
	};

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

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

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

	l8 {
		regulator-min-microvolt = <2850000>;
		regulator-max-microvolt = <2900000>;
	};

	l9 {
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	l10 {
		regulator-min-microvolt = <2700000>;
		regulator-max-microvolt = <2800000>;
	};

	l11 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2950000>;
		regulator-allow-set-load;
		regulator-system-load = <200000>;
	};

	l12 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2950000>;
	};

	l13 {
		regulator-min-microvolt = <3075000>;
		regulator-max-microvolt = <3075000>;
	};

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

	l15 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;
	};

	l16 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;
	};

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

	l18 {
		regulator-min-microvolt = <2700000>;
		regulator-max-microvolt = <2700000>;
	};
};

&msmgpio {
	accel_int_default: accel-int-default-state {
		pins = "gpio115";
		function = "gpio";

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

	fg_alert_default: fg-alert-default-state {
		pins = "gpio121";
		function = "gpio";

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

	gpio_keys_default: gpio-keys-default-state {
		pins = "gpio107", "gpio109";
		function = "gpio";

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

	gpio_hall_sensor_default: gpio-hall-sensor-default-state {
		pins = "gpio52";
		function = "gpio";

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

	mdss_default: mdss-default-state {
		pins = "gpio25";
		function = "gpio";

		drive-strength = <8>;
		bias-disable;
	};
	mdss_sleep: mdss-sleep-state {
		pins = "gpio25";
		function = "gpio";

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

	motor_en_default: motor-en-default-stae {
		pins = "gpio76";
		function = "gpio";

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

	motor_pwm_default: motor-pwm-default-state {
		pins = "gpio50";
		function = "gcc_gp2_clk_a";
	};

	muic_i2c_default: muic-i2c-default-state {
		pins = "gpio105", "gpio106";
		function = "gpio";

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

	muic_int_default: muic-int-default-state {
		pins = "gpio12";
		function = "gpio";

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

	nfc_default: nfc-default-state {
		nfc-pins {
			pins = "gpio20", "gpio49";
			function = "gpio";

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

		irq-pins {
			pins = "gpio21";
			function = "gpio";

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

	nfc_i2c_default: nfc-i2c-default-state {
		pins = "gpio0", "gpio1";
		function = "gpio";

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

	tkey_default: tkey-default-state {
		pins = "gpio98";
		function = "gpio";

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

	tkey_i2c_default: tkey-i2c-default-state {
		pins = "gpio16", "gpio17";
		function = "gpio";

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

	tsp_en_default: tsp-en-default-state {
		pins = "gpio73";
		function = "gpio";

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

	ts_int_default: ts-int-default-state {
		pins = "gpio13";
		function = "gpio";

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

&pm8916_gpios {
	nfc_clk_req: nfc-clk-req-state {
		pins = "gpio2";
		function = "func1";

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


code:
// SPDX-License-Identifier: GPL-2.0-only

/dts-v1/;

#include "msm8916-samsung-a2015-common.dtsi"

/ {
	model = "Samsung Galaxy A3U (EUR)";
	compatible = "samsung,a3u-eur", "qcom,msm8916";
	chassis-type = "handset";

	reg_panel_vdd3: regulator-panel-vdd3 {
		compatible = "regulator-fixed";
		regulator-name = "panel_vdd3";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;

		gpio = <&msmgpio 9 GPIO_ACTIVE_HIGH>;
		enable-active-high;

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

	reg_touch_key: regulator-touch-key {
		compatible = "regulator-fixed";
		regulator-name = "touch_key";
		regulator-min-microvolt = <2800000>;
		regulator-max-microvolt = <2800000>;

		gpio = <&msmgpio 86 GPIO_ACTIVE_HIGH>;
		enable-active-high;

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

	reg_key_led: regulator-key-led {
		compatible = "regulator-fixed";
		regulator-name = "key_led";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		gpio = <&msmgpio 60 GPIO_ACTIVE_HIGH>;
		enable-active-high;

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

&touchkey {
	vcc-supply = <&reg_touch_key>;
	vdd-supply = <&reg_key_led>;
};

&accelerometer {
	mount-matrix = "0", "1", "0",
		       "1", "0", "0",
		       "0", "0", "1";
};

&blsp_i2c5 {
	status = "okay";

	touchscreen@20 {
		compatible = "zinitix,bt541";

		reg = <0x20>;
		interrupt-parent = <&msmgpio>;
		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;

		touchscreen-size-x = <540>;
		touchscreen-size-y = <960>;

		vcca-supply = <&reg_vdd_tsp_a>;
		vdd-supply = <&pm8916_l6>;

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

&clk_pwm {
	status = "okay";
};

&dsi0 {
	panel@0 {
		reg = <0>;

		compatible = "samsung,s6e88a0-ams452ef01";

		vdd3-supply = <&reg_panel_vdd3>;
		vci-supply = <&pm8916_l17>;
		reset-gpios = <&msmgpio 25 GPIO_ACTIVE_HIGH>;

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

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

&vibrator {
	status = "okay";
};

&msmgpio {
	panel_vdd3_default: panel-vdd3-default-state {
		pins = "gpio9";
		function = "gpio";

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

	tkey_en_default: tkey-en-default-state {
		pins = "gpio86";
		function = "gpio";

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

	tkey_led_en_default: tkey-led-en-default-state {
		pins = "gpio60";
		function = "gpio";

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


code:
// SPDX-License-Identifier: GPL-2.0-only

/dts-v1/;

#include "msm8916-samsung-a2015-common.dtsi"

/ {
	model = "Samsung Galaxy A5U (EUR)";
	compatible = "samsung,a5u-eur", "qcom,msm8916";
	chassis-type = "handset";

	reg_touch_key: regulator-touch-key {
		compatible = "regulator-fixed";
		regulator-name = "touch_key";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		gpio = <&msmgpio 97 GPIO_ACTIVE_HIGH>;
		enable-active-high;

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

&accelerometer {
	mount-matrix = "-1", "0", "0",
			"0", "1", "0",
			"0", "0", "1";
};

&blsp_i2c5 {
	status = "okay";

	touchscreen@48 {
		compatible = "melfas,mms345l";

		reg = <0x48>;
		interrupt-parent = <&msmgpio>;
		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;

		touchscreen-size-x = <720>;
		touchscreen-size-y = <1280>;

		avdd-supply = <&reg_vdd_tsp_a>;
		vdd-supply = <&pm8916_l6>;

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

&clk_pwm {
	status = "okay";
};

&pronto {
	iris {
		compatible = "qcom,wcn3660b";
	};
};

&touchkey {
	vcc-supply = <&reg_touch_key>;
	vdd-supply = <&reg_touch_key>;
};

&vibrator {
	status = "okay";
};

&msmgpio {
	tkey_en_default: tkey-en-default-state {
		pins = "gpio97";
		function = "gpio";

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


code:
// SPDX-License-Identifier: GPL-2.0-only

#include "msm8916-samsung-a2015-common.dtsi"

/ {
	haptic {
		compatible = "regulator-haptic";
		haptic-supply = <&reg_motor_vdd>;
		min-microvolt = <3300000>;
		max-microvolt = <3300000>;
	};

	i2c-muic {
		/* SM5504 MUIC instead of SM5502 */
		/delete-node/ extcon@25;

		muic: extcon@14 {
			compatible = "siliconmitus,sm5504-muic";
			reg = <0x14>;

			interrupt-parent = <&msmgpio>;
			interrupts = <12 IRQ_TYPE_EDGE_FALLING>;

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

	reg_touch_key: regulator-touch-key {
		compatible = "regulator-fixed";
		regulator-name = "touch_key";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		gpio = <&msmgpio 97 GPIO_ACTIVE_HIGH>;
		enable-active-high;

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

&blsp_i2c2 {
	/* lis2hh12 accelerometer instead of BMC150 */
	status = "disabled";

	/delete-node/ accelerometer@10;
	/delete-node/ magnetometer@12;
};

&reg_motor_vdd {
	regulator-min-microvolt = <3300000>;
	regulator-max-microvolt = <3300000>;
};

&touchkey {
	vcc-supply = <&reg_touch_key>;
	vdd-supply = <&reg_touch_key>;
};

&msmgpio {
	tkey_en_default: tkey-en-default-state {
		pins = "gpio97";
		function = "gpio";

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


code:
// SPDX-License-Identifier: GPL-2.0-only

/dts-v1/;

#include "msm8916-samsung-e2015-common.dtsi"

/*
 * NOTE: The original firmware from Samsung can only boot ARM32 kernels on some
 * variants.
 * Unfortunately, the firmware is signed and cannot be replaced easily.
 * There seems to be no way to boot ARM64 kernels on 32-bit devices at the
 * moment, even though the hardware would support it.
 *
 * However, it is possible to use this device tree by compiling an ARM32 kernel
 * instead. For clarity and build testing this device tree is maintained next
 * to the other MSM8916 device trees. However, it is actually used through
 * arch/arm/boot/dts/qcom-msm8916-samsung-e5.dts
 */

/ {
	model = "Samsung Galaxy E5";
	compatible = "samsung,e5", "qcom,msm8916";
	chassis-type = "handset";
};


code:
// SPDX-License-Identifier: GPL-2.0-only

/dts-v1/;

#include "msm8916-samsung-e2015-common.dtsi"

/*
 * NOTE: The original firmware from Samsung can only boot ARM32 kernels on some
 * variants.
 * Unfortunately, the firmware is signed and cannot be replaced easily.
 * There seems to be no way to boot ARM64 kernels on 32-bit devices at the
 * moment, even though the hardware would support it.
 *
 * However, it is possible to use this device tree by compiling an ARM32 kernel
 * instead. For clarity and build testing this device tree is maintained next
 * to the other MSM8916 device trees. However, it is actually used through
 * arch/arm/boot/dts/qcom-msm8916-samsung-e7.dts
 */

/ {
	model = "Samsung Galaxy E7";
	compatible = "samsung,e7", "qcom,msm8916";
	chassis-type = "handset";
};

&pm8916_l17 {
	regulator-min-microvolt = <3000000>;
	regulator-max-microvolt = <3000000>;
};


code:
// SPDX-License-Identifier: GPL-2.0-only

/dts-v1/;

#include "msm8916-samsung-e2015-common.dtsi"
#include <dt-bindings/leds/common.h>

/*
 * NOTE: The original firmware from Samsung can only boot ARM32 kernels on some
 * variants.
 * Unfortunately, the firmware is signed and cannot be replaced easily.
 * There seems to be no way to boot ARM64 kernels on 32-bit devices at the
 * moment, even though the hardware would support it.
 *
 * However, it is possible to use this device tree by compiling an ARM32 kernel
 * instead. For clarity and build testing this device tree is maintained next
 * to the other MSM8916 device trees. However, it is actually used through
 * arch/arm/boot/dts/qcom-msm8916-samsung-grandmax.dts
 */

/ {
	model = "Samsung Galaxy Grand Max";
	compatible = "samsung,grandmax", "qcom,msm8916";
	chassis-type = "handset";

	/delete-node/ gpio-hall-sensor;
	/delete-node/ i2c-nfc;
	/delete-node/ i2c-tkey;

	gpio-leds {
		compatible = "gpio-leds";
		keyled {
			gpios = <&msmgpio 60 GPIO_ACTIVE_HIGH>;
			pinctrl-names = "default";
			pinctrl-0 = <&gpio_leds_default>;
		};
	};
};

&reg_motor_vdd {
	gpio = <&msmgpio 72 GPIO_ACTIVE_HIGH>;
};

&reg_touch_key {
	status = "disabled";
};

&msmgpio {
	gpio_leds_default: gpio-led-default-state {
		pins = "gpio60";
		function = "gpio";

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

&motor_en_default {
	pins = "gpio72";
};


code:
// SPDX-License-Identifier: GPL-2.0-only

/dts-v1/;

#include "msm8916-pm8916.dtsi"
#include <dt-bindings/gpio/gpio.h>

/ {
	model = "Samsung Galaxy J5 (2015)";
	compatible = "samsung,j5", "qcom,msm8916";
	chassis-type = "handset";

	aliases {
		serial0 = &blsp1_uart2;
	};

	chosen {
		stdout-path = "serial0";
	};

	reserved-memory {
		/* Additional memory used by Samsung firmware modifications */
		tz-apps@85500000 {
			reg = <0x0 0x85500000 0x0 0xb00000>;
			no-map;
		};
	};

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

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

		label = "GPIO Buttons";

		button-volume-up {
			label = "Volume Up";
			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEUP>;
		};

		button-home {
			label = "Home Key";
			gpios = <&msmgpio 109 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_HOMEPAGE>;
		};
	};
};

&blsp1_uart2 {
	status = "okay";
};

&pm8916_resin {
	status = "okay";
	linux,code = <KEY_VOLUMEDOWN>;
};

/* FIXME: Replace with SM5703 MUIC when driver is available */
&pm8916_usbin {
	status = "okay";
};

&pronto {
	status = "okay";
};

&sdhc_1 {
	status = "okay";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
};

&sdhc_2 {
	status = "okay";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;

	cd-gpios = <&msmgpio 38 GPIO_ACTIVE_LOW>;
};

&usb {
	status = "okay";
	dr_mode = "peripheral";
	extcon = <&pm8916_usbin>;
};

&usb_hs_phy {
	extcon = <&pm8916_usbin>;
	qcom,init-seq = /bits/ 8 <0x1 0x19 0x2 0x0b>;
};

&smd_rpm_regulators {
	vdd_l1_l2_l3-supply = <&pm8916_s3>;
	vdd_l4_l5_l6-supply = <&pm8916_s4>;
	vdd_l7-supply = <&pm8916_s4>;

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

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

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

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

	l4 {
		regulator-min-microvolt = <2050000>;
		regulator-max-microvolt = <2050000>;
	};

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

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

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

	l8 {
		regulator-min-microvolt = <2850000>;
		regulator-max-microvolt = <2900000>;
	};

	l9 {
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	l10 {
		regulator-min-microvolt = <2700000>;
		regulator-max-microvolt = <2800000>;
	};

	l11 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2950000>;
		regulator-allow-set-load;
		regulator-system-load = <200000>;
	};

	l12 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <2950000>;
	};

	l13 {
		regulator-min-microvolt = <3075000>;
		regulator-max-microvolt = <3075000>;
	};

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

	l15 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;
	};

	l16 {
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;
	};

	l17 {
		regulator-min-microvolt = <3000000>;
		regulator-max-microvolt = <3000000>;
	};

	l18 {
		regulator-min-microvolt = <2700000>;
		regulator-max-microvolt = <2700000>;
	};
};

&msmgpio {
	gpio_keys_default: gpio-keys-default-state {
		pins = "gpio107", "gpio109";
		function = "gpio";

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