#include <dt-bindings/thermal/thermal_qti.h>

&soc {
	#address-cells = <1>;
	#size-cells = <1>;
	lmh_dcvs0: qcom,limits-0-dcvs@f550800 {
		compatible = "qcom,msm-hw-limits";
		interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
		qcom,affinity = <0>;
		reg = <0xf550800 0x1000>,
			<0xf521000 0x1000>;
	};

	lmh_dcvs1: qcom,limits-1-dcvs@f550800 {
		compatible = "qcom,msm-hw-limits";
		interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
		qcom,affinity = <1>;
		reg = <0xf550800 0x1000>,
			<0xf523000 0x1000>;
	};

	qcom,cpu-pause {
		compatible = "qcom,thermal-pause";

		cpu0_pause: cpu0-pause {
			qcom,cpus = <&CPU0>;
			#cooling-cells = <2>;
		};

		cpu1_pause: cpu1-pause {
			qcom,cpus = <&CPU1>;
			#cooling-cells = <2>;
		};

		cpu2_pause: cpu2-pause {
			qcom,cpus = <&CPU2>;
			#cooling-cells = <2>;
		};

		cpu3_pause: cpu3-pause {
			qcom,cpus = <&CPU3>;
			#cooling-cells = <2>;
		};

		cpu4_pause: cpu4-pause {
			qcom,cpus = <&CPU4>;
			#cooling-cells = <2>;
		};

		cpu5_pause: cpu5-pause {
			qcom,cpus = <&CPU5>;
			#cooling-cells = <2>;
		};

		cpu6_pause: cpu6-pause {
			qcom,cpus = <&CPU6>;
			#cooling-cells = <2>;
		};

		cpu7_pause: cpu7-pause {
			qcom,cpus = <&CPU7>;
			#cooling-cells = <2>;
		};

		/* Thermal-engine cooling devices */
		pause-cpu0 {
			qcom,cpus = <&CPU0>;
			qcom,cdev-alias = "pause-cpu0";
		};

		pause-cpu1 {
			qcom,cpus = <&CPU1>;
			qcom,cdev-alias = "pause-cpu1";
		};

		pause-cpu2 {
			qcom,cpus = <&CPU2>;
			qcom,cdev-alias = "pause-cpu2";
		};

		pause-cpu3 {
			qcom,cpus = <&CPU3>;
			qcom,cdev-alias = "pause-cpu3";
		};

		pause-cpu4 {
			qcom,cpus = <&CPU4>;
			qcom,cdev-alias = "pause-cpu4";
		};

		pause-cpu5 {
			qcom,cpus = <&CPU5>;
			qcom,cdev-alias = "pause-cpu5";
		};

		pause-cpu6 {
			qcom,cpus = <&CPU6>;
			qcom,cdev-alias = "pause-cpu6";
		};

		pause-cpu7 {
			qcom,cpus = <&CPU7>;
			qcom,cdev-alias = "pause-cpu7";
		};
	};

	tsens0:tsens@c222000 {
		compatible = "qcom,tsens24xx";
		reg = <0x04410000  0x8>,
			<0x04411000  0x1ff>;
		reg-names = "tsens_srot_physical",
			"tsens_tm_physical";
		interrupts-extended = <&intc GIC_SPI 275 IRQ_TYPE_LEVEL_HIGH>,
				      <&mpm 2 IRQ_TYPE_LEVEL_HIGH>;
		interrupt-names = "tsens-upper-lower", "tsens-critical";
		tsens-reinit-wa;
		#thermal-sensor-cells = <1>;
	};

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

		modem {
			qcom,instance-id = <QMI_MODEM_INST_ID>;

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

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

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

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

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

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

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

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

			cdsp_hw: hvx {
				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>;
			};
		};
	};

	lmh_cpu_vdd: qcom,lmh-cpu-vdd@f550800 {
		compatible = "qcom,lmh-cpu-vdd";
		reg =  <0xf550800 0x1000>;
		#cooling-cells = <2>;
	};

	cxip_cdev: cxip-cdev@3ed000 {
		compatible = "qcom,cxip-lm-cooling-device";
		reg = <0x3ed000 0xc00c>;
		qcom,thermal-client-offset = <0x8000>;
		/* 4th and 5th offsets to bypass VICTIM1 */
		qcom,bypass-client-list = <0x1004 0x4004 0x6004 0xc004 0xc008>;
		#cooling-cells = <2>;
	};

	qcom,devfreq-cdev {
		compatible = "qcom,devfreq-cdev";
		qcom,devfreq = <&msm_gpu>;
	};

	qcom,cpufreq-cdev {
		compatible = "qcom,cpufreq-cdev";
		qcom,cpus = <&CPU0 &CPU4>;
	};
};

&thermal_zones {
	mapss {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 0>;
		trips {
			thermal-engine-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

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

	cdsp-hvx {
		polling-delay-passive = <10>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 1>;
		trips {
			thermal-engine-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

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

			cdsp_trip1: cdsp-trip1 {
				temperature = <95000>;
				hysteresis = <0>;
				type = "passive";
			};

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

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

		cooling-maps {
			cxip-cdev {
				trip = <&cdsp_trip0>;
				cooling-device = <&cxip_cdev 1 1>;
			};

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

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

			cdsp-cx-cdev1 {
				trip = <&cdsp_cx_mon>;
				cooling-device = <&modem_proc 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 4 4>;
			};
		};
	};

	wlan {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 2>;
		trips {
			thermal-engine-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

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

	camera {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 3>;
		trips {
			thermal-engine-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

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

	video {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 4>;
		trips {
			thermal-engine-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

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

	mdm-1 {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 5>;
		trips {
			thermal-engine-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

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

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

		cooling-maps {
			mdm1-cx-cdev0 {
				trip = <&mdm1_cx_mon>;
				cooling-device = <&msm_gpu 4 THERMAL_NO_LIMIT>;
			};

			mdm1-cx-cdev1 {
				trip = <&mdm1_cx_mon>;
				cooling-device = <&modem_proc 3 3>;
			};

			mdm1-cx-cdev2 {
				trip = <&mdm1_cx_mon>;
				cooling-device = <&modem_pa 3 3>;
			};

			mdm1-cx-cdev3 {
				trip = <&mdm1_cx_mon>;
				cooling-device = <&cdsp_sw 4 4>;
			};
		};
	};

	cpu-1-0 {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 6>;
		trips {
			thermal-engine-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			thermal-hal-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			cpu4_config: cpu4-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};

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

		cooling-maps {
			cpu4_cdev {
				trip = <&cpu4_config>;
				cooling-device = <&cpu4_pause 1 1>;
			};
		};
	};

	cpu-1-1 {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 7>;
		trips {
			thermal-engine-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			thermal-hal-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			cpu5_config: cpu5-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};

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

		cooling-maps {
			cpu5_cdev {
				trip = <&cpu5_config>;
				cooling-device = <&cpu5_pause 1 1>;
			};
		};
	};

	cpu-1-2 {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 8>;
		trips {
			thermal-engine-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			thermal-hal-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			cpu6_config: cpu6-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};

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

		cooling-maps {
			cpu6_cdev {
				trip = <&cpu6_config>;
				cooling-device = <&cpu6_pause 1 1>;
			};
		};
	};

	cpu-1-3 {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 9>;
		trips {
			thermal-engine-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			thermal-hal-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			cpu7_config: cpu7-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};

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

		cooling-maps {
			cpu7_cdev {
				trip = <&cpu7_config>;
				cooling-device = <&cpu7_pause 1 1>;
			};
		};
	};

	cpuss-0 {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 10>;
		trips {
			thermal-engine-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			thermal-hal-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			cpu4_5_config: cpu-4-5-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};

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

		cooling-maps {
			cpu4_cdev {
				trip = <&cpu4_5_config>;
				cooling-device = <&cpu4_pause 1 1>;
			};

			cpu5_cdev {
				trip = <&cpu4_5_config>;
				cooling-device = <&cpu5_pause 1 1>;
			};
		};
	};

	cpuss-1 {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 11>;
		trips {
			thermal-engine-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			thermal-hal-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			cpu6_7_config: cpu-6-7-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};

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

		cooling-maps {
			cpu6_cdev {
				trip = <&cpu6_7_config>;
				cooling-device = <&cpu6_pause 1 1>;
			};

			cpu7_cdev {
				trip = <&cpu6_7_config>;
				cooling-device = <&cpu7_pause 1 1>;
			};
		};
	};

	cpuss-2 {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 12>;
		trips {
			thermal-engine-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			thermal-hal-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			silv_cpus_config: silv-cpus-config {
				temperature = <110000>;
				hysteresis = <10000>;
				type = "passive";
			};

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

		cooling-maps {
			cpu0_cdev {
				trip = <&silv_cpus_config>;
				cooling-device = <&cpu0_pause 1 1>;
			};

			cpu1_cdev {
				trip = <&silv_cpus_config>;
				cooling-device = <&cpu1_pause 1 1>;
			};

			cpu2_cdev {
				trip = <&silv_cpus_config>;
				cooling-device = <&cpu2_pause 1 1>;
			};

			cpu3_cdev {
				trip = <&silv_cpus_config>;
				cooling-device = <&cpu3_pause 1 1>;
			};
		};
	};

	mdm-0 {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 13>;
		trips {
			thermal-engine-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

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

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

		cooling-maps {
			mdm0-cx-cdev0 {
				trip = <&mdm0_cx_mon>;
				cooling-device = <&msm_gpu 4 THERMAL_NO_LIMIT>;
			};

			mdm0-cx-cdev1 {
				trip = <&mdm0_cx_mon>;
				cooling-device = <&modem_proc 3 3>;
			};

			mdm0-cx-cdev2 {
				trip = <&mdm0_cx_mon>;
				cooling-device = <&modem_pa 3 3>;
			};

			mdm0-cx-cdev3 {
				trip = <&mdm0_cx_mon>;
				cooling-device = <&cdsp_sw 4 4>;
			};
		};
	};

	display {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 14>;
		trips {
			thermal-engine-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

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

	gpu {
		polling-delay-passive = <10>;
		polling-delay = <0>;
		thermal-sensors = <&tsens0 15>;
		trips {
			thermal-engine-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			thermal-hal-config {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			gpu_step_trip: gpu-trip {
				temperature = <95000>;
				hysteresis = <0>;
				type = "passive";
			};

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

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

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

			gpu-cx-cdev0 {
				trip = <&gpu_cx_mon>;
				cooling-device = <&msm_gpu 4 THERMAL_NO_LIMIT>;
			};

			gpu-cx-cdev1 {
				trip = <&gpu_cx_mon>;
				cooling-device = <&modem_proc 3 3>;
			};

			gpu-cx-cdev2 {
				trip = <&gpu_cx_mon>;
				cooling-device = <&modem_pa 3 3>;
			};

			gpu-cx-cdev3 {
				trip = <&gpu_cx_mon>;
				cooling-device = <&cdsp_sw 4 4>;
			};
		};
	};

	xo-therm {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&pm6125_adc_tm 2>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};

			active-config1 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	pa-therm0 {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&pm6125_adc_tm 0>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	quiet-therm {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&pm6125_adc_tm 1>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	camera-therm {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&pm6125_adc_tm_iio 0>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};

	emmc-ufs-therm {
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-sensors = <&pm6125_adc_tm_iio 1>;
		trips {
			active-config0 {
				temperature = <125000>;
				hysteresis = <1000>;
				type = "passive";
			};
		};
	};
};
