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

&soc {
	tsens0: thermal-sensor@c263000 {
		compatible = "qcom,tsens-v2";
		reg = <0x0c263000 0x1ff>, /* TM */
			<0x0c222000 0x1ff>; /* SROT */
		#qcom,sensors = <16>;
		interrupts = <GIC_SPI 499 IRQ_TYPE_LEVEL_HIGH>,
			     <GIC_SPI 501 IRQ_TYPE_LEVEL_HIGH>;
		interrupt-names = "uplow","critical";
		#thermal-sensor-cells = <1>;
	};

	virtual_sensor: virtual-sensor {
		compatible = "qcom,vs-sensor";
		#thermal-sensor-cells = <1>;

		cpu_max: cpu-max {
			qcom,sensors = <&cpuss_0 &cpuss_1 &cpuss_2 &cpuss_3>;
			qcom,logic = <1>;
		};

		modem_max: modem-max {
			qcom,sensors = <&modem_q6 &modem_offline_fec &modem_offline_phy_0 &modem_offline_phy_1 &modem_offline>;
			qcom,logic = <1>;
		};
	};

    aop_pmic_sensor: aop-pmic-sensor@c3f03d8 {
        compatible = "qcom,aop-pmic-sensor";
		reg = <0x0c3f03d8 0x28>;
		mboxes = <&qmp_aop 0>;
		#thermal-sensor-cells = <1>;

		mss-temp {
			qcom,pmic-id = <1>;
			qcom,type = <0>;
		};

		mx-temp {
			qcom,pmic-id = <2>;
			qcom,type = <0>;
		};

		cx-temp {
			qcom,pmic-id = <3>;
			qcom,type = <0>;
		};

		mss-volt {
			qcom,pmic-id = <1>;
			qcom,type = <1>;
		};

		mx-volt {
			qcom,pmic-id = <2>;
			qcom,type = <1>;
		};

		cx-volt {
			qcom,pmic-id = <3>;
			qcom,type = <1>;
		};
    };
};

&thermal_zones {
	aoss-0 {
		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";
			};
		};
	};

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	ctile {
		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";
			};
		};
	};

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

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

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

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

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

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

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

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

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

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

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

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