// SPDX-License-Identifier: BSD-3-Clause
/*
 * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
 */

#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
#include "sm8350.dtsi"
#include "pm8350.dtsi"
#include "pm8350b.dtsi"
#include "pm8350c.dtsi"
#include "pmk8350.dtsi"
#include "pmr735a.dtsi"
#include "pmr735b.dtsi"

/ {
	/*
	 * Yes, you are correct, there is NO MORE {msm,board,pmic}-id on SM8350!
	 * Adding it will cause the bootloader to go crazy and randomly crash
	 * shortly after closing UEFI boot services.. Perhaps that has something
	 * to do with the OS running inside a VM now..?
	 */

	chassis-type = "handset";

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

		framebuffer: framebuffer@e1000000 {
			compatible = "simple-framebuffer";
			reg = <0 0xe1000000 0 0x2300000>;

			/* The display, even though it's 4K, initializes at 1080-ish p */
			width = <1096>;
			height = <2560>;
			stride = <(1096 * 4)>;
			format = "a8r8g8b8";
			/*
			 * That's (going to be) a lot of clocks, but it's necessary due
			 * to unused clk cleanup & no panel driver yet
			 */
			clocks = <&gcc GCC_DISP_HF_AXI_CLK>,
				 <&gcc GCC_DISP_SF_AXI_CLK>;
		};
	};

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

		pinctrl-names = "default";
		pinctrl-0 = <&focus_n &snapshot_n &vol_down_n &g_assist_n>;

		key-camera-focus {
			label = "Camera Focus";
			linux,code = <KEY_CAMERA_FOCUS>;
			gpios = <&pm8350b_gpios 8 GPIO_ACTIVE_LOW>;
			debounce-interval = <15>;
			linux,can-disable;
			wakeup-source;
		};

		key-camera-snapshot {
			label = "Camera Snapshot";
			linux,code = <KEY_CAMERA>;
			gpios = <&pm8350b_gpios 5 GPIO_ACTIVE_LOW>;
			debounce-interval = <15>;
			linux,can-disable;
			wakeup-source;
		};

		key-google-assist {
			label = "Google Assistant Key";
			gpios = <&pm8350_gpios 9 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_LEFTMETA>;
			debounce-interval = <15>;
			linux,can-disable;
			wakeup-source;
		};

		key-vol-down {
			label = "Volume Down";
			linux,code = <KEY_VOLUMEDOWN>;
			gpios = <&pmk8350_gpios 3 GPIO_ACTIVE_LOW>;
			debounce-interval = <15>;
			linux,can-disable;
			wakeup-source;
		};
	};

	reserved-memory {
		cont_splash_mem: memory@e1000000 {
			reg = <0 0xe1000000 0 0x2300000>;
			no-map;
		};

		ramoops@ffc00000 {
			compatible = "ramoops";
			reg = <0 0xffc00000 0 0x100000>;
			console-size = <0x40000>;
			record-size = <0x1000>;
			no-map;
		};
	};

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

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

&adsp {
	status = "okay";
	firmware-name = "qcom/sm8350/Sony/sagami/adsp.mbn";
};

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

		vdd-s1-supply = <&vph_pwr>;
		vdd-s2-supply = <&vph_pwr>;
		vdd-s3-supply = <&vph_pwr>;
		vdd-s4-supply = <&vph_pwr>;
		vdd-s5-supply = <&vph_pwr>;
		vdd-s6-supply = <&vph_pwr>;
		vdd-s7-supply = <&vph_pwr>;
		vdd-s8-supply = <&vph_pwr>;
		vdd-s9-supply = <&vph_pwr>;
		vdd-s10-supply = <&vph_pwr>;
		vdd-s11-supply = <&vph_pwr>;
		vdd-s12-supply = <&vph_pwr>;

		vdd-l1-l4-supply = <&pm8350_s11>;
		vdd-l2-l7-supply = <&vreg_bob>;
		vdd-l3-l5-supply = <&vreg_bob>;
		vdd-l6-l9-l10-supply = <&pm8350_s11>;

		/*
		 * ARC regulators:
		 * S5 - mx.lvl
		 * S6 - gfx.lvl
		 * S9 - mxc.lvl
		 */

		pm8350_s10: smps10 {
			regulator-name = "pm8350_s10";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350_s11: smps11 {
			regulator-name = "pm8350_s11";
			regulator-min-microvolt = <752000>;
			regulator-max-microvolt = <1000000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350_s12: smps12 {
			regulator-name = "pm8350_s12";
			regulator-min-microvolt = <1224000>;
			regulator-max-microvolt = <1360000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350_l1: ldo1 {
			regulator-name = "pm8350_l1";
			regulator-min-microvolt = <912000>;
			regulator-max-microvolt = <920000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350_l2: ldo2 {
			regulator-name = "pm8350_l2";
			regulator-min-microvolt = <3072000>;
			regulator-max-microvolt = <3072000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350_l3: ldo3 {
			regulator-name = "pm8350_l3";
			regulator-min-microvolt = <904000>;
			regulator-max-microvolt = <904000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		/* L4 - lmx.lvl (ARC) */

		pm8350_l5: ldo5 {
			regulator-name = "pm8350_l5";
			regulator-min-microvolt = <880000>;
			regulator-max-microvolt = <888000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
			regulator-allow-set-load;
			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
						   RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350_l6: ldo6 {
			regulator-name = "pm8350_l6";
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1208000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
			regulator-allow-set-load;
			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
						   RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350_l7: ldo7 {
			regulator-name = "pm8350_l7";
			regulator-min-microvolt = <2400000>;
			regulator-max-microvolt = <3008000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
			regulator-allow-set-load;
			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
						   RPMH_REGULATOR_MODE_HPM>;
		};

		/* L8 - lcx.lvl (ARC) */

		pm8350_l9: ldo9 {
			regulator-name = "pm8350_l9";
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
			regulator-allow-set-load;
			regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
						   RPMH_REGULATOR_MODE_HPM>;
		};
	};

	regulators-1 {
		compatible = "qcom,pm8350c-rpmh-regulators";
		qcom,pmic-id = "c";

		vdd-s1-supply = <&vph_pwr>;
		vdd-s2-supply = <&vph_pwr>;
		vdd-s3-supply = <&vph_pwr>;
		vdd-s4-supply = <&vph_pwr>;
		vdd-s5-supply = <&vph_pwr>;
		vdd-s6-supply = <&vph_pwr>;
		vdd-s7-supply = <&vph_pwr>;
		vdd-s8-supply = <&vph_pwr>;
		vdd-s9-supply = <&vph_pwr>;
		vdd-s10-supply = <&vph_pwr>;

		vdd-l1-l12-supply = <&pm8350c_s1>;
		vdd-l2-l8-supply = <&pm8350c_s1>;
		vdd-l3-l4-l5-l7-l13-supply = <&vreg_bob>;
		vdd-l6-l9-l11-supply = <&vreg_bob>;
		vdd-l10-supply = <&pm8350_s12>;

		vdd-bob-supply = <&vph_pwr>;

		pm8350c_s1: smps1 {
			regulator-name = "pm8350c_s1";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1952000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		/* S2 - ebi.lvl (ARC) */

		pm8350c_s3: smps3 {
			regulator-name = "pm8350c_s3";
			regulator-min-microvolt = <300000>;
			regulator-max-microvolt = <704000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		/*
		 * ARC regulators:
		 * S4 - mss.lvl
		 * S6 - cx.lvl
		 * S8 - mmcx.lvl
		 */

		pm8350c_s10: smps10 {
			regulator-name = "pm8350c_s10";
			regulator-min-microvolt = <1048000>;
			regulator-max-microvolt = <1128000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350c_l1: ldo1 {
			regulator-name = "pm8350c_l1";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350c_l2: ldo2 {
			regulator-name = "pm8350c_l2";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350c_l3: ldo3 {
			regulator-name = "pm8350c_l3";
			regulator-min-microvolt = <3304000>;
			regulator-max-microvolt = <3304000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350c_l4: ldo4 {
			regulator-name = "pm8350c_l4";
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <3000000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350c_l5: ldo5 {
			regulator-name = "pm8350c_l5";
			regulator-min-microvolt = <1704000>;
			regulator-max-microvolt = <3000000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350c_l6: ldo6 {
			regulator-name = "pm8350c_l6";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2960000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350c_l7: ldo7 {
			regulator-name = "pm8350c_l7";
			regulator-min-microvolt = <3008000>;
			regulator-max-microvolt = <3008000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350c_l8: ldo8 {
			regulator-name = "pm8350c_l8";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350c_l9: ldo9 {
			regulator-name = "pm8350c_l9";
			regulator-min-microvolt = <2960000>;
			/* Originally max = 3008000 but SDHCI expects 2960000 */
			regulator-max-microvolt = <2960000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350c_l10: ldo10 {
			regulator-name = "pm8350c_l10";
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350c_l11: ldo11 {
			regulator-name = "pm8350c_l11";
			regulator-min-microvolt = <2400000>;
			regulator-max-microvolt = <3008000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350c_l12: ldo12 {
			regulator-name = "pm8350c_l12";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <2000000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pm8350c_l13: ldo13 {
			regulator-name = "pm8350c_l13";
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3000000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		vreg_bob: bob {
			regulator-name = "vreg_bob";
			regulator-min-microvolt = <3400000>;
			regulator-max-microvolt = <3960000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
		};
	};

	/* TODO: Add pm8350b (just one ldo) once the driver part is in */

	regulators-2 {
		compatible = "qcom,pmr735a-rpmh-regulators";
		qcom,pmic-id = "e";

		vdd-s1-supply = <&vph_pwr>;
		vdd-s2-supply = <&vph_pwr>;
		vdd-s3-supply = <&vph_pwr>;

		vdd-l1-l2-supply = <&pmr735a_s2>;
		vdd-l3-supply = <&pmr735a_s1>;
		vdd-l4-supply = <&pm8350c_s1>;
		vdd-l5-l6-supply = <&pm8350c_s1>;
		vdd-l7-bob-supply = <&vreg_bob>;

		pmr735a_s1: smps1 {
			regulator-name = "pmr735a_s1";
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1280000>;
		};

		pmr735a_s2: smps2 {
			regulator-name = "pmr735a_s2";
			regulator-min-microvolt = <500000>;
			regulator-max-microvolt = <976000>;
		};

		pmr735a_s3: smps3 {
			regulator-name = "pmr735a_s3";
			regulator-min-microvolt = <2208000>;
			regulator-max-microvolt = <2352000>;
		};

		pmr735a_l1: ldo1 {
			regulator-name = "pmr735a_l1";
			regulator-min-microvolt = <912000>;
			regulator-max-microvolt = <912000>;
		};

		pmr735a_l2: ldo2 {
			regulator-name = "pmr735a_l2";
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
		};

		pmr735a_l3: ldo3 {
			regulator-name = "pmr735a_l3";
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
		};

		pmr735a_l4: ldo4 {
			regulator-name = "pmr735a_l4";
			regulator-min-microvolt = <1776000>;
			regulator-max-microvolt = <1872000>;
		};

		pmr735a_l5: ldo5 {
			regulator-name = "pmr735a_l5";
			regulator-min-microvolt = <800000>;
			regulator-max-microvolt = <800000>;
		};

		pmr735a_l6: ldo6 {
			regulator-name = "pmr735a_l6";
			regulator-min-microvolt = <480000>;
			regulator-max-microvolt = <904000>;
		};

		pmr735a_l7: ldo7 {
			regulator-name = "pmr735a_l7";
			regulator-min-microvolt = <2800000>;
			regulator-max-microvolt = <2800000>;
		};
	};
};

&cdsp {
	status = "okay";
	firmware-name = "qcom/sm8350/Sony/sagami/cdsp.mbn";
};

&i2c1 {
	status = "okay";
	clock-frequency = <1000000>;

	/* Some subset of SONY IMX663 camera sensor @ 38 */
};

&i2c4 {
	status = "okay";
	clock-frequency = <400000>;

	/* Samsung Touchscreen (needs I2C GPI DMA) @ 48 */
};

&i2c11 {
	status = "okay";
	clock-frequency = <1000000>;

	cs35l41_l: speaker-amp@40 {
		compatible = "cirrus,cs35l41";
		reg = <0x40>;
		interrupt-parent = <&tlmm>;
		interrupts = <36 IRQ_TYPE_LEVEL_LOW>;
		reset-gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>;
		cirrus,boost-peak-milliamp = <4000>;
		cirrus,boost-ind-nanohenry = <1000>;
		cirrus,boost-cap-microfarad = <15>;
		cirrus,asp-sdout-hiz = <3>;
		cirrus,gpio2-src-select = <2>;
		cirrus,gpio2-output-enable;
		#sound-dai-cells = <1>;
	};

	cs35l41_r: speaker-amp@41 {
		compatible = "cirrus,cs35l41";
		reg = <0x41>;
		interrupt-parent = <&tlmm>;
		interrupts = <36 IRQ_TYPE_LEVEL_LOW>;
		reset-gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>;
		cirrus,boost-peak-milliamp = <4000>;
		cirrus,boost-ind-nanohenry = <1000>;
		cirrus,boost-cap-microfarad = <15>;
		cirrus,asp-sdout-hiz = <3>;
		cirrus,gpio2-src-select = <2>;
		cirrus,gpio2-output-enable;
		#sound-dai-cells = <1>;
	};
};

&i2c12 {
	status = "okay";
	/* Clock frequency was not specified downstream, let's park it to 100 KHz */
	clock-frequency = <100000>;

	/* AMS TCS3490 RGB+IR color sensor @ 72 */
};

&i2c13 {
	status = "okay";
	/* Clock frequency was not specified downstream, let's park it to 100 KHz */
	clock-frequency = <100000>;

	/* Qualcomm PM8008i/PM8008j (?) @ 8, 9, c, d */
};

&i2c15 {
	status = "okay";
	clock-frequency = <400000>;

	/* NXP SN1X0 NFC @ 28 */
};

&i2c17 {
	status = "okay";
	clock-frequency = <1000000>;

	/* Cirrus Logic CS40L25A boosted haptics driver @ 40 */
};

&ipa {
	qcom,gsi-loader = "self";
	memory-region = <&pil_ipa_fw_mem>;
	firmware-name = "qcom/sm8350/Sony/sagami/ipa_fws.mbn";
	status = "okay";
};

&mpss {
	status = "okay";
	firmware-name = "qcom/sm8350/Sony/sagami/modem.mbn";
};

&pm8350_gpios {
	gpio-line-names = "ASSIGN1_THERM", /* GPIO_1 */
			  "LCD_ID",
			  "SDR_MMW_THERM",
			  "RF_ID",
			  "NC",
			  "FP_LDO_EN",
			  "SP_ARI_PWR_ALARM",
			  "NC",
			  "G_ASSIST_N",
			  "PM8350_OPTION"; /* GPIO_10 */

	g_assist_n: g-assist-n-state {
		pins = "gpio9";
		function = "normal";
		power-source = <1>;
		bias-pull-up;
		input-enable;
	};
};

&pm8350b_gpios {
	snapshot_n: snapshot-n-state {
		pins = "gpio5";
		function = "normal";
		power-source = <0>;
		bias-pull-up;
		input-enable;
	};

	focus_n: focus-n-state {
		pins = "gpio8";
		function = "normal";
		power-source = <0>;
		input-enable;
		bias-pull-up;
	};
};

&pmk8350_gpios {
	gpio-line-names = "NC", /* GPIO_1 */
			  "NC",
			  "VOL_DOWN_N",
			  "PMK8350_OPTION";

	vol_down_n: vol-down-n-state {
		pins = "gpio3";
		function = "normal";
		power-source = <0>;
		bias-pull-up;
		input-enable;
	};
};

&pmk8350_rtc {
	status = "okay";
};

&pon_pwrkey {
	status = "okay";
};

&pon_resin {
	status = "okay";
	linux,code = <KEY_VOLUMEUP>;
};

&qupv3_id_0 {
	status = "okay";
};

&qupv3_id_1 {
	status = "okay";
};

&qupv3_id_2 {
	status = "okay";
};

&sdhc_2 {
	cd-gpios = <&tlmm 92 GPIO_ACTIVE_HIGH>;
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc2_default_state &sdc2_card_det_active>;
	pinctrl-1 = <&sdc2_sleep_state &sdc2_card_det_sleep>;
	vmmc-supply = <&pm8350c_l9>;
	vqmmc-supply = <&pm8350c_l6>;
	no-sdio;
	no-mmc;
	status = "okay";
};

&slpi {
	status = "okay";
	firmware-name = "qcom/sm8350/Sony/sagami/slpi.mbn";
};

&spi14 {
	status = "okay";

	/* NXP SN1X0 NFC Secure Element @ 0 */
};

&tlmm {
	gpio-reserved-ranges = <44 4>;
	gpio-line-names = "APPS_I2C_0_SDA", /* GPIO_0 */
			  "APPS_I2C_0_SCL",
			  "UWIDEC_PWR_EN",
			  "HAP_RST_N",
			  "NC",
			  "NC",
			  "PM8008_1_RESET_N",
			  "NC",
			  "OIS_TELE_I2C_SDA",
			  "OIS_TELE_I2C_SCL",
			  "PM8350_OPTION", /* GPIO_10 */
			  "NC",
			  "APPS_I2C_1_SDA",
			  "APPS_I2C_1_SCL",
			  "NC",
			  "NC",
			  "CAM1_RESET_N",
			  "LEO_CAM0_RESET_N",
			  "DEBUG_UART_TX",
			  "DEBUG_UART_RX",
			  "TS_I2C_SDA", /* GPIO_20 */
			  "TS_I2C_SCL",
			  "TS_RESET_N",
			  "TS_INT_N",
			  "DISP_RESET_N",
			  "SW_SERVICE",
			  "DISP_ERR_FG",
			  "TX_GTR_THRES_IN",
			  "NC",
			  "NC",
			  "NC", /* GPIO_30 */
			  "NC",
			  "NC",
			  "NC",
			  "NC",
			  "NC",
			  "SPK_AMP_INT_N",
			  "SPK_AMP_RESET_N",
			  "FP_INT_N",
			  "FP_RESET_N",
			  "NC", /* GPIO_40 */
			  "NC",
			  "DEBUG_GPIO0",
			  "FORCE_USB_BOOT",
			  "FP_SPI_MISO",
			  "FP_SPI_MOSI",
			  "FP_SPI_CLK",
			  "FP_SPI_CS_N",
			  "SPK_AMP_I2C_SDA",
			  "SPK_AMP_I2C_SCL",
			  "NC", /* GPIO_50 */
			  "HAP_INT_N",
			  "CAMSENSOR_I2C_SDA",
			  "CAMSENSOR_I2C_SCL",
			  "SBU_SW_OE",
			  "SBU_SW_SEL",
			  "NFC_ESE_SPI_MISO",
			  "NFC_ESE_SPI_MOSI",
			  "NFC_ESE_SPI_CLK",
			  "NFC_ESE_SPI_CS",
			  "NFC_I2C_SDA", /* GPIO_60 */
			  "NFC_I2C_SCL",
			  "NFC_EN",
			  "NFC_CLK_REQ",
			  "HST_WLAN_EN",
			  "HST_BT_EN",
			  "HW_ID_0",
			  "HW_ID_1",
			  "HST_BT_UART_CTS",
			  "HST_BT_UART_RFR",
			  "HST_BT_UART_TX", /* GPIO_70 */
			  "HST_BT_UART_RX",
			  "HAP_I2C_SDA",
			  "HAP_I2C_SCL",
			  "RF_LCD_ID_EN",
			  "RF_ID_EXTENSION",
			  "NC",
			  "NC",
			  "NC",
			  "NC",
			  "HALL_INT_N", /* GPIO_80 */
			  "USB_CC_DIR",
			  "DISP_VSYNC",
			  "NC",
			  "NC",
			  "CAM_SOF_TELE",
			  "NFC_DWL_REQ",
			  "NFC_IRQ",
			  "WCD_RST_N",
			  "ALS_PROX_INT_N",
			  "NC", /* GPIO_90 */
			  "NC",
			  "TRAY_DET",
			  "UDON_SWITCH_SEL",
			  "PCIE0_RESET_N",
			  "PCIE0_CLK_REQ_N",
			  "PCIE0_WAKE_N",
			  "CAM_SOF",
			  "RF_ID_EXTENSION_2",
			  "RGBC_IR_INT",
			  "CAM_MCLK0", /* GPIO_100 */
			  "CAM_MCLK1",
			  "CAM_MCLK2",
			  "CAM_MCLK3",
			  "NC",
			  "NC",
			  "CAM2_RESET_N",
			  "CCI_I2C0_SDA",
			  "CCI_I2C0_SCL",
			  "CCI_I2C1_SDA",
			  "CCI_I2C1_SCL", /* GPIO_110 */
			  "CCI_I2C2_SDA",
			  "CCI_I2C2_SCL",
			  "CCI_I2C3_SDA",
			  "CCI_I2C3_SCL",
			  "NC",
			  "PM8008_1_IRQ",
			  "CAM3_RESET_N",
			  "IMU1_INT",
			  "EXT_VD0_XVS",
			  "NC", /* GPIO_120 */
			  "NC",
			  "NC",
			  "NC",
			  "NC",
			  "HAP_I2S_CLK",
			  "HAP_I2S_DOUT",
			  "HAP_TRG1",
			  "HAP_I2S_SYNC",
			  "HST_BT_WLAN_SLIMBUS_CLK",
			  "HST_BT_WLAN_SLIMBUS_DAT0", /* GPIO_130 */
			  "NC",
			  "UIM2_DETECT_EN",
			  "UIM2_DATA",
			  "UIM2_CLK",
			  "UIM2_RESET",
			  "UIM2_PRESENT",
			  "UIM1_DATA",
			  "UIM1_CLK",
			  "UIM1_RESET",
			  "TRAY_DET", /* GPIO_140 */
			  "SM_RFFE0_CLK",
			  "SM_RFFE0_DATA",
			  "SM_RFFE1_CLK",
			  "SM_RFFE1_DATA",
			  "SM_MSS_GRFC4",
			  "SM_MSS_GRFC5",
			  "SM_MSS_GRFC6",
			  "SM_MSS_GRFC7",
			  "SM_RFFE4_CLK",
			  "SM_RFFE4_DATA", /* GPIO_150 */
			  "WLAN_COEX_UART1_RX",
			  "WLAN_COEX_UART1_TX",
			  "HST_SW_CTRL",
			  "DISP_VDDR_EN",
			  "NC",
			  "NC",
			  "PA_INDICATOR_OR",
			  "NC",
			  "QLINK0_REQ",
			  "QLINK0_EN", /* GPIO_160 */
			  "QLINK0_WMSS_RESET_N",
			  "NC",
			  "NC",
			  "NC",
			  "PM8008_2_IRQ",
			  "TELEC_PWR_EN",
			  "PM8008_2_RESET_N",
			  "WCD_SWR_TX_CLK",
			  "WCD_SWR_TX_DATA0",
			  "WCD_SWR_TX_DATA1", /* GPIO_170 */
			  "WCD_SWR_RX_CLK",
			  "WCD_SWR_RX_DATA0",
			  "WCD_SWR_RX_DATA1",
			  "SM_DMIC1_CLK",
			  "SM_DMIC1_DATA",
			  "SM_DMIC2_CLK",
			  "SM_DMIC2_DATA",
			  "SPK_AMP_I2S_CLK",
			  "SPK_AMP_I2S_WS",
			  "SPK_AMP_I2S_ASP_DIN", /* GPIO_180 */
			  "SPK_AMP_I2S_ASP_DOUT",
			  "WCD_SWR_TX_DATA2",
			  "NC",
			  "NC",
			  "NC",
			  "NC",
			  "IMU_SPI_MISO",
			  "IMU_SPI_MOSI",
			  "IMU_SPI_CLK",
			  "IMU_SPI_CS_N", /* GPIO_190 */
			  "MAG_I2C_SDA",
			  "MAG_I2C_SCL",
			  "SENSOR_I2C_SDA",
			  "SENSOR_I2C_SCL",
			  "NC",
			  "NC",
			  "NC",
			  "NC",
			  "HST_BLE_UART_TX",
			  "HST_BLE_UART_RX", /* GPIO_200 */
			  "HST_WLAN_UART_TX",
			  "HST_WLAN_UART_RX";

	ts_int_default: ts-int-default-state {
		pins = "gpio23";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
	};

	sdc2_card_det_active: sd-card-det-active-state {
		pins = "gpio92";
		function = "gpio";
		drive-strength = <2>;
		bias-pull-up;
	};

	sdc2_card_det_sleep: sd-card-det-sleep-state {
		pins = "gpio92";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
	};
};

/* BIG WARNING! DO NOT TOUCH UFS, YOUR DEVICE WILL DIE! */
&ufs_mem_hc { status = "disabled"; };
&ufs_mem_phy { status = "disabled"; };

&usb_1 {
	status = "okay";
};

&usb_1_dwc3 {
	dr_mode = "peripheral";
};

&usb_1_hsphy {
	status = "okay";

	vdda-pll-supply = <&pm8350_l5>;
	vdda18-supply = <&pm8350c_l1>;
	vdda33-supply = <&pm8350_l2>;
};

&usb_1_qmpphy {
	status = "okay";

	vdda-phy-supply = <&pm8350_l6>;
	vdda-pll-supply = <&pm8350_l1>;
};