/*
   this file is for attribution only of marble
   And public attribution of xiaomi platforms(like K2 and so and)
*/
#include "marble-pinctrl.dtsi"
#include "xiaomi-sm7475-common.dtsi"
&qupv3_se15_i2c {
	status = "ok";
	/* TOP Smart PA */
	aw882xx_smartpa@34 {
		compatible = "awinic,aw882xx_smartpa";
		reg = <0x34>;
		irq-gpio = <&tlmm 88 0x2008>;
		reset-gpio = <&tlmm 1 0x2008>;
		pinctrl-names = "default","sleep";
		pinctrl-0 = <&aw882xx_reset_active_top &aw882xx_irq_active_top>;
		pinctrl-1 = <&aw882xx_reset_suspend_top>;
		dc-flag = <0>;
		sync-flag = <1>;
		sound-channel = <0>;
		aw-cali-mode = "aw_none ";
		spksw-gpio = <&tlmm 52 0>;
		status = "ok";
	};
	/* BOT Smart PA */
	aw882xx_smartpa@35 {
		compatible = "awinic,aw882xx_smartpa";
		reg = <0x35>;
		irq-gpio = <&tlmm 63 0x2008>;
		reset-gpio = <&tlmm 120 0x2008>;
		pinctrl-names = "default","sleep";
		pinctrl-0 = <&aw882xx_reset_active_bot>;
		pinctrl-1 = <&aw882xx_reset_suspend_bot>;
		dc-flag = <0>;
		sync-flag = <1>;
		sound-channel = <1>;
		aw-cali-mode = "aw_none ";
		status = "ok";
	};
};

&soc {
	fingerprint_fpc {
		status = "ok";
		compatible = "fpc,fpc1020";
		interrupt-parent = <&tlmm>;
		interrupts = <40 0x0>;
		fpc,gpio_rst    = <&tlmm 41 0x0>;
		fpc,gpio_irq    = <&tlmm 40 0x0>;
		fp_vdd_vreg-supply = <&L1C>;
		pinctrl-names = "fpc1020_reset_reset",
				"fpc1020_reset_active",
				"fpc1020_irq_active";

		pinctrl-0 = <&msm_gpio_reset>;
		pinctrl-1 = <&msm_gpio_reset_output_high>;
		pinctrl-2 = <&msm_gpio_irq>;
	};

	fingerprint_goodix {
		compatible = "goodix,fingerprint";
		vdda-supply = <&L6C>;
		goodix,gpio-reset = <&tlmm 41 0x0>;
		goodix,gpio-irq = <&tlmm 40 0x0>;
		status = "ok";
	};

	xiaomi_fingerprint {
		compatible = "xiaomi-fingerprint";
		status = "ok";
		fingerprint,name = "xiaomi-fingerprint";
	};

	adsp_sleepmon: adsp-sleepmon {
		compatible = "qcom,adsp-sleepmon";
		qcom,wait_time_lpm = <45>;
		qcom,wait_time_lpi = <45>;
	};
};

&tlmm {
	mi_ts_active: mi_ts_active {
		mux {
			pins = "gpio20", "gpio21";
			function = "gpio";
		};

		config {
			pins = "gpio20", "gpio21";
			drive-strength = <8>;
			bias-pull-up;
		};
	};

	mi_ts_cs_active: mi_ts_cs_active {
		mux {
			pins = "gpio19";
			function = "qup4";
		};

		config {
			pins = "gpio19";
			drive-strength = <16>;
			bias-pull-up;
		};
	};

	mi_ts_cs_suspend: mi_ts_cs_suspend {
		mux {
			pins = "gpio19";
			function = "gpio";
		};

		config {
			pins = "gpio19";
			drive-strength = <16>;
			bias-pull-up;
		};
	};

	pmx_ts_reset_suspend: pmx_ts_reset_suspend {
		ts_reset_suspend: ts_reset_suspend {
			mux {
				pins = "gpio20";
				function = "gpio";
			};

			config {
				pins = "gpio20";
				drive-strength = <2>;
				bias-pull-down;
			};
		};
	};

	pmx_ts_int_suspend: pmx_ts_int_suspend {
		ts_int_suspend: ts_int_suspend {
			mux {
				pins = "gpio21";
				function = "gpio";
			};

			config {
				pins = "gpio21";
				drive-strength = <2>;
				bias-pull-down;
			};
		};
	};

	mi_ts_spi_active: qupv3_se4_spi_active {
		mux {
			pins = "gpio16", "gpio17", "gpio18";
			function = "qup4";
		};
		config {
			pins = "gpio16", "gpio17", "gpio18";
			drive-strength = <6>;
			bias-disable;
		};
	};

	mi_ts_spi_suspend: qupv3_se4_spi_sleep {
		mux {
			pins = "gpio16", "gpio17", "gpio18";
			function = "gpio";
		};
		config {
			pins = "gpio16", "gpio17", "gpio18";
			drive-strength = <6>;
			bias-disable;
		};
	};

	/* FP_RESET_N */
	msm_gpio_reset: msm_gpio_reset {
		mux {
			pins = "gpio41";
			function = "gpio";
		};
		config {
			pins = "gpio41";
			drive-strength = <2>;
			bias-disable;
			output-low;
		};
	};

	/* FP_RESET_N, state device active*/
	msm_gpio_reset_output_high: msm_gpio_reset_output_high {
		mux {
			pins = "gpio41";
			function = "gpio";
		};
		config {
			pins = "gpio41";
			drive-strength = <2>;
			bias-disable;
			output-high;
		};
	};

	/* FP_INT_N */
	msm_gpio_irq: msm_gpio_irq {
		mux {
			pins = "gpio40";
			function = "gpio";
		};
		config {
			pins = "gpio40";
			drive-strength = <2>;
			bias-pull-down;
		};
	};
};

&L1C {
	regulator-min-microvolt = <1800000>;
	regulator-max-microvolt = <1800000>;
	qcom,init-voltage = <1800000>;
};

&L2C {
	regulator-min-microvolt = <1800000>;
	regulator-max-microvolt = <1800000>;
	qcom,init-voltage = <1800000>;
};

&L6C {
	regulator-min-microvolt = <3300000>;
	regulator-max-microvolt = <3300000>;
	qcom,init-voltage = <3300000>;
};


&L9C {
	regulator-min-microvolt = <3224000>;
	regulator-max-microvolt = <3224000>;
	qcom,init-voltage = <3224000>;
};

&qupv3_se4_spi {
	status = "ok";
	qcom,rt;
	pinctrl-0 = <&mi_ts_spi_active &mi_ts_cs_active>;
	pinctrl-1 = <&mi_ts_spi_suspend &mi_ts_cs_suspend>;
	m16t-touch@0 {
		status = "ok";
		compatible = "goodix,gt9916S";
		reg = <0>;
		spi-max-frequency = <15000000>;
		interrupt-parent = <&tlmm>;
		interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
		pinctrl-names = "default", "sleep";
		pinctrl-0 = <&mi_ts_active>;
		pinctrl-1 = <&ts_int_suspend &ts_reset_suspend>;
		goodix,iovdd-name = "iovdd";
		iovdd-supply = <&L2C>;
		goodix,avdd-name = "avdd";
		avdd-supply = <&L9C>;
		goodix,irq-gpio = <&tlmm 21 GPIO_TRANSITORY>;
		goodix,irq-flags = <IRQ_TYPE_EDGE_FALLING>;
		goodix,reset-gpio = <&tlmm 20 GPIO_ACTIVE_HIGH>;
		goodix,panel-max-x = <1080>;
		goodix,panel-max-y = <2400>;
		goodix,panel-max-w = <255>;
		goodix,panel-max-p = <4096>;
		goodix,panel-id-gpio-a = <&tlmm 119 GPIO_ACTIVE_LOW>;
		goodix,panel-id-gpio-b = <&tlmm 117 GPIO_ACTIVE_LOW>;
		goodix,firmware-namea = "goodix_firmware_TM.bin";
		goodix,firmware-nameb = "goodix_firmware_TM_Second.bin";
		goodix,config-namea = "goodix_cfg_group_TM.bin";
		goodix,config-nameb = "goodix_cfg_group_TM_Second.bin";
	};
};

&pmk8350_vadc {
	pinctrl-names = "default";
	pinctrl-0 = <&pm8350b_rear_tof_therm_default>;

	pm8350_msm_therm {
		reg = <PM8350_ADC7_AMUX_THM1_100K_PU>;
		label = "pm8350_msm_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	pm8350_cam_flash_therm {
		reg = <PM8350_ADC7_AMUX_THM2_100K_PU>;
		label = "pm8350_cam_flash_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	pm8350_hot_pocket_therm {
		reg = <PM8350_ADC7_AMUX_THM3_100K_PU>;
		label = "pm8350_hot_pocket_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	pm8350_wide_rfc_therm {
		reg = <PM8350B_ADC7_GPIO4_100K_PU>;
		label = "pm8350_wide_rfc_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	pm8350b_rear_tof_therm {
		reg = <PM8350B_ADC7_AMUX_THM4_100K_PU>;
		label = "pm8350b_rear_tof_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	pm8350b_usb_conn_therm {
		reg = <PMR735A_ADC7_GPIO1_100K_PU>;
		label = "pm8350b_usb_conn_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	pm8350b_wl_chg_therm {
		reg = <PMR735A_ADC7_GPIO2_100K_PU>;
		label = "pm8350b_wl_chg_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};

	pmk8350_xo_therm {
		reg = <PMR735A_ADC7_GPIO3_100K_PU>;
		label = "pmk8350_xo_therm";
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
		qcom,pre-scaling = <1 1>;
	};
};

&pmk8350_adc_tm {
	io-channels = <&pmk8350_vadc PM8350_ADC7_AMUX_THM1_100K_PU>,
			<&pmk8350_vadc PM8350_ADC7_AMUX_THM2_100K_PU>,
			<&pmk8350_vadc PM8350_ADC7_AMUX_THM3_100K_PU>,
			<&pmk8350_vadc PM8350B_ADC7_GPIO4_100K_PU>,
			<&pmk8350_vadc PM8350B_ADC7_AMUX_THM4_100K_PU>,
			<&pmk8350_vadc PMR735A_ADC7_GPIO1_100K_PU>,
			<&pmk8350_vadc PMR735A_ADC7_GPIO2_100K_PU>,
			<&pmk8350_vadc PMR735A_ADC7_GPIO3_100K_PU>;

	pm8350_msm_therm {
		reg = <PM8350_ADC7_AMUX_THM1_100K_PU>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};

	pm8350_cam_flash_therm {
		reg = <PM8350_ADC7_AMUX_THM2_100K_PU>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};

	pm8350_hot_pocket_therm {
		reg = <PM8350_ADC7_AMUX_THM3_100K_PU>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};

	pm8350_wide_rfc_therm {
		reg = <PM8350B_ADC7_GPIO4_100K_PU>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};

	pm8350b_rear_tof_therm {
		reg = <PM8350B_ADC7_AMUX_THM4_100K_PU>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};

	pm8350b_usb_conn_therm {
		reg = <PMR735A_ADC7_GPIO1_100K_PU>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};

	pm8350b_wl_chg_therm {
		reg = <PMR735A_ADC7_GPIO2_100K_PU>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};

	pmk8350_xo_therm {
		reg = <PMR735A_ADC7_GPIO3_100K_PU>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};
};

&thermal_zones {
	cpu_therm {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pmk8350_adc_tm PM8350_ADC7_AMUX_THM1_100K_PU>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	flash_therm {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pmk8350_adc_tm PM8350_ADC7_AMUX_THM2_100K_PU>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	quiet_therm {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pmk8350_adc_tm PM8350_ADC7_AMUX_THM3_100K_PU>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	charger_therm0 {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pmk8350_adc_tm PM8350B_ADC7_GPIO4_100K_PU>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	conn_therm {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pmk8350_adc_tm PM8350B_ADC7_AMUX_THM4_100K_PU>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	pa_therm0 {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pmk8350_adc_tm PMR735A_ADC7_GPIO1_100K_PU>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	pa_therm1 {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pmk8350_adc_tm PMR735A_ADC7_GPIO2_100K_PU>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	wifi_therm {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&pmk8350_adc_tm PMR735A_ADC7_GPIO3_100K_PU>;
		wake-capable-sensor;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};
};

&nxp_eusb2_repeater {
        qcom,param-override-seq =
                <0x61 0x08
                0x00 0x07>;
        qcom,param-override-seq-host =
                <0x62 0x08
                0x10 0x07
                0x1 0xa>;
};

&battery_charger {
	mi,support-soc-update;
};

&ufshc_mem {
	qcom,iommu-dma = "bypass";
};
