code:
// SPDX-License-Identifier: BSD-3-Clause
/*
 * Copyright (c) 2022, Luca Weiss <luca@z3ntu.xyz>
 */

/dts-v1/;

#include "qcom-msm8226.dtsi"
#include "qcom-pm8226.dtsi"

/delete-node/ &adsp_region;

/ {
	model = "Huawei Watch";
	compatible = "huawei,sturgeon", "qcom,apq8026";
	chassis-type = "watch";
	qcom,msm-id = <199 0x20000>;
	qcom,board-id = <8 4>;

	reserved-memory {
		sbl_region: sbl@2f00000 {
			reg = <0x02f00000 0x100000>;
			no-map;
		};

		external_image_region: external-image@3100000 {
			reg = <0x3100000 0x200000>;
			no-map;
		};

		peripheral_region: peripheral@3300000 {
			reg = <0x3300000 0x600000>;
			no-map;
		};

		adsp_region: adsp@3900000 {
			reg = <0x3900000 0x1400000>;
			no-map;
		};

		modem_region: modem@4d00000 {
			reg = <0x4d00000 0x1b00000>;
			no-map;
		};

		modem_efs_region: modem-efs@7f00000 {
			reg = <0x7f00000 0x100000>;
			no-map;
		};
	};

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

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

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

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

&adsp {
	status = "okay";
};

&blsp1_i2c5 {
	clock-frequency = <384000>;

	status = "okay";

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

		interrupts-extended = <&tlmm 17 IRQ_TYPE_EDGE_FALLING>;
		vdd-supply = <&pm8226_l19>;
		vio-supply = <&pm8226_lvs1>;

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

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

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

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

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

&blsp1_uart4 {
	pinctrl-names = "default";
	pinctrl-0 = <&blsp1_uart4_default_state>;

	status = "okay";

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

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

		host-wakeup-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
		device-wakeup-gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>;
		shutdown-gpios = <&tlmm 67 GPIO_ACTIVE_HIGH>;
	};
};

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

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

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

		pm8226_s5: s5 {
			regulator-min-microvolt = <1150000>;
			regulator-max-microvolt = <1150000>;
		};

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

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

		pm8226_l3: l3 {
			regulator-min-microvolt = <750000>;
			regulator-max-microvolt = <1337500>;
		};

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

		pm8226_l5: l5 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
		};

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

		pm8226_l7: l7 {
			regulator-min-microvolt = <1850000>;
			regulator-max-microvolt = <1850000>;
		};

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

		pm8226_l9: l9 {
			regulator-min-microvolt = <2050000>;
			regulator-max-microvolt = <2050000>;
		};

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

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

		pm8226_l14: l14 {
			regulator-min-microvolt = <2750000>;
			regulator-max-microvolt = <2750000>;
		};

		pm8226_l15: l15 {
			regulator-min-microvolt = <2800000>;
			regulator-max-microvolt = <2800000>;
		};

		pm8226_l16: l16 {
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3350000>;
		};

		pm8226_l17: l17 {
			regulator-min-microvolt = <2950000>;
			regulator-max-microvolt = <2950000>;
		};

		pm8226_l18: l18 {
			regulator-min-microvolt = <2950000>;
			regulator-max-microvolt = <2950000>;
		};

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

		pm8226_l20: l20 {
			regulator-min-microvolt = <3075000>;
			regulator-max-microvolt = <3075000>;
		};

		pm8226_l21: l21 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
		};

		pm8226_l22: l22 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
		};

		pm8226_l23: l23 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
		};

		pm8226_l24: l24 {
			regulator-min-microvolt = <1300000>;
			regulator-max-microvolt = <1350000>;
		};

		pm8226_l25: l25 {
			regulator-min-microvolt = <1775000>;
			regulator-max-microvolt = <2125000>;
		};

		pm8226_l26: l26 {
			regulator-min-microvolt = <1225000>;
			regulator-max-microvolt = <1225000>;
		};

		pm8226_l27: l27 {
			regulator-min-microvolt = <2050000>;
			regulator-max-microvolt = <2050000>;
		};

		pm8226_l28: l28 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
		};

		pm8226_lvs1: lvs1 {};
	};
};

&sdhc_1 {
	vmmc-supply = <&pm8226_l17>;
	vqmmc-supply = <&pm8226_l6>;

	bus-width = <8>;
	non-removable;

	status = "okay";
};

&sdhc_3 {
	max-frequency = <100000000>;
	non-removable;

	vmmc-supply = <&vreg_wlan>;
	vqmmc-supply = <&pm8226_l6>;

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

	status = "okay";

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

		interrupts-extended = <&tlmm 66 IRQ_TYPE_EDGE_FALLING>;
		interrupt-names = "host-wake";

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

&smbb {
	qcom,fast-charge-safe-voltage = <4370000>;
	qcom,fast-charge-high-threshold-voltage = <4350000>;
	qcom,minimum-input-voltage = <4350000>;
	qcom,fast-charge-current-limit = <300000>;
	qcom,fast-charge-safe-current = <600000>;
	qcom,auto-recharge-threshold-voltage = <4240000>;
};

&tlmm {
	blsp1_uart4_default_state: blsp1-uart4-default-state {
		pins = "gpio12", "gpio13", "gpio14", "gpio15";
		function = "blsp_uart4";
		drive-strength = <8>;
		bias-disable;
	};

	bluetooth_default_state: bluetooth-default-state {
		pins = "gpio63", "gpio64";
		function = "gpio";
		drive-strength = <2>;
		bias-pull-down;
	};

	touch_default_state: touch-default-state {
		irq-pins {
			pins = "gpio17";
			function = "gpio";
			drive-strength = <8>;
			bias-pull-up;
		};

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

	wlan_hostwake_default_state: wlan-hostwake-default-state {
		pins = "gpio66";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
		input-enable;
	};

	wlan_regulator_default_state: wlan-regulator-default-state {
		pins = "gpio110";
		function = "gpio";
		drive-strength = <2>;
		bias-pull-down;
	};
};

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

&usb_hs_phy {
	extcon = <&smbb>;
	v1p8-supply = <&pm8226_l10>;
	v3p3-supply = <&pm8226_l20>;
};


code:
// SPDX-License-Identifier: BSD-3-Clause
/*
 * Copyright (c) 2021, Luca Weiss <luca@z3ntu.xyz>
 */

/dts-v1/;

#include "qcom-msm8226.dtsi"
#include "qcom-pm8226.dtsi"

/delete-node/ &adsp_region;

/ {
	model = "LG G Watch R";
	compatible = "lg,lenok", "qcom,apq8026";
	chassis-type = "watch";
	qcom,board-id = <132 0x0a>;
	qcom,msm-id = <199 0x20000>;

	aliases {
		serial0 = &blsp1_uart3;
		serial1 = &blsp1_uart4;
	};

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

	reserved-memory {
		adsp_region: adsp@3300000 {
			reg = <0x03300000 0x1400000>;
			no-map;
		};
	};

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

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

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

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

&adsp {
	status = "okay";
};

&blsp1_i2c1 {
	status = "okay";

	fuel-gauge@55 {
		compatible = "ti,bq27421";
		reg = <0x55>;
	};
};

&blsp1_i2c5 {
	status = "okay";
	clock-frequency = <384000>;

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

		interrupts-extended = <&tlmm 17 IRQ_TYPE_EDGE_FALLING>;
		vdd-supply = <&pm8226_l15>;
		vio-supply = <&pm8226_l22>;

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

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

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

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

&blsp1_uart3 {
	status = "okay";
};

&blsp1_uart4 {
	status = "okay";

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

	bluetooth {
		compatible = "brcm,bcm43430a0-bt";

		max-speed = <3000000>;

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

		host-wakeup-gpios = <&tlmm 48 GPIO_ACTIVE_HIGH>;
		device-wakeup-gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>;
		shutdown-gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>;
	};
};

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

		pm8226_s3: s3 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1350000>;
		};
		pm8226_s4: s4 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2200000>;
		};
		pm8226_s5: s5 {
			regulator-min-microvolt = <1150000>;
			regulator-max-microvolt = <1150000>;
		};

		pm8226_l1: l1 {
			regulator-min-microvolt = <1225000>;
			regulator-max-microvolt = <1225000>;
		};
		pm8226_l2: l2 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
		};
		pm8226_l3: l3 {
			regulator-min-microvolt = <750000>;
			regulator-max-microvolt = <1337500>;
		};
		pm8226_l4: l4 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
		};
		pm8226_l5: l5 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
		};
		pm8226_l6: l6 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};
		pm8226_l7: l7 {
			regulator-min-microvolt = <1850000>;
			regulator-max-microvolt = <1850000>;
		};
		pm8226_l8: l8 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};
		pm8226_l9: l9 {
			regulator-min-microvolt = <2050000>;
			regulator-max-microvolt = <2050000>;
		};
		pm8226_l10: l10 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};
		pm8226_l12: l12 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};
		pm8226_l14: l14 {
			regulator-min-microvolt = <2750000>;
			regulator-max-microvolt = <2750000>;
		};
		pm8226_l15: l15 {
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
		};
		pm8226_l16: l16 {
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3350000>;
		};
		pm8226_l17: l17 {
			regulator-min-microvolt = <2950000>;
			regulator-max-microvolt = <2950000>;
		};
		pm8226_l18: l18 {
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3300000>;
		};
		pm8226_l19: l19 {
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3000000>;
		};
		pm8226_l20: l20 {
			regulator-min-microvolt = <3075000>;
			regulator-max-microvolt = <3075000>;
		};
		pm8226_l21: l21 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
		};
		pm8226_l22: l22 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};
		pm8226_l23: l23 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
		};
		pm8226_l24: l24 {
			regulator-min-microvolt = <1300000>;
			regulator-max-microvolt = <1350000>;
		};
		pm8226_l25: l25 {
			regulator-min-microvolt = <1775000>;
			regulator-max-microvolt = <2125000>;
		};
		pm8226_l26: l26 {
			regulator-min-microvolt = <1225000>;
			regulator-max-microvolt = <1225000>;
		};
		pm8226_l27: l27 {
			regulator-min-microvolt = <2050000>;
			regulator-max-microvolt = <2050000>;
		};
		pm8226_l28: l28 {
			regulator-min-microvolt = <2700000>;
			regulator-max-microvolt = <3000000>;
		};

		pm8226_lvs1: lvs1 {};
	};
};

&sdhc_1 {
	status = "okay";

	vmmc-supply = <&pm8226_l17>;
	vqmmc-supply = <&pm8226_l6>;

	bus-width = <8>;
	non-removable;
};

&sdhc_3 {
	status = "okay";

	max-frequency = <100000000>;
	non-removable;

	vmmc-supply = <&vreg_wlan>;
	vqmmc-supply = <&pm8226_l6>;

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

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

		interrupts-extended = <&tlmm 37 IRQ_TYPE_EDGE_FALLING>;
		interrupt-names = "host-wake";

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

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

&tlmm {
	blsp1_uart4_default_state: blsp1-uart4-default-state {
		pins = "gpio12", "gpio13", "gpio14", "gpio15";
		function = "blsp_uart4";
		drive-strength = <8>;
		bias-disable;
	};

	bluetooth_default_state: bluetooth-default-state {
		pins = "gpio47", "gpio48";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
		input-enable;
	};

	touch_pins: touch-state {
		irq-pins {
			pins = "gpio17";
			function = "gpio";

			drive-strength = <8>;
			bias-pull-down;
			input-enable;
		};

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

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

	wlan_hostwake_default_state: wlan-hostwake-default-state {
		pins = "gpio37";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
		input-enable;
	};

	wlan_regulator_default_state: wlan-regulator-default-state {
		pins = "gpio46";
		function = "gpio";
		drive-strength = <2>;
		bias-pull-up;
	};
};

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

&usb_hs_phy {
	extcon = <&smbb>;
	v1p8-supply = <&pm8226_l10>;
	v3p3-supply = <&pm8226_l20>;
};

repo_name: angery/linux


code:
// SPDX-License-Identifier: BSD-3-Clause
/*
 * Copyright (c) 2022, Matti Lehtimäki <matti.lehtimaki@gmail.com>
 */

/dts-v1/;

#include <dt-bindings/input/input.h>
#include "qcom-msm8226.dtsi"
#include "qcom-pm8226.dtsi"

/ {
	model = "Samsung Galaxy Tab 4 10.1";
	compatible = "samsung,matisse-wifi", "qcom,apq8026";
	chassis-type = "tablet";

	aliases {
		mmc0 = &sdhc_1; /* SDC1 eMMC slot */
		mmc1 = &sdhc_2; /* SDC2 SD card slot */
		display0 = &framebuffer0;
	};

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

		stdout-path = "display0";

		framebuffer0: framebuffer@3200000 {
			compatible = "simple-framebuffer";
			reg = <0x03200000 0x800000>;
			width = <1280>;
			height = <800>;
			stride = <(1280 * 3)>;
			format = "r8g8b8";
		};
	};

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

		event-hall-sensor {
			label = "Hall Effect Sensor";
			gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>;
			interrupts = <&tlmm 110 IRQ_TYPE_EDGE_FALLING>;
			linux,input-type = <EV_SW>;
			linux,code = <SW_LID>;
			debounce-interval = <15>;
			wakeup-source;
		};
	};

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

		key-home {
			label = "Home";
			gpios = <&tlmm 108 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_HOMEPAGE>;
			debounce-interval = <15>;
		};

		key-volume-down {
			label = "Volume Down";
			gpios = <&tlmm 107 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEDOWN>;
			debounce-interval = <15>;
		};

		key-volume-up {
			label = "Volume Up";
			gpios = <&tlmm 106 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_VOLUMEUP>;
			debounce-interval = <15>;
		};
	};

	reg_tsp_1p8v: regulator-tsp-1p8v {
		compatible = "regulator-fixed";
		regulator-name = "tsp_1p8v";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;

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

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

	reg_tsp_3p3v: regulator-tsp-3p3v {
		compatible = "regulator-fixed";
		regulator-name = "tsp_3p3v";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

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

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

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

		framebuffer@3200000 {
			reg = <0x03200000 0x800000>;
			no-map;
		};

		mpss@8400000 {
			reg = <0x08400000 0x1f00000>;
			no-map;
		};

		mba@a300000 {
			reg = <0x0a300000 0x100000>;
			no-map;
		};

		reserved@cb00000 {
			reg = <0x0cb00000 0x700000>;
			no-map;
		};

		wcnss@d200000 {
			reg = <0x0d200000 0x700000>;
			no-map;
		};

		adsp@d900000 {
			reg = <0x0d900000 0x1800000>;
			no-map;
		};

		venus@f100000 {
			reg = <0x0f100000 0x500000>;
			no-map;
		};

		/delete-node/ smem@3000000;
		smem_region: smem@fa00000 {
			reg = <0x0fa00000 0x100000>;
			no-map;
		};

		reserved@fb00000 {
			reg = <0x0fb00000 0x260000>;
			no-map;
		};

		rfsa@fd60000 {
			reg = <0x0fd60000 0x20000>;
			no-map;
		};

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

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

&blsp1_i2c2 {
	status = "okay";

	accelerometer@1d {
		compatible = "st,lis2hh12";
		reg = <0x1d>;

		interrupt-parent = <&tlmm>;
		interrupts = <54 IRQ_TYPE_LEVEL_HIGH>;

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

		st,drdy-int-pin = <1>;

		vdd-supply = <&pm8226_l19>;
		vddio-supply = <&pm8226_lvs1>;
	};
};

&blsp1_i2c4 {
	status = "okay";

	muic: usb-switch@25 {
		compatible = "siliconmitus,sm5502-muic";
		reg = <0x25>;

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

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

&blsp1_i2c5 {
	status = "okay";

	touchscreen@4a {
		compatible = "atmel,maxtouch";
		reg = <0x4a>;

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

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

		reset-gpios = <&pm8226_gpios 6 GPIO_ACTIVE_LOW>;

		vdd-supply = <&reg_tsp_1p8v>;
		vdda-supply = <&reg_tsp_3p3v>;
	};
};

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

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

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

		pm8226_s5: s5 {
			regulator-min-microvolt = <1150000>;
			regulator-max-microvolt = <1150000>;
		};

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

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

		pm8226_l3: l3 {
			regulator-min-microvolt = <750000>;
			regulator-max-microvolt = <1337500>;
			regulator-always-on;
		};

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

		pm8226_l5: l5 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
		};

		pm8226_l6: l6 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-always-on;
		};

		pm8226_l7: l7 {
			regulator-min-microvolt = <1850000>;
			regulator-max-microvolt = <1850000>;
		};

		pm8226_l8: l8 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-always-on;
		};

		pm8226_l9: l9 {
			regulator-min-microvolt = <2050000>;
			regulator-max-microvolt = <2050000>;
		};

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

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

		pm8226_l14: l14 {
			regulator-min-microvolt = <2750000>;
			regulator-max-microvolt = <2750000>;
		};

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

		pm8226_l16: l16 {
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3350000>;
		};

		pm8226_l17: l17 {
			regulator-min-microvolt = <2950000>;
			regulator-max-microvolt = <2950000>;

			regulator-system-load = <200000>;
			regulator-allow-set-load;
			regulator-always-on;
		};

		pm8226_l18: l18 {
			regulator-min-microvolt = <2950000>;
			regulator-max-microvolt = <2950000>;
		};

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

		pm8226_l20: l20 {
			regulator-min-microvolt = <3075000>;
			regulator-max-microvolt = <3075000>;
		};

		pm8226_l21: l21 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
		};

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

		pm8226_l23: l23 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <3300000>;
		};

		pm8226_l24: l24 {
			regulator-min-microvolt = <1300000>;
			regulator-max-microvolt = <1350000>;
		};

		pm8226_l25: l25 {
			regulator-min-microvolt = <1775000>;
			regulator-max-microvolt = <2125000>;
		};

		pm8226_l26: l26 {
			regulator-min-microvolt = <1225000>;
			regulator-max-microvolt = <1300000>;
		};

		pm8226_l27: l27 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
		};

		pm8226_l28: l28 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2950000>;
		};

		pm8226_lvs1: lvs1 {};
	};
};

&sdhc_1 {
	vmmc-supply = <&pm8226_l17>;
	vqmmc-supply = <&pm8226_l6>;

	bus-width = <8>;
	non-removable;

	status = "okay";
};

&sdhc_2 {
	vmmc-supply = <&pm8226_l18>;
	vqmmc-supply = <&pm8226_l21>;

	bus-width = <4>;
	cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;

	status = "okay";
};

&tlmm {
	accel_int_default_state: accel-int-default-state {
		pins = "gpio54";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
	};

	muic_int_default_state: muic-int-default-state {
		pins = "gpio67";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
	};

	tsp_en_default_state: tsp-en-default-state {
		pins = "gpio31";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
	};

	tsp_en1_default_state: tsp-en1-default-state {
		pins = "gpio73";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
	};

	tsp_int_rst_default_state: tsp-int-rst-default-state {
		pins = "gpio17";
		function = "gpio";
		drive-strength = <10>;
		bias-pull-up;
	};
};

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

&usb_hs_phy {
	extcon = <&muic>;
	v1p8-supply = <&pm8226_l10>;
	v3p3-supply = <&pm8226_l20>;
};


code:
// SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
#include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
#include "qcom-msm8660.dtsi"

/ {
	model = "Qualcomm APQ8060 Dragonboard";
	compatible = "qcom,apq8060-dragonboard", "qcom,msm8660";

	aliases {
		serial0 = &gsbi12_serial;
	};

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

	regulators {
		compatible = "simple-bus";

		/* Main power of the board: 3.7V */
		vph: regulator-fixed {
			compatible = "regulator-fixed";
			regulator-min-microvolt = <3700000>;
			regulator-max-microvolt = <3700000>;
			regulator-name = "VPH";
			regulator-type = "voltage";
			regulator-always-on;
			regulator-boot-on;
		};

		/* GPIO controlled ethernet power regulator */
		dragon_veth: xc622a331mrg {
			compatible = "regulator-fixed";
			regulator-name = "XC6222A331MR-G";
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			vin-supply = <&vph>;
			gpio = <&pm8058_gpio 40 GPIO_ACTIVE_HIGH>;
			enable-active-high;
			pinctrl-names = "default";
			pinctrl-0 = <&dragon_veth_gpios>;
			regulator-always-on;
		};

		/* VDDvario fixed regulator */
		dragon_vario: nds332p {
			compatible = "regulator-fixed";
			regulator-name = "NDS332P";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			vin-supply = <&pm8058_s3>;
		};

		/* This is a levelshifter for SDCC5 */
		dragon_vio_txb: txb0104rgyr {
			compatible = "regulator-fixed";
			regulator-name = "Dragon SDCC levelshifter";
			vin-supply = <&pm8058_l14>;
			regulator-always-on;
		};
	};

	/*
	 * Capella CM3605 light and proximity sensor mounted directly
	 * on the sensor board.
	 */
	cm3605 {
		compatible = "capella,cm3605";
		vdd-supply = <&pm8058_l14>; // 2.85V
		aset-gpios = <&pm8058_gpio 35 GPIO_ACTIVE_LOW>;
		capella,aset-resistance-ohms = <100000>;
		/* Trig on both edges - getting close or far away */
		interrupts-extended = <&pm8058_gpio 34 IRQ_TYPE_EDGE_BOTH>;
		/* MPP05 analog input to the XOADC */
		io-channels = <&xoadc 0x00 0x05>;
		io-channel-names = "aout";
		pinctrl-names = "default";
		pinctrl-0 = <&dragon_cm3605_gpios>, <&dragon_cm3605_mpps>;
	};
};

&ebi2 {
	/* The EBI2 will instantiate first, then populate its children */
	pinctrl-names = "default";
	pinctrl-0 = <&dragon_ebi2_pins>;
	status = "okay";

	/*
	 * An on-board SMSC LAN9221 chip for "debug ethernet",
	 * which is actually just an ordinary ethernet on the
	 * EBI2. This has a 25MHz chrystal next to it, so no
	 * clocking is needed.
	 */
	ethernet@2,0 {
		compatible = "smsc,lan9221", "smsc,lan9115";
		reg = <2 0x0 0x100>;
		/*
		 * The second interrupt is the PME interrupt
		 * for network wakeup, connected to the TLMM.
		 */
		interrupts-extended = <&pm8058_gpio 7 IRQ_TYPE_EDGE_FALLING>,
				    <&tlmm 29 IRQ_TYPE_EDGE_RISING>;
		reset-gpios = <&tlmm 30 GPIO_ACTIVE_LOW>;
		vdd33a-supply = <&dragon_veth>;
		vddvario-supply = <&dragon_vario>;
		pinctrl-names = "default";
		pinctrl-0 = <&dragon_ethernet_gpios>;
		phy-mode = "mii";
		reg-io-width = <2>;
		smsc,force-external-phy;
		smsc,irq-push-pull;

		/*
		 * SLOW chipselect config
		 * Delay 9 cycles (140ns@64MHz) between SMSC
		 * LAN9221 Ethernet controller reads and writes
		 * on CS2.
		 */
		qcom,xmem-recovery-cycles = <0>;
		qcom,xmem-write-hold-cycles = <3>;
		qcom,xmem-write-delta-cycles = <31>;
		qcom,xmem-read-delta-cycles = <28>;
		qcom,xmem-write-wait-cycles = <9>;
		qcom,xmem-read-wait-cycles = <9>;
	};
};

&gsbi3 {
	qcom,mode = <GSBI_PROT_I2C>;
	status = "okay";
};

&gsbi3_i2c {
	pinctrl-names = "default";
	pinctrl-0 = <&dragon_gsbi3_i2c_pins>;
	status = "okay";

	touchscreen@24 {
		compatible = "cypress,cy8ctma340";
		reg = <0x24>;
		/* Certainly we can do at least 400 kHz */
		clock-frequency = <400000>;
		/* IRQ on GPIO61 called /CTP_INT */
		interrupt-parent = <&tlmm>;
		interrupts = <61 IRQ_TYPE_EDGE_FALLING>;
		/*
		 * The I2C bus is using a PCA9306 level translator from L16A
		 * to L2B so these two voltages are needed and L16A is
		 * kind of the IO voltage, however L16Aisn't really fed to
		 * the TMA340, which relies entirely on L2B (PM8901 L2).
		 */
		vcpin-supply = <&pm8058_l16>;
		vdd-supply = <&pm8901_l2>;
		/* GPIO58, called WAKE_CTP */
		reset-gpios = <&tlmm 58 GPIO_ACTIVE_LOW>;
		touchscreen-size-x = <480>;
		touchscreen-size-y = <800>;
		active-interval-ms = <0>;
		touch-timeout-ms = <255>;
		lowpower-interval-ms = <10>;
		bootloader-key = /bits/ 8 <0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07>;
		pinctrl-names = "default";
		pinctrl-0 = <&dragon_tma340_gpios>;
	};
};

&gsbi8 {
	qcom,mode = <GSBI_PROT_I2C>;
	status = "okay";
};

&gsbi8_i2c {
	pinctrl-names = "default";
	pinctrl-0 = <&dragon_gsbi8_i2c_pins>;
	status = "okay";

	eeprom@52 {
		/* A 16KiB Platform ID EEPROM on the CPU carrier board */
		compatible = "atmel,24c128";
		reg = <0x52>;
		vcc-supply = <&pm8058_s3>;
		pagesize = <64>;
	};
	wm8903: wm8903@1a {
		/* This Woolfson Micro device has an unrouted interrupt line */
		compatible = "wlf,wm8903";
		reg = <0x1a>;

		AVDD-supply = <&pm8058_l16>;
		CPVDD-supply = <&pm8058_l16>;
		DBVDD-supply = <&pm8058_s3>;
		DCVDD-supply = <&pm8058_l0>;

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

		micdet-cfg = <0>;
		micdet-delay = <100>;
		gpio-cfg = <0xffffffff 0xffffffff 0 0xffffffff 0xffffffff>;
	};
};

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

&gsbi12_serial {
	pinctrl-names = "default";
	pinctrl-0 = <&dragon_gsbi12_serial_pins>;
	status = "okay";
};

&gsbi12_i2c {
	pinctrl-names = "default";
	pinctrl-0 = <&dragon_gsbi12_i2c_pins>;
	status = "okay";

	ak8975@c {
		compatible = "asahi-kasei,ak8975";
		reg = <0x0c>;
		interrupt-parent = <&pm8058_gpio>;
		interrupts = <33 IRQ_TYPE_EDGE_RISING>;
		pinctrl-names = "default";
		pinctrl-0 = <&dragon_ak8975_gpios>;
		vid-supply = <&pm8058_lvs0>; // 1.8V
		vdd-supply = <&pm8058_l14>; // 2.85V
	};
	bmp085@77 {
		compatible = "bosch,bmp085";
		reg = <0x77>;
		interrupt-parent = <&pm8058_gpio>;
		interrupts = <16 IRQ_TYPE_EDGE_RISING>;
		reset-gpios = <&tlmm 86 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&dragon_bmp085_gpios>;
		vddd-supply = <&pm8058_lvs0>; // 1.8V
		vdda-supply = <&pm8058_l14>; // 2.85V
	};
	mpu3050@68 {
		compatible = "invensense,mpu3050";
		reg = <0x68>;
		/*
		 * GPIO17 is pulled high by a 10k
		 * resistor to VLOGIC so needs to be
		 * active low/falling edge.
		 */
		interrupts-extended = <&pm8058_gpio 17 IRQ_TYPE_EDGE_FALLING>;
		pinctrl-names = "default";
		pinctrl-0 = <&dragon_mpu3050_gpios>;
		vlogic-supply = <&pm8058_lvs0>; // 1.8V
		vdd-supply = <&pm8058_l14>; // 2.85V

		/*
		 * The MPU-3050 acts as a hub for the
		 * accelerometer.
		 */
		i2c-gate {
			#address-cells = <1>;
			#size-cells = <0>;

			kxsd9@18 {
				compatible = "kionix,kxsd9";
				reg = <0x18>;
				interrupt-parent = <&tlmm>;
				interrupts = <57 IRQ_TYPE_EDGE_FALLING>;
				pinctrl-names = "default";
				pinctrl-0 = <&dragon_kxsd9_gpios>;
				iovdd-supply = <&pm8058_lvs0>; // 1.8V
				vdd-supply = <&pm8058_l14>; // 2.85V
			};
		};
	};
};

&pm8058_gpio {
	dragon_ethernet_gpios: ethernet-state {
		pinconf {
			pins = "gpio7";
			function = "normal";
			input-enable;
			bias-disable;
			power-source = <PM8058_GPIO_S3>;
		};
	};
	dragon_bmp085_gpios: bmp085-state {
		pinconf {
			pins = "gpio16";
			function = "normal";
			input-enable;
			bias-disable;
			power-source = <PM8058_GPIO_S3>;
		};
	};
	dragon_mpu3050_gpios: mpu3050-state {
		pinconf {
			pins = "gpio17";
			function = "normal";
			input-enable;
			bias-disable;
			power-source = <PM8058_GPIO_S3>;
		};
	};
	dragon_sdcc3_gpios: sdcc3-state {
		pinconf {
			pins = "gpio22";
			function = "normal";
			input-enable;
			bias-disable;
			power-source = <PM8058_GPIO_S3>;
		};
	};
	dragon_sdcc5_gpios: sdcc5-state {
		pinconf {
			pins = "gpio26";
			function = "normal";
			input-enable;
			bias-pull-up;
			qcom,pull-up-strength = <PMIC_GPIO_PULL_UP_30>;
			power-source = <PM8058_GPIO_S3>;
		};
	};
	dragon_ak8975_gpios: ak8975-state {
		pinconf {
			pins = "gpio33";
			function = "normal";
			input-enable;
			bias-disable;
			power-source = <PM8058_GPIO_S3>;
		};
	};
	dragon_cm3605_gpios: cm3605-state {
		/* Pin 34 connected to the proxy IRQ */
		gpio34-pins {
			pins = "gpio34";
			function = "normal";
			input-enable;
			bias-disable;
			power-source = <PM8058_GPIO_S3>;
		};
		/* Pin 35 connected to ASET */
		gpio35-pins {
			pins = "gpio35";
			function = "normal";
			output-high;
			bias-disable;
			power-source = <PM8058_GPIO_S3>;
		};
	};
	dragon_veth_gpios: veth-state {
		pinconf {
			pins = "gpio40";
			function = "normal";
			bias-disable;
			drive-push-pull;
		};
	};
};

&pm8058_keypad {
	linux,keymap = <
		MATRIX_KEY(0, 0, KEY_MENU)
		MATRIX_KEY(0, 2, KEY_1)
		MATRIX_KEY(0, 3, KEY_4)
		MATRIX_KEY(0, 4, KEY_7)
		MATRIX_KEY(1, 0, KEY_UP)
		MATRIX_KEY(1, 1, KEY_LEFT)
		MATRIX_KEY(1, 2, KEY_DOWN)
		MATRIX_KEY(1, 3, KEY_5)
		MATRIX_KEY(1, 3, KEY_8)
		MATRIX_KEY(2, 0, KEY_HOME)
		MATRIX_KEY(2, 1, KEY_REPLY)
		MATRIX_KEY(2, 2, KEY_2)
		MATRIX_KEY(2, 3, KEY_6)
		MATRIX_KEY(3, 0, KEY_VOLUMEUP)
		MATRIX_KEY(3, 1, KEY_RIGHT)
		MATRIX_KEY(3, 2, KEY_3)
		MATRIX_KEY(3, 3, KEY_9)
		MATRIX_KEY(3, 4, KEY_SWITCHVIDEOMODE)
		MATRIX_KEY(4, 0, KEY_VOLUMEDOWN)
		MATRIX_KEY(4, 1, KEY_BACK)
		MATRIX_KEY(4, 2, KEY_CAMERA)
		MATRIX_KEY(4, 3, KEY_KBDILLUMTOGGLE)
	>;
	keypad,num-rows = <6>;
	keypad,num-columns = <5>;
};

&pm8058_led48 {
	/*
	 * The keypad LED @0x48 is routed to
	 * the sensor board where it is
	 * connected to an infrared LED
	 * SFH4650 (60mW, @850nm) next to the
	 * ambient light and proximity sensor
	 * Capella Microsystems CM3605.
	 */
	label = "pm8058:infrared:proximitysensor";
	default-state = "off";
	linux,default-trigger = "cm3605";
	status = "okay";
};

&pm8058_led131 {
	label = "pm8058:red";
	color = <LED_COLOR_ID_RED>;
	default-state = "off";
	status = "okay";
};

&pm8058_led132 {
	/*
	 * This is actually green too on my
	 * board, but documented as yellow.
	 */
	label = "pm8058:yellow";
	color = <LED_COLOR_ID_YELLOW>;
	default-state = "off";
	linux,default-trigger = "mmc0";
	status = "okay";
};

&pm8058_led133 {
	label = "pm8058:green";
	function = LED_FUNCTION_HEARTBEAT;
	color = <LED_COLOR_ID_GREEN>;
	default-state = "on";
	linux,default-trigger = "heartbeat";
	status = "okay";
};

&pm8058_mpps {
	dragon_cm3605_mpps: cm3605-mpps-state {
		mpp5 {
			pins = "mpp5";
			function = "analog";
			input-enable;
			bias-high-impedance;
			/* Let's use channel 5 */
			qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH5>;
			power-source = <PM8058_GPIO_S3>;
		};
	};
};

&rpm {
	/*
	 * Set up of the PMIC RPM regulators for this board
	 * PM8901 supplies "preliminary regulators" whatever
	 * that means
	 */
	pm8901-regulators {
		vdd_l0-supply = <&pm8901_s4>;
		vdd_l1-supply = <&vph>;
		vdd_l2-supply = <&vph>;
		vdd_l3-supply = <&vph>;
		vdd_l4-supply = <&vph>;
		vdd_l5-supply = <&vph>;
		vdd_l6-supply = <&vph>;
		/* vdd_s0-supply, vdd_s1-supply: SAW regulators */
		vdd_s2-supply = <&vph>;
		vdd_s3-supply = <&vph>;
		vdd_s4-supply = <&vph>;
		lvs0_in-supply = <&pm8058_s3>;
		lvs1_in-supply = <&pm8901_s4>;
		lvs2_in-supply = <&pm8058_l0>;
		lvs3_in-supply = <&pm8058_s2>;
		mvs_in-supply = <&pm8058_s3>;

		l0 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			bias-pull-down;
		};
		l1 {
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			bias-pull-down;
		};
		l2 {
			/* TMA340 requires strictly 3.3V */
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			bias-pull-down;
		};
		l3 {
			regulator-min-microvolt = <3300000>;
			regulator-max-microvolt = <3300000>;
			bias-pull-down;
		};
		l4 {
			regulator-min-microvolt = <2600000>;
			regulator-max-microvolt = <2600000>;
			bias-pull-down;
		};
		l5 {
			regulator-min-microvolt = <2850000>;
			regulator-max-microvolt = <2850000>;
			bias-pull-down;
		};
		l6 {
			regulator-min-microvolt = <2200000>;
			regulator-max-microvolt = <2200000>;
			bias-pull-down;
		};

		/* s0 and s1 are SAW regulators controlled over SPM */
		s2 {
			regulator-min-microvolt = <1300000>;
			regulator-max-microvolt = <1300000>;
			qcom,switch-mode-frequency = <1600000>;
			bias-pull-down;
		};
		s3 {
			regulator-min-microvolt = <1100000>;
			regulator-max-microvolt = <1100000>;
			qcom,switch-mode-frequency = <1600000>;
			bias-pull-down;
		};
		s4 {
			regulator-min-microvolt = <1225000>;
			regulator-max-microvolt = <1225000>;
			qcom,switch-mode-frequency = <1600000>;
			bias-pull-down;
		};

		/* LVS0 thru 3 and mvs are just switches */
		lvs0 {
			regulator-always-on;
		};
		lvs1 { };
		lvs2 { };
		lvs3 { };
		mvs { };

	};

	pm8058-regulators {
		vdd_l0_l1_lvs-supply = <&pm8058_s3>;
		vdd_l2_l11_l12-supply = <&vph>;
		vdd_l3_l4_l5-supply = <&vph>;
		vdd_l6_l7-supply = <&vph>;
		vdd_l8-supply = <&vph>;
		vdd_l9-supply = <&vph>;
		vdd_l10-supply = <&vph>;
		vdd_l13_l16-supply = <&pm8058_s4>;
		vdd_l14_l15-supply = <&vph>;
		vdd_l17_l18-supply = <&vph>;
		vdd_l19_l20-supply = <&vph>;
		vdd_l21-supply = <&pm8058_s3>;
		vdd_l22-supply = <&pm8058_s3>;
		vdd_l23_l24_l25-supply = <&pm8058_s3>;
		vdd_s0-supply = <&vph>;
		vdd_s1-supply = <&vph>;
		vdd_s2-supply = <&vph>;
		vdd_s3-supply = <&vph>;
		vdd_s4-supply = <&vph>;
		vdd_ncp-supply = <&vph>;

		l0 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			bias-pull-down;
		};
		l1 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			bias-pull-down;
		};
		l2 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2600000>;
			bias-pull-down;
		};
		l3 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			bias-pull-down;
		};
		l4 {
			regulator-min-microvolt = <2850000>;
			regulator-max-microvolt = <2850000>;
			bias-pull-down;
		};
		l5 {
			regulator-min-microvolt = <2850000>;
			regulator-max-microvolt = <2850000>;
			bias-pull-down;
		};
		l6 {
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3600000>;
			bias-pull-down;
		};
		l7 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			bias-pull-down;
		};
		l8 {
			regulator-min-microvolt = <2900000>;
			regulator-max-microvolt = <3050000>;
			bias-pull-down;
		};
		l9 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			bias-pull-down;
		};
		l10 {
			regulator-min-microvolt = <2600000>;
			regulator-max-microvolt = <2600000>;
			bias-pull-down;
		};
		l11 {
			regulator-min-microvolt = <1500000>;
			regulator-max-microvolt = <1500000>;
			bias-pull-down;
		};
		l12 {
			regulator-min-microvolt = <2900000>;
			regulator-max-microvolt = <2900000>;
			bias-pull-down;
		};
		l13 {
			regulator-min-microvolt = <2050000>;
			regulator-max-microvolt = <2050000>;
			bias-pull-down;
		};
		l14 {
			regulator-min-microvolt = <2850000>;
			regulator-max-microvolt = <2850000>;
		};
		l15 {
			regulator-min-microvolt = <2850000>;
			regulator-max-microvolt = <2850000>;
			bias-pull-down;
		};
		l16 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			bias-pull-down;
			regulator-always-on;
		};
		l17 {
			// 1.5V according to schematic
			regulator-min-microvolt = <2600000>;
			regulator-max-microvolt = <2600000>;
			bias-pull-down;
		};
		l18 {
			regulator-min-microvolt = <2200000>;
			regulator-max-microvolt = <2200000>;
			bias-pull-down;
		};
		l19 {
			regulator-min-microvolt = <2500000>;
			regulator-max-microvolt = <2500000>;
			bias-pull-down;
		};
		l20 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			bias-pull-down;
		};
		l21 {
			// 1.1 V according to schematic
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			bias-pull-down;
			regulator-always-on;
		};
		l22 {
			// 1.2 V according to schematic
			regulator-min-microvolt = <1150000>;
			regulator-max-microvolt = <1150000>;
			bias-pull-down;
		};
		l23 {
			// Unused
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			bias-pull-down;
		};
		l24 {
			// Unused
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			bias-pull-down;
		};
		l25 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			bias-pull-down;
		};

		s0 {
			// regulator-min-microvolt = <500000>;
			// regulator-max-microvolt = <1325000>;
			regulator-min-microvolt = <1100000>;
			regulator-max-microvolt = <1100000>;
			qcom,switch-mode-frequency = <1600000>;
			bias-pull-down;
		};
		s1 {
			// regulator-min-microvolt = <500000>;
			// regulator-max-microvolt = <1250000>;
			regulator-min-microvolt = <1100000>;
			regulator-max-microvolt = <1100000>;
			qcom,switch-mode-frequency = <1600000>;
			bias-pull-down;
		};
		s2 {
			// 1.3 V according to schematic
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1400000>;
			qcom,switch-mode-frequency = <1600000>;
			bias-pull-down;
		};
		s3 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			qcom,switch-mode-frequency = <1600000>;
			regulator-always-on;
			bias-pull-down;
		};
		s4 {
			regulator-min-microvolt = <2200000>;
			regulator-max-microvolt = <2200000>;
			qcom,switch-mode-frequency = <1600000>;
			regulator-always-on;
			bias-pull-down;
		};

		/* LVS0 and LVS1 are just switches */
		lvs0 {
			bias-pull-down;
		};
		lvs1 {
			bias-pull-down;
		};

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

/* Internal 3.69 GiB eMMC */
&sdcc1 {
	pinctrl-names = "default";
	pinctrl-0 = <&dragon_sdcc1_pins>;
	vmmc-supply = <&pm8901_l5>;
	vqmmc-supply = <&pm8901_lvs0>;
	status = "okay";
};

/* External micro SD card, directly connected, pulled up to 2.85 V */
&sdcc3 {
	/* Enable SSBI GPIO 22 as input, use for card detect */
	pinctrl-names = "default";
	pinctrl-0 = <&dragon_sdcc3_pins>, <&dragon_sdcc3_gpios>;
	cd-gpios = <&pm8058_gpio 22 GPIO_ACTIVE_LOW>;
	wp-gpios = <&tlmm 110 GPIO_ACTIVE_HIGH>;
	vmmc-supply = <&pm8058_l14>;
	status = "okay";
};

/*
 * Second external micro SD card, using two TXB104RGYR levelshifters
 * to lift from 1.8 V to 2.85 V
 */
&sdcc5 {
	/* Enable SSBI GPIO 26 as input, use for card detect */
	pinctrl-names = "default";
	pinctrl-0 = <&dragon_sdcc5_pins>, <&dragon_sdcc5_gpios>;
	cd-gpios = <&pm8058_gpio 26 GPIO_ACTIVE_LOW>;
	wp-gpios = <&tlmm 106 GPIO_ACTIVE_HIGH>;
	vmmc-supply = <&pm8058_l14>;
	vqmmc-supply = <&dragon_vio_txb>;
	status = "okay";
};

&tlmm {
	/* eMMC pins, all 8 data lines connected */
	dragon_sdcc1_pins: sdcc1-state {
		clk-pins {
			pins = "gpio167"; /* SDC1 CLK */
			function = "sdc1";
			drive-strength = <16>;
			bias-disable;
		};
		cmd-pins {
			pins = "gpio168"; /* SDC1 CMD */
			function = "sdc1";
			drive-strength = <10>;
			bias-pull-up;
		};
		data-pins {
			/* SDC1 D0 to D7 */
			pins = "gpio159", "gpio160", "gpio161", "gpio162",
			     "gpio163", "gpio164", "gpio165", "gpio166";
			function = "sdc1";
			drive-strength = <10>;
			bias-pull-up;
		};
	};

	/*
	 * The SDCC3 pins are hardcoded (non-muxable) but need some pin
	 * configuration.
	 */
	dragon_sdcc3_pins: sdcc3-state {
		clk-pins {
			pins = "sdc3_clk";
			drive-strength = <8>;
			bias-disable;
		};
		cmd-pins {
			pins = "sdc3_cmd";
			drive-strength = <8>;
			bias-pull-up;
		};
		data-pins {
			pins = "sdc3_data";
			drive-strength = <8>;
			bias-pull-up;
		};
	};

	/* Second SD card slot pins */
	dragon_sdcc5_pins: sdcc5-state {
		clk-pins {
			pins = "gpio97"; /* SDC5 CLK */
			function = "sdc5";
			drive-strength = <16>;
			bias-disable;
		};
		cmd-pins {
			pins = "gpio95"; /* SDC5 CMD */
			function = "sdc5";
			drive-strength = <10>;
			bias-pull-up;
		};
		data-pins {
			/* SDC5 D0 to D3 */
			pins = "gpio96", "gpio98", "gpio99", "gpio100";
			function = "sdc5";
			drive-strength = <10>;
			bias-pull-up;
		};
	};

	dragon_gsbi3_i2c_pins: gsbi3-i2c-state {
		pins = "gpio43", "gpio44";
		function = "gsbi3";
		drive-strength = <8>;
		/* These have external pull-up 2.2kOhm to 1.8V */
		bias-disable;
	};

	dragon_gsbi8_i2c_pins: gsbi8-i2c-state {
		pins = "gpio64", "gpio65";
		function = "gsbi8";
		drive-strength = <16>;
		/* These have external pull-up 2.2kOhm to 1.8V */
		bias-disable;
	};

	dragon_gsbi12_i2c_pins: gsbi12-i2c-state {
		pins = "gpio115", "gpio116";
		function = "gsbi12";
		drive-strength = <16>;
		/* These have external pull-up 4.7kOhm to 1.8V */
		bias-disable;
	};

	/* Primary serial port uart 0 pins */
	dragon_gsbi12_serial_pins: gsbi12-serial-state {
		tx-pins {
			pins = "gpio117";
			function = "gsbi12";
			drive-strength = <8>;
			bias-disable;
		};
		rx-pins {
			pins = "gpio118";
			function = "gsbi12";
			drive-strength = <2>;
			bias-pull-up;
		};
	};

	dragon_ebi2_pins: ebi2-state {
		/*
		 * Pins used by EBI2 on the Dragonboard, actually only
		 * CS2 is used by a real peripheral. CS0 is just
		 * routed to a test point.
		 */
		mux0-pins {
			pins =
			    /* "gpio39", CS1A_N this is not good to mux */
			    "gpio40", /* CS2A_N */
			    "gpio134"; /* CS0_N testpoint TP29 */
			function = "ebi2cs";
		};
		mux1-pins {
			pins =
			    /* EBI2_ADDR_7 downto EBI2_ADDR_0 address bus */
			    "gpio123", "gpio124", "gpio125", "gpio126",
			    "gpio127", "gpio128", "gpio129", "gpio130",
			    /* EBI2_DATA_15 downto EBI2_DATA_0 data bus */
			    "gpio135", "gpio136", "gpio137", "gpio138",
			    "gpio139", "gpio140", "gpio141", "gpio142",
			    "gpio143", "gpio144", "gpio145", "gpio146",
			    "gpio147", "gpio148", "gpio149", "gpio150",
			    "gpio151", /* EBI2_OE_N */
			    "gpio153", /* EBI2_ADV */
			    "gpio157"; /* EBI2_WE_N */
			function = "ebi2";
		};
	};

	/* Interrupt line for the KXSD9 accelerometer */
	dragon_kxsd9_gpios: kxsd9-state {
		pins = "gpio57"; /* IRQ line */
		function = "gpio";
		bias-pull-up;
	};

	dragon_tma340_gpios: tma340-state {
		reset-pins {
			/* RESET line, TS_ATTN, WAKE_CTP */
			pins = "gpio58";
			function = "gpio";
			drive-strength = <6>;
			bias-disable;
		};
		irq-pins {
			pins = "gpio61"; /* IRQ line */
			function = "gpio";
			drive-strength = <2>;
			bias-pull-up;
		};
	};
};

&xoadc {
	/* Reference voltage 2.2 V */
	xoadc-ref-supply = <&pm8058_l18>;

	/* Board-specific channels */
	mpp5@5 {
		/* Connected to AOUT of ALS sensor */
		reg = <0x00 0x05>;
	};
	mpp6@6 {
		/* Connected to test point TP43 */
		reg = <0x00 0x06>;
	};
	mpp7@7 {
		/* Connected to battery thermistor */
		reg = <0x00 0x07>;
	};
	mpp8@8 {
		/* Connected to battery ID detector */
		reg = <0x00 0x08>;
	};
	mpp9@9 {
		/* Connected to XO thermistor */
		reg = <0x00 0x09>;
	};
};


code:
// SPDX-License-Identifier: GPL-2.0
#include "qcom-apq8064-v2.0.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
/ {
	model = "Asus Nexus7(flo)";
	compatible = "asus,nexus7-flo", "qcom,apq8064";
	chassis-type = "tablet";

	aliases {
		serial0 = &gsbi7_serial;
		serial1 = &gsbi6_serial;
	};

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

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

		ramoops@88d00000{
			compatible = "ramoops";
			reg = <0x88d00000 0x100000>;
			record-size = <0x00020000>;
			console-size = <0x00020000>;
			ftrace-size = <0x00020000>;
		};
	};

	ext_3p3v: regulator-ext-3p3v {
		compatible = "regulator-fixed";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-name = "ext_3p3v";
		regulator-type = "voltage";
		startup-delay-us = <0>;
		gpio = <&tlmm_pinmux 77 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		regulator-boot-on;
	};

	gpio-keys {
		compatible = "gpio-keys";
		key-volume-up {
			label = "Volume Up";
			gpios = <&pm8921_gpio 4 GPIO_ACTIVE_HIGH>;
			linux,code = <KEY_VOLUMEUP>;
		};
		key-volume-down {
			label = "Volume Down";
			gpios = <&pm8921_gpio 38 GPIO_ACTIVE_HIGH>;
			linux,code = <KEY_VOLUMEDOWN>;
		};
	};

	soc {
		sram@2a03f000 {
			compatible = "qcom,apq8064-imem", "syscon", "simple-mfd";
			reg = <0x2a03f000 0x1000>;

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

				mode-normal = <0x77665501>;
				mode-bootloader = <0x77665500>;
				mode-recovery = <0x77665502>;
			};
		};
	};
};

&dsi0 {
	vdda-supply = <&pm8921_l2>;/*VDD_MIPI1 to 4*/
	vdd-supply = <&pm8921_l8>;
	vddio-supply = <&pm8921_lvs7>;
	avdd-supply = <&pm8921_l11>;
	status = "okay";

	panel@0 {
		reg = <0>;
		compatible = "jdi,lt070me05000";

		vddp-supply = <&pm8921_l17>;
		iovcc-supply = <&pm8921_lvs7>;

		enable-gpios = <&pm8921_gpio 36 GPIO_ACTIVE_HIGH>;
		reset-gpios = <&tlmm_pinmux 54 GPIO_ACTIVE_LOW>;
		dcdc-en-gpios = <&pm8921_gpio 23 GPIO_ACTIVE_HIGH>;

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

&dsi0_in {
	remote-endpoint = <&mdp_dsi1_out>;
};

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

&dsi0_phy {
	vddio-supply = <&pm8921_lvs7>;/*VDD_PLL2_1 to 7*/
	status = "okay";
};

&gsbi1 {
	qcom,mode = <GSBI_PROT_I2C>;
	status = "okay";
};

&gsbi1_i2c {
	status = "okay";
	clock-frequency = <200000>;
	pinctrl-0 = <&i2c1_pins>;
	pinctrl-names = "default";

	eeprom@52 {
		compatible = "atmel,24c128";
		reg = <0x52>;
		pagesize = <32>;
	};

	bq27541@55 {
		compatible = "ti,bq27541";
		reg = <0x55>;
	};

};

&gsbi3 {
	qcom,mode = <GSBI_PROT_I2C>;
	status = "okay";
};

&gsbi3_i2c {
	clock-frequency = <200000>;
	pinctrl-0 = <&i2c3_pins>;
	pinctrl-names = "default";
	status = "okay";

	trackpad@10 {
		compatible = "elan,ekth3500";
		reg = <0x10>;
		interrupt-parent = <&tlmm_pinmux>;
		interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
	};
};

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

&gsbi6_serial {
	pinctrl-names = "default";
	pinctrl-0 = <&gsbi6_uart_4pins>;
	status = "okay";
};

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

&gsbi7_serial {
	status = "okay";
};

&mdp {
	status = "okay";
};

/* eMMC */
&sdcc1 {
	vmmc-supply = <&pm8921_l5>;
	vqmmc-supply = <&pm8921_s4>;
	status = "okay";
};

&mdp_dsi1_out {
	remote-endpoint = <&dsi0_in>;
};

&rpm {
	regulators {
		vdd_l1_l2_l12_l18-supply = <&pm8921_s4>;
		vin_lvs1_3_6-supply = <&pm8921_s4>;
		vin_lvs4_5_7-supply = <&pm8921_s4>;

		vdd_l24-supply = <&pm8921_s1>;
		vdd_l25-supply = <&pm8921_s1>;
		vin_lvs2-supply = <&pm8921_s1>;

		vdd_l26-supply = <&pm8921_s7>;
		vdd_l27-supply = <&pm8921_s7>;
		vdd_l28-supply = <&pm8921_s7>;

		vdd_ncp-supply = <&pm8921_l6>;

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

		/* msm otg HSUSB_VDDCX */
		s3 {
			regulator-min-microvolt = <500000>;
			regulator-max-microvolt = <1150000>;
			qcom,switch-mode-frequency = <4800000>;
		};

		/*
		 * msm_sdcc.1-sdc-vdd_io
		 * tabla2x-slim-CDC_VDDA_RX
		 * tabla2x-slim-CDC_VDDA_TX
		 * tabla2x-slim-CDC_VDD_CP
		 * tabla2x-slim-VDDIO_CDC
		 */
		s4 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			qcom,switch-mode-frequency = <3200000>;
			regulator-always-on;
		};

		s7 {
			regulator-min-microvolt = <1300000>;
			regulator-max-microvolt = <1300000>;
			qcom,switch-mode-frequency = <3200000>;
		};

		/* mipi_dsi.1-dsi1_pll_vdda */
		l2 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-always-on;
		};

		/* msm_otg-HSUSB_3p3 */
		l3 {
			regulator-min-microvolt = <3075000>;
			regulator-max-microvolt = <3075000>;
			bias-pull-down;
		};

		/* msm_otg-HSUSB_1p8 */
		l4 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			bias-pull-down;
		};

		/* msm_sdcc.1-sdc_vdd */
		l5 {
			regulator-min-microvolt = <2950000>;
			regulator-max-microvolt = <2950000>;
			regulator-always-on;
			bias-pull-down;
		};

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

		/* mipi_dsi.1-dsi1_avdd */
		l11 {
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3000000>;
			bias-pull-down;
			regulator-always-on;
		};

		/* pwm_power for backlight */
		l17 {
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3000000>;
			regulator-always-on;
		};

		/* camera, qdsp6 */
		l23 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			bias-pull-down;
		};

		/*
		 * tabla2x-slim-CDC_VDDA_A_1P2V
		 * tabla2x-slim-VDDD_CDC_D
		 */
		l25 {
			regulator-min-microvolt = <1250000>;
			regulator-max-microvolt = <1250000>;
			bias-pull-down;
		};

		lvs1 {
			bias-pull-down;
		};

		lvs4 {
			bias-pull-down;
		};

		lvs5 {
			bias-pull-down;
		};

		lvs6 {
			bias-pull-down;
		};
		/*
		 * mipi_dsi.1-dsi1_vddio
		 * pil_riva-pll_vdd
		 */
		lvs7 {
			bias-pull-down;
		};
	};
};

&usb_hs1_phy {
	v3p3-supply = <&pm8921_l3>;
	v1p8-supply = <&pm8921_l4>;
};

/* OTG */
&usb1 {
	dr_mode = "otg";
	status = "okay";
};


code:
// SPDX-License-Identifier: GPL-2.0
#include "qcom-apq8064-v2.0.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>

/ {
	model = "CompuLab CM-QS600";
	compatible = "qcom,apq8064-cm-qs600", "qcom,apq8064";

	aliases {
		serial0 = &gsbi7_serial;
	};

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

	sdcc4_pwrseq: pwrseq-sdcc4 {
		pinctrl-names = "default";
		pinctrl-0 = <&wlan_default_gpios>;
		compatible = "mmc-pwrseq-simple";
		reset-gpios = <&pm8921_gpio 43 GPIO_ACTIVE_LOW>;
	};

	/* on board fixed 3.3v supply */
	v3p3_fixed: regulator-v3p3 {
		compatible = "regulator-fixed";
		regulator-name = "PCIE V3P3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-always-on;
	};
};

&gsbi1 {
	qcom,mode = <GSBI_PROT_I2C>;
	status = "okay";
};

&gsbi1_i2c {
	clock-frequency = <200000>;
	status = "okay";

	eeprom@50 {
		compatible = "atmel,24c02";
		reg = <0x50>;
		pagesize = <32>;
	};
};

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

&gsbi7_serial {
	pinctrl-names = "default";
	pinctrl-0 = <&gsbi7_uart_2pins>;
	status = "okay";
};

&pcie {
	vdda-supply = <&pm8921_s3>;
	vdda_phy-supply = <&pm8921_lvs6>;
	vdda_refclk-supply = <&v3p3_fixed>;
	pinctrl-0 = <&pcie_pins>;
	pinctrl-names = "default";
	perst-gpios = <&tlmm_pinmux 27 GPIO_ACTIVE_LOW>;
	status = "okay";
};

&pm8921_gpio {
	wlan_default_gpios: wlan-gpios-state {
		pinconf {
			pins = "gpio43";
			function = "normal";
			bias-disable;
			power-source = <PM8921_GPIO_S4>;
		};
	};
};

&rpm {
	regulators {
		vin_lvs1_3_6-supply = <&pm8921_s4>;
		vin_lvs2-supply = <&pm8921_s1>;
		vin_lvs4_5_7-supply = <&pm8921_s4>;

		vdd_l1_l2_l12_l18-supply = <&pm8921_s4>;
		vdd_l24-supply = <&pm8921_s1>;
		vdd_l25-supply = <&pm8921_s1>;
		vdd_l26-supply = <&pm8921_s7>;
		vdd_l27-supply = <&pm8921_s7>;
		vdd_l28-supply = <&pm8921_s7>;

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

		s3 {
			regulator-min-microvolt = <1000000>;
			regulator-max-microvolt = <1400000>;
			qcom,switch-mode-frequency = <4800000>;
		};

		s4 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			qcom,switch-mode-frequency = <3200000>;
		};

		s7 {
			regulator-min-microvolt = <1300000>;
			regulator-max-microvolt = <1300000>;
			qcom,switch-mode-frequency = <3200000>;
		};

		l3 {
			regulator-min-microvolt = <3050000>;
			regulator-max-microvolt = <3300000>;
			bias-pull-down;
		};

		l4 {
			regulator-min-microvolt = <1000000>;
			regulator-max-microvolt = <1800000>;
			bias-pull-down;
		};

		l5 {
			regulator-min-microvolt = <2750000>;
			regulator-max-microvolt = <3000000>;
			bias-pull-down;
		};

		l23 {
			regulator-min-microvolt = <1700000>;
			regulator-max-microvolt = <1900000>;
			bias-pull-down;
		};

		lvs6 {
			bias-pull-down;
		};

	};
};

/* eMMC */
&sdcc1 {
	vmmc-supply = <&pm8921_l5>;
	vqmmc-supply = <&pm8921_s4>;
	status = "okay";
};

/* External micro SD card */
&sdcc3 {
	vmmc-supply = <&v3p3_fixed>;
	pinctrl-names = "default";
	pinctrl-0 = <&card_detect>;
	cd-gpios = <&tlmm_pinmux 26 GPIO_ACTIVE_LOW>;
	status = "okay";
};

/* WLAN */
&sdcc4 {
	status = "okay";
	vmmc-supply = <&v3p3_fixed>;
	vqmmc-supply = <&v3p3_fixed>;
	mmc-pwrseq = <&sdcc4_pwrseq>;
};

&tlmm_pinmux {
	card_detect: card_detect {
		mux {
			pins = "gpio26";
			function = "gpio";
			bias-disable;
		};
	};

	pcie_pins: pcie_pinmux {
		mux {
			pins = "gpio27";
			function = "gpio";
		};
		conf {
			pins = "gpio27";
			drive-strength = <12>;
			bias-disable;
		};
	};
};

&usb_hs1_phy {
	v3p3-supply = <&pm8921_l3>;
	v1p8-supply = <&pm8921_l4>;
};

&usb_hs3_phy {
	v3p3-supply = <&pm8921_l3>;
	v1p8-supply = <&pm8921_l23>;
};

&usb_hs4_phy {
	v3p3-supply = <&pm8921_l3>;
	v1p8-supply = <&pm8921_l23>;
};

/* OTG */
&usb1 {
	dr_mode = "otg";
	status = "okay";
};

&usb3 {
	dr_mode = "host";
	status = "okay";
};

&usb4 {
	dr_mode = "host";
	status = "okay";
};


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

/ {
	model = "Qualcomm APQ8064/IFC6410";
	compatible = "qcom,apq8064-ifc6410", "qcom,apq8064";

	aliases {
		serial0 = &gsbi7_serial;
		serial1 = &gsbi6_serial;
		i2c0 = &gsbi1_i2c;
		i2c1 = &gsbi2_i2c;
		i2c2 = &gsbi3_i2c;
		i2c3 = &gsbi4_i2c;
		spi0 = &gsbi5_spi;
	};

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

	leds {
		compatible = "gpio-leds";
		pinctrl-names = "default";
		pinctrl-0 = <&notify_led>;

		led-user1 {
			label = "apq8064:green:user1";
			color = <LED_COLOR_ID_GREEN>;
			gpios = <&pm8921_gpio 18 GPIO_ACTIVE_HIGH>;
			default-state = "on";
		};
	};

	hdmi-out {
		compatible = "hdmi-connector";
		type = "d";

		port {
			hdmi_con: endpoint {
				remote-endpoint = <&hdmi_out>;
			};
		};
	};

	sdcc4_pwrseq: pwrseq-sdcc4 {
		pinctrl-names = "default";
		pinctrl-0 = <&wlan_default_gpios>;
		compatible = "mmc-pwrseq-simple";
		reset-gpios = <&pm8921_gpio 43 GPIO_ACTIVE_LOW>;
	};

	ext_3p3v: regulator-ext-3p3v {
		compatible = "regulator-fixed";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-name = "ext_3p3v";
		regulator-type = "voltage";
		startup-delay-us = <0>;
		gpio = <&tlmm_pinmux 77 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		regulator-boot-on;
	};
};

&gsbi1 {
	qcom,mode = <GSBI_PROT_I2C>;
	status = "okay";
};

&gsbi1_i2c {
	clock-frequency = <200000>;
	status = "okay";

	eeprom@52 {
		compatible = "atmel,24c128";
		reg = <0x52>;
		pagesize = <32>;
	};
};

&gsbi3 {
	qcom,mode = <GSBI_PROT_I2C>;
	status = "okay";
};

&gsbi3_i2c {
	status = "okay";
};

&gsbi4 {
	qcom,mode = <GSBI_PROT_I2C>;
	status = "okay";
};

/* CAM I2C MIPI-CSI connector */
&gsbi4_i2c {
	status = "okay";
};

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

&gsbi5_spi {
	num-cs = <1>;
	cs-gpios = <&tlmm_pinmux 53 0>;
	status = "okay";
};

&gsbi6 {
	qcom,mode = <GSBI_PROT_UART_W_FC>;
	status = "okay";
};

&gsbi6_serial {
	pinctrl-names = "default";
	pinctrl-0 = <&gsbi6_uart_4pins>;
	status = "okay";
};

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

&gsbi7_serial {
	pinctrl-names = "default";
	pinctrl-0 = <&gsbi7_uart_2pins>;
	status = "okay";
};

&hdmi {
	core-vdda-supply = <&pm8921_hdmi_switch>;
	hpd-gpios = <&tlmm_pinmux 72 GPIO_ACTIVE_HIGH>;
	status = "okay";
};

&hdmi_in {
	remote-endpoint = <&mdp_dtv_out>;
};

&hdmi_out {
	remote-endpoint = <&hdmi_con>;
};

&hdmi_phy {
	status = "okay";
	core-vdda-supply = <&pm8921_hdmi_switch>;
};

&mdp {
	status = "okay";
};

&mdp_dtv_out {
	remote-endpoint = <&hdmi_in>;
};

&pcie {
	status = "okay";
	vdda-supply = <&pm8921_s3>;
	vdda_phy-supply = <&pm8921_lvs6>;
	vdda_refclk-supply = <&ext_3p3v>;
	pinctrl-0 = <&pcie_pins>;
	pinctrl-names = "default";
	perst-gpios = <&tlmm_pinmux 27 GPIO_ACTIVE_LOW>;
};

&pm8921_gpio {
	wlan_default_gpios: wlan-gpios-state {
		pinconf {
			pins = "gpio43";
			function = "normal";
			bias-disable;
			power-source = <PM8921_GPIO_S4>;
		};
	};

	notify_led: nled-state {
		pinconf {
			pins = "gpio18";
			function = "normal";
			bias-disable;
			power-source = <PM8921_GPIO_S4>;
		};
	};
};

&rpm {
	regulators {
		vin_lvs1_3_6-supply = <&pm8921_s4>;
		vin_lvs2-supply = <&pm8921_s1>;
		vin_lvs4_5_7-supply = <&pm8921_s4>;

		vdd_l1_l2_l12_l18-supply = <&pm8921_s4>;
		vdd_l24-supply = <&pm8921_s1>;
		vdd_l25-supply = <&pm8921_s1>;
		vdd_l26-supply = <&pm8921_s7>;
		vdd_l27-supply = <&pm8921_s7>;
		vdd_l28-supply = <&pm8921_s7>;

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

		s3 {
			regulator-min-microvolt = <1000000>;
			regulator-max-microvolt = <1400000>;
			qcom,switch-mode-frequency = <4800000>;
		};

		s4 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			qcom,switch-mode-frequency = <3200000>;
		};

		s7 {
			regulator-min-microvolt = <1300000>;
			regulator-max-microvolt = <1300000>;
			qcom,switch-mode-frequency = <3200000>;
		};

		l3 {
			regulator-min-microvolt = <3050000>;
			regulator-max-microvolt = <3300000>;
			bias-pull-down;
		};

		l4 {
			regulator-min-microvolt = <1000000>;
			regulator-max-microvolt = <1800000>;
			bias-pull-down;
		};

		l5 {
			regulator-min-microvolt = <2750000>;
			regulator-max-microvolt = <3000000>;
			bias-pull-down;
		};

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

		l23 {
			regulator-min-microvolt = <1700000>;
			regulator-max-microvolt = <1900000>;
			bias-pull-down;
		};

		lvs1 {
			bias-pull-down;
		};

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

&sata_phy0 {
	status = "okay";
};

&sata0 {
	target-supply = <&pm8921_s4>;
	status = "okay";
};

/* eMMC */
&sdcc1 {
	vmmc-supply = <&pm8921_l5>;
	vqmmc-supply = <&pm8921_s4>;
	status = "okay";
};

/* External micro SD card */
&sdcc3 {
	vmmc-supply = <&pm8921_l6>;
	pinctrl-names = "default";
	pinctrl-0 = <&card_detect>;
	cd-gpios = <&tlmm_pinmux 26 GPIO_ACTIVE_LOW>;
	status = "okay";
};

/* WLAN */
&sdcc4 {
	vmmc-supply = <&ext_3p3v>;
	vqmmc-supply = <&pm8921_lvs1>;
	mmc-pwrseq = <&sdcc4_pwrseq>;
	status = "okay";
};

&tlmm_pinmux {
	card_detect: card_detect {
		mux {
			pins = "gpio26";
			function = "gpio";
			bias-disable;
		};
	};

	pcie_pins: pcie_pinmux {
		mux {
			pins = "gpio27";
			function = "gpio";
		};
		conf {
			pins = "gpio27";
			drive-strength = <12>;
			bias-disable;
		};
	};
};

&usb_hs1_phy {
	v3p3-supply = <&pm8921_l3>;
	v1p8-supply = <&pm8921_l4>;
};

&usb_hs3_phy {
	v3p3-supply = <&pm8921_l3>;
	v1p8-supply = <&pm8921_l23>;
};

&usb_hs4_phy {
	v3p3-supply = <&pm8921_l3>;
	v1p8-supply = <&pm8921_l23>;
};

/* OTG */
&usb1 {
	dr_mode = "otg";
	status = "okay";
};

&usb3 {
	dr_mode = "host";
	status = "okay";
};

&usb4 {
	dr_mode = "host";
	status = "okay";
};


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

&tlmm_pinmux {
	sdc4_gpios: sdc4-gpios {
		pios {
			pins = "gpio63", "gpio64", "gpio65", "gpio66", "gpio67", "gpio68";
			function = "sdc4";
		};
	};

	sdcc1_pins: sdcc1-pin-active {
		clk {
			pins = "sdc1_clk";
			drive-strengh = <16>;
			bias-disable;
		};

		cmd {
			pins = "sdc1_cmd";
			drive-strengh = <10>;
			bias-pull-up;
		};

		data {
			pins = "sdc1_data";
			drive-strengh = <10>;
			bias-pull-up;
		};
	};

	sdcc3_pins: sdcc3-pin-active {
		clk {
			pins = "sdc3_clk";
			drive-strengh = <8>;
			bias-disable;
		};

		cmd {
			pins = "sdc3_cmd";
			drive-strengh = <8>;
			bias-pull-up;
		};

		data {
			pins = "sdc3_data";
			drive-strengh = <8>;
			bias-pull-up;
		};
	};

	ps_hold: ps_hold {
		mux {
			pins = "gpio78";
			function = "ps_hold";
		};
	};

	i2c1_pins: i2c1 {
		mux {
			pins = "gpio20", "gpio21";
			function = "gsbi1";
		};

		pinconf {
			pins = "gpio20", "gpio21";
			drive-strength = <16>;
			bias-disable;
		};
	};

	i2c1_pins_sleep: i2c1_pins_sleep {
		mux {
			pins = "gpio20", "gpio21";
			function = "gpio";
		};
		pinconf {
			pins = "gpio20", "gpio21";
			drive-strength = <2>;
			bias-disable;
		};
	};

	gsbi1_uart_2pins: gsbi1_uart_2pins {
		mux {
			pins = "gpio18", "gpio19";
			function = "gsbi1";
		};
	};

	gsbi1_uart_4pins: gsbi1_uart_4pins {
		mux {
			pins = "gpio18", "gpio19", "gpio20", "gpio21";
			function = "gsbi1";
		};
	};

	i2c2_pins: i2c2 {
		mux {
			pins = "gpio24", "gpio25";
			function = "gsbi2";
		};

		pinconf {
			pins = "gpio24", "gpio25";
			drive-strength = <16>;
			bias-disable;
		};
	};

	i2c2_pins_sleep: i2c2_pins_sleep {
		mux {
			pins = "gpio24", "gpio25";
			function = "gpio";
		};

		pinconf {
			pins = "gpio24", "gpio25";
			drive-strength = <2>;
			bias-disable;
		};
	};

	i2c3_pins: i2c3 {
		mux {
			pins = "gpio8", "gpio9";
			function = "gsbi3";
		};

		pinconf {
			pins = "gpio8", "gpio9";
			drive-strength = <16>;
			bias-disable;
		};
	};

	i2c3_pins_sleep: i2c3_pins_sleep {
		mux {
			pins = "gpio8", "gpio9";
			function = "gpio";
		};
		pinconf {
			pins = "gpio8", "gpio9";
			drive-strength = <2>;
			bias-disable;
		};
	};

	i2c4_pins: i2c4 {
		mux {
			pins = "gpio12", "gpio13";
			function = "gsbi4";
		};

		pinconf {
			pins = "gpio12", "gpio13";
			drive-strength = <16>;
			bias-disable;
		};
	};

	i2c4_pins_sleep: i2c4_pins_sleep {
		mux {
			pins = "gpio12", "gpio13";
			function = "gpio";
		};
		pinconf {
			pins = "gpio12", "gpio13";
			drive-strength = <2>;
			bias-disable;
		};
	};

	spi5_default: spi5_default {
		pinmux {
			pins = "gpio51", "gpio52", "gpio54";
			function = "gsbi5";
		};

		pinmux_cs {
			function = "gpio";
			pins = "gpio53";
		};

		pinconf {
			pins = "gpio51", "gpio52", "gpio54";
			drive-strength = <16>;
			bias-disable;
		};

		pinconf_cs {
			pins = "gpio53";
			drive-strength = <16>;
			bias-disable;
			output-high;
		};
	};

	spi5_sleep: spi5_sleep {
		pinmux {
			function = "gpio";
			pins = "gpio51", "gpio52", "gpio53", "gpio54";
		};

		pinconf {
			pins = "gpio51", "gpio52", "gpio53", "gpio54";
			drive-strength = <2>;
			bias-pull-down;
		};
	};

	i2c6_pins: i2c6 {
		mux {
			pins = "gpio16", "gpio17";
			function = "gsbi6";
		};

		pinconf {
			pins = "gpio16", "gpio17";
			drive-strength = <16>;
			bias-disable;
		};
	};

	i2c6_pins_sleep: i2c6_pins_sleep {
		mux {
			pins = "gpio16", "gpio17";
			function = "gpio";
		};
		pinconf {
			pins = "gpio16", "gpio17";
			drive-strength = <2>;
			bias-disable;
		};
	};

	gsbi6_uart_2pins: gsbi6_uart_2pins {
		mux {
			pins = "gpio14", "gpio15";
			function = "gsbi6";
		};
	};

	gsbi6_uart_4pins: gsbi6_uart_4pins {
		mux {
			pins = "gpio14", "gpio15", "gpio16", "gpio17";
			function = "gsbi6";
		};
	};

	gsbi7_uart_2pins: gsbi7_uart_2pins {
		mux {
			pins = "gpio82", "gpio83";
			function = "gsbi7";
		};
	};

	gsbi7_uart_4pins: gsbi7_uart_4pins {
		mux {
			pins = "gpio82", "gpio83", "gpio84", "gpio85";
			function = "gsbi7";
		};
	};

	i2c7_pins: i2c7 {
		mux {
			pins = "gpio84", "gpio85";
			function = "gsbi7";
		};

		pinconf {
			pins = "gpio84", "gpio85";
			drive-strength = <16>;
			bias-disable;
		};
	};

	i2c7_pins_sleep: i2c7_pins_sleep {
		mux {
			pins = "gpio84", "gpio85";
			function = "gpio";
		};
		pinconf {
			pins = "gpio84", "gpio85";
			drive-strength = <2>;
			bias-disable;
		};
	};

	riva_fm_pin_a: riva-fm-active {
		pins = "gpio14", "gpio15";
		function = "riva_fm";
	};

	riva_bt_pin_a: riva-bt-active {
		pins = "gpio16", "gpio17";
		function = "riva_bt";
	};

	riva_wlan_pin_a: riva-wlan-active {
		pins = "gpio64", "gpio65", "gpio66", "gpio67", "gpio68";
		function = "riva_wlan";

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

	hdmi_pinctrl: hdmi-pinctrl {
		mux {
			pins = "gpio70", "gpio71", "gpio72";
			function = "hdmi";
		};

		pinconf_ddc {
			pins = "gpio70", "gpio71";
			bias-pull-up;
			drive-strength = <2>;
		};

		pinconf_hpd {
			pins = "gpio72";
			bias-pull-down;
			drive-strength = <16>;
		};
	};
};


code:
// SPDX-License-Identifier: GPL-2.0
#include "qcom-apq8064-v2.0.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/mfd/qcom-rpm.h>
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>

/ {
	model = "Sony Xperia Z";
	compatible = "sony,xperia-yuga", "qcom,apq8064";
	chassis-type = "handset";

	aliases {
		serial0 = &gsbi5_serial;
	};

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

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

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

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

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

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

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

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

&gsbi5_serial {
	pinctrl-names = "default";
	pinctrl-0 = <&gsbi5_uart_pin_a>;
	status = "okay";
};

&pm8921_gpio {
	gpio_keys_pin_a: gpio-keys-active-state {
		pins = "gpio3", "gpio4", "gpio29", "gpio35";
		function = "normal";

		bias-pull-up;
		drive-push-pull;
		input-enable;
		power-source = <2>;
		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
		qcom,pull-up-strength = <0>;
	};
};

&riva {
	pinctrl-names = "default";
	pinctrl-0 = <&riva_wlan_pin_a>, <&riva_bt_pin_a>, <&riva_fm_pin_a>;
	status = "okay";
};

&rpm {
	regulators {
		vin_l1_l2_l12_l18-supply = <&pm8921_s4>;
		vin_lvs_1_3_6-supply = <&pm8921_s4>;
		vin_lvs_4_5_7-supply = <&pm8921_s4>;
		vin_ncp-supply = <&pm8921_l6>;
		vin_lvs2-supply = <&pm8921_s4>;
		vin_l24-supply = <&pm8921_s1>;
		vin_l25-supply = <&pm8921_s1>;
		vin_l27-supply = <&pm8921_s7>;
		vin_l28-supply = <&pm8921_s7>;

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

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

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

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

		s7 {
			regulator-min-microvolt = <1300000>;
			regulator-max-microvolt = <1300000>;
			qcom,switch-mode-frequency = <3200000>;
		};

		s8 {
			regulator-min-microvolt = <2200000>;
			regulator-max-microvolt = <2200000>;
			qcom,switch-mode-frequency = <1600000>;
		};

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

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

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

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

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

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

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

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

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

		l10 {
			regulator-min-microvolt = <2900000>;
			regulator-max-microvolt = <2900000>;
			bias-pull-down;
		};

		l11 {
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3000000>;
			bias-pull-down;
		};

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

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

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

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

		l17 {
			regulator-min-microvolt = <2000000>;
			regulator-max-microvolt = <2000000>;
			bias-pull-down;
		};

		l18 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			bias-pull-down;
		};

		l21 {
			regulator-min-microvolt = <1050000>;
			regulator-max-microvolt = <1050000>;
			bias-pull-down;
		};

		l22 {
			regulator-min-microvolt = <2600000>;
			regulator-max-microvolt = <2600000>;
			bias-pull-down;
		};

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

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

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

		l27 {
			regulator-min-microvolt = <1100000>;
			regulator-max-microvolt = <1100000>;
		};

		l28 {
			regulator-min-microvolt = <1050000>;
			regulator-max-microvolt = <1050000>;
			bias-pull-down;
		};

		l29 {
			regulator-min-microvolt = <2000000>;
			regulator-max-microvolt = <2000000>;
			bias-pull-down;
		};

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

		lvs2 {
			bias-pull-down;
		};

		lvs3 {
			bias-pull-down;
		};

		lvs4 {
			bias-pull-down;
		};

		lvs5 {
			bias-pull-down;
		};

		lvs6 {
			bias-pull-down;
		};

		lvs7 {
			bias-pull-down;
		};

		usb-switch {};

		hdmi-switch {};

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

&sdcc1 {
	vmmc-supply = <&pm8921_l5>;
	vqmmc-supply = <&pm8921_s4>;
	status = "okay";
};

&sdcc3 {
	vmmc-supply = <&pm8921_l6>;
	cd-gpios = <&tlmm_pinmux 26 GPIO_ACTIVE_LOW>;

	pinctrl-names = "default";
	pinctrl-0 = <&sdcc3_pins>, <&sdcc3_cd_pin_a>;

	status = "okay";
};

&tlmm_pinmux {
	gsbi5_uart_pin_a: gsbi5-uart-pin-active {
		rx {
			pins = "gpio52";
			function = "gsbi5";
			drive-strength = <2>;
			bias-pull-up;
		};

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

	sdcc3_cd_pin_a: sdcc3-cd-pin-active {
		pins = "gpio26";
		function = "gpio";

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

&usb_hs1_phy {
	v3p3-supply = <&pm8921_l3>;
	v1p8-supply = <&pm8921_l4>;
};

&usb1 {
	dr_mode = "otg";
	status = "okay";
};


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