#include <dt-bindings/thermal/thermal_qti.h>
#include "holi-thermal-modem.dtsi"

&soc {
	tsens0:tsens@4410000 {
		compatible = "qcom,tsens26xx";
		reg = <0x04410000 0x20>,
			<0x04411000 0x140>;
		reg-names = "tsens_srot_physical",
			"tsens_tm_physical";
		interrupts-extended = <&intc 0 275 IRQ_TYPE_LEVEL_HIGH>,
				<&intc 0 190 IRQ_TYPE_LEVEL_HIGH>,
				<&wakegic 89 IRQ_TYPE_EDGE_RISING>;
		interrupt-names = "tsens-upper-lower",
				"tsens-critical",
				"tsens-0C";
		tsens-reinit-wa;
		0C-sensor-num = <16>;
		#thermal-sensor-cells = <1>;
	};

	tsens1:tsens@4412000 {
		compatible = "qcom,tsens26xx";
		reg = <0x04412000 0x20>,
			<0x04413000 0x140>;
		reg-names = "tsens_srot_physical",
			"tsens_tm_physical";
		interrupts-extended = <&intc 0 293 IRQ_TYPE_LEVEL_HIGH>,
				<&intc 0 316 IRQ_TYPE_LEVEL_HIGH>,
				<&wakegic 90 IRQ_TYPE_EDGE_RISING>;
		interrupt-names = "tsens-upper-lower",
				"tsens-critical",
				"tsens-0C";
		tsens-reinit-wa;
		0C-sensor-num = <16>;
		#thermal-sensor-cells = <1>;
	};

	qmi-tmd-devices {
		compatible = "qcom,qmi-cooling-devices";

		cdsp {
			qcom,instance-id = <QMI_CDSP_INST_ID>;

			cdsp_sw: cdsp {
				qcom,qmi-dev-name = "cdsp_sw";
				#cooling-cells = <2>;
			};

			cdsp_hw: cdsp_hw {
				qcom,qmi-dev-name = "cdsp_hw";
				#cooling-cells = <2>;
			};
		};

		adsp {
			qcom,instance-id = <QMI_ADSP_INST_ID>;

			adsp_vdd: adsp_vdd {
				qcom,qmi-dev-name = "cpuv_restriction_cold";
				#cooling-cells = <2>;
			};
		};
	};
};

&rpm_bus {
	rpm_smd_cdev: rpm-smd-cdev {
		compatible = "qcom,rpm-smd-cooling-device";
		#cooling-cells = <2>;
	};
};

&msm_gpu {
	#cooling-cells = <2>;
};

&cpufreq_hw {
	qcom,cpu-isolation {
		compatible = "qcom,cpu-isolate";
		cpu0_isolate: cpu0-isolate {
			qcom,cpu = <&CPU0>;
			#cooling-cells = <2>;
		};

		cpu1_isolate: cpu1-isolate {
			qcom,cpu = <&CPU1>;
			#cooling-cells = <2>;
		};

		cpu2_isolate: cpu2-isolate {
			qcom,cpu = <&CPU2>;
			#cooling-cells = <2>;
		};

		cpu3_isolate: cpu3-isolate {
			qcom,cpu = <&CPU3>;
			#cooling-cells = <2>;
		};

		cpu4_isolate: cpu4-isolate {
			qcom,cpu = <&CPU4>;
			#cooling-cells = <2>;
		};

		cpu5_isolate: cpu5-isolate {
			qcom,cpu = <&CPU5>;
			#cooling-cells = <2>;
		};

		cpu6_isolate: cpu6-isolate {
			qcom,cpu = <&CPU6>;
			#cooling-cells = <2>;
		};

		cpu7_isolate: cpu7-isolate {
			qcom,cpu = <&CPU7>;
			#cooling-cells = <2>;
		};
	};
};

&thermal_zones {
	mapss-0-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens0 0>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	cpu-0-0-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens0 1>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	cpu-0-1-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens0 2>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	cpu-0-2-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens0 3>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	cpu-0-3-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens0 4>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	cpu-0-4-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens0 5>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	cpu-0-5-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens0 6>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	cpuss-0-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens0 7>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	cpuss-1-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens0 8>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	cpu-1-0-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens0 9>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	cpu-1-1-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens0 10>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	cpu-1-2-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens0 11>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	cpu-1-3-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens0 12>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	gpuss-0-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens0 13>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	gpuss-1-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens0 14>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	mapss-1-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens1 0>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	cwlan-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens1 1>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	audio-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens1 2>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	ddr-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens1 3>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	q6-hvx-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens1 4>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	camera-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens1 5>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	mdm-core0-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens1 6>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	mdm-core1-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens1 7>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	mdm-vec-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens1 8>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	msm-scl-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens1 9>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	video-usr {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "user_space";
		thermal-sensors = <&tsens1 10>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			reset-mon-cfg {
				temperature = <115000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};
	};

	cpu-0-0-step {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&tsens0 1>;
		trips {
			cpu00_config: cpu00-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};
		};

		cooling-maps {
			cpu00_cdev {
				trip = <&cpu00_config>;
				cooling-device = <&cpu0_isolate 1 1>;
			};
		};
	};

	cpu-0-1-step {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&tsens0 2>;
		trips {
			cpu01_config: cpu01-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};
		};

		cooling-maps {
			cpu01_cdev {
				trip = <&cpu01_config>;
				cooling-device = <&cpu1_isolate 1 1>;
			};
		};
	};

	cpu-0-2-step {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&tsens0 3>;
		trips {
			cpu02_config: cpu02-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};
		};

		cooling-maps {
			cpu02_cdev {
				trip = <&cpu02_config>;
				cooling-device = <&cpu2_isolate 1 1>;
			};
		};
	};

	cpu-0-3-step {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 4>;
		thermal-governor = "step_wise";
		trips {
			cpu03_config: cpu03-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};
		};

		cooling-maps {
			cpu03_cdev {
				trip = <&cpu03_config>;
				cooling-device = <&cpu3_isolate 1 1>;
			};
		};
	};

	cpu-0-4-step {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 5>;
		thermal-governor = "step_wise";
		trips {
			cpu04_config: cpu04-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};
		};

		cooling-maps {
			cpu04_cdev {
				trip = <&cpu04_config>;
				cooling-device = <&cpu4_isolate 1 1>;
			};
		};
	};

	cpu-0-5-step {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 6>;
		thermal-governor = "step_wise";
		trips {
			cpu05_config: cpu05-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};
		};

		cooling-maps {
			cpu05_cdev {
				trip = <&cpu05_config>;
				cooling-device = <&cpu5_isolate 1 1>;
			};
		};
	};

	cpu-1-0-step {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 9>;
		thermal-governor = "step_wise";
		trips {
			cpu10_config: cpu10-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};
		};

		cooling-maps {
			cpu10_cdev {
				trip = <&cpu10_config>;
				cooling-device = <&cpu6_isolate 1 1>;
			};

			cpu10_cdev1 {
				trip = <&cpu10_config>;
				cooling-device = <&CPU6 THERMAL_MAX_LIMIT
							THERMAL_MAX_LIMIT>;
			};
		};
	};

	cpu-1-1-step {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 10>;
		thermal-governor = "step_wise";
		trips {
			cpu11_config: cpu11-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};
		};

		cooling-maps {
			cpu11_cdev {
				trip = <&cpu11_config>;
				cooling-device = <&cpu6_isolate 1 1>;
			};

			cpu11_cdev1 {
				trip = <&cpu11_config>;
				cooling-device = <&CPU6 THERMAL_MAX_LIMIT
							THERMAL_MAX_LIMIT>;
			};
		};
	};

	cpu-1-2-step {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 11>;
		thermal-governor = "step_wise";
		trips {
			cpu12_config: cpu12-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};
		};

		cooling-maps {
			cpu12_cdev {
				trip = <&cpu12_config>;
				cooling-device = <&cpu7_isolate 1 1>;
			};

			cpu12_cdev1 {
				trip = <&cpu12_config>;
				cooling-device = <&CPU6 THERMAL_MAX_LIMIT
							THERMAL_MAX_LIMIT>;
			};
		};
	};

	cpu-1-3-step {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 12>;
		thermal-governor = "step_wise";
		trips {
			cpu13_config: cpu13-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};
		};

		cooling-maps {
			cpu13_cdev {
				trip = <&cpu13_config>;
				cooling-device = <&cpu7_isolate 1 1>;
			};

			cpu13_cdev1 {
				trip = <&cpu13_config>;
				cooling-device = <&CPU6 THERMAL_MAX_LIMIT
							THERMAL_MAX_LIMIT>;
			};
		};
	};

	gpuss-max-step {
		polling-delay-passive = <10>;
		polling-delay = <100>;
		thermal-governor = "step_wise";
		thermal-sensors = <&tsens0 13>, <&tsens0 14>;
		sensor-aggregation = <AGGREGATE_MAX_VALUE>;
		trips {
			gpuss_config: active-config0 {
				temperature = <95000>;
				hysteresis = <0>;
				type = "passive";
			};
		};

		cooling-maps {
			gpu_cdev {
				trip = <&gpuss_config>;
				cooling-device = <&msm_gpu THERMAL_NO_LIMIT
							THERMAL_NO_LIMIT>;
			};
		};
	};

	q6-hvx-step {
		polling-delay-passive = <10>;
		polling-delay = <0>;
		thermal-sensors = <&tsens1 4>;
		thermal-governor = "step_wise";

		trips {
			cdsp_trip0: cdsp-trip0 {
				temperature = <95000>;
				hysteresis = <0>;
				type = "passive";
			};

			cdsp_cx_mon: cdsp-cx-mon {
				temperature = <100000>;
				hysteresis = <5000>;
				type = "passive";
			};
		};

		cooling-maps {
			cdsp-cdev0 {
				trip = <&cdsp_trip0>;
				cooling-device = <&cdsp_sw THERMAL_NO_LIMIT
							THERMAL_NO_LIMIT>;
			};

			cdsp-cx-cdev0 {
				trip = <&cdsp_cx_mon>;
				cooling-device = <&msm_gpu THERMAL_MAX_LIMIT
							THERMAL_MAX_LIMIT>;
			};

			cdsp-cx-cdev1 {
				trip = <&cdsp_cx_mon>;
				cooling-device = <&modem_tj 3 3>;
			};

			cdsp-cx-cdev2 {
				trip = <&cdsp_cx_mon>;
				cooling-device = <&modem_pa 3 3>;
			};

			cdsp-cx-cdev3 {
				trip = <&cdsp_cx_mon>;
				cooling-device = <&cdsp_sw THERMAL_MAX_LIMIT
							THERMAL_MAX_LIMIT>;
			};
		};
	};

	zeroc-0-step {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 16>;
		thermal-governor = "step_wise";

		trips {
			zeroc_0_trip: active-config0 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};

		cooling-maps {
			rpm_smd_cdev {
				trip = <&zeroc_0_trip>;
				cooling-device = <&rpm_smd_cdev 2 2>;
			};

			cx_vdd_cdev {
				trip = <&zeroc_0_trip>;
				cooling-device = <&cx_cdev 1 1>;
			};

			mx_vdd_cdev {
				trip = <&zeroc_0_trip>;
				cooling-device = <&mx_cdev 1 1>;
			};

			gfx_vdd_cdev {
				trip = <&zeroc_0_trip>;
				cooling-device = <&gfx_cdev 1 1>;
			};

			adsp_vdd_cdev {
				trip = <&zeroc_0_trip>;
				cooling-device = <&adsp_vdd 1 1>;
			};

			modem_vdd_cdev {
				trip = <&zeroc_0_trip>;
				cooling-device = <&modem_vdd 1 1>;
			};
		};
	};

	zeroc-1-step {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens1 16>;
		thermal-governor = "step_wise";

		trips {
			zeroc_1_trip: active-config0 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};

		cooling-maps {
			rpm_smd_cdev {
				trip = <&zeroc_1_trip>;
				cooling-device = <&rpm_smd_cdev 2 2>;
			};

			cx_vdd_cdev {
				trip = <&zeroc_1_trip>;
				cooling-device = <&cx_cdev 1 1>;
			};

			mx_vdd_cdev {
				trip = <&zeroc_1_trip>;
				cooling-device = <&mx_cdev 1 1>;
			};

			gfx_vdd_cdev {
				trip = <&zeroc_1_trip>;
				cooling-device = <&gfx_cdev 1 1>;
			};

			adsp_vdd_cdev {
				trip = <&zeroc_1_trip>;
				cooling-device = <&adsp_vdd 1 1>;
			};

			modem_vdd_cdev {
				trip = <&zeroc_1_trip>;
				cooling-device = <&modem_vdd 1 1>;
			};
		};
	};
};
