Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62dc88e1 authored by Ram Chandrasekar's avatar Ram Chandrasekar Committed by Manaf Meethalavalappu Pallikunhi
Browse files

driver: thermal: bcl_pmic5: Use mitigation level interrupts



BCL peripheral will eventually translate all the vbat and ibat
interrupts to mitigation level interrupts. And the interrupts also will
correspond to the levels instead of the vbat or ibat events. So use
these interrupts in HLOS to trigger mitigation.

The vbat and ibat will still be registered as sensors, but they wont
support interrupts and hence no mitigation for violation. Instead the
levels will be registered as interrupts and the mitigation config should
be based on this mitigation level sensor.

Update devicetree changes to reflect above mentioned design change for
all targets those are using bcl_pmic5 driver.

Change-Id: I45d2f63f2390eb4c59c45ca7d8aff758e1f88ce0
Signed-off-by: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
Signed-off-by: default avatarManaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
parent c2624262
Loading
Loading
Loading
Loading
+53 −9
Original line number Diff line number Diff line
@@ -449,15 +449,11 @@
			compatible = "qcom,bcl-v5";
			reg = <0x1d00 0x100>;
			interrupts = <0x0 0x1d 0x0 IRQ_TYPE_NONE>,
					<0x0 0x1d 0x1 IRQ_TYPE_NONE>,
					<0x0 0x1d 0x0 IRQ_TYPE_NONE>,
					<0x0 0x1d 0x1 IRQ_TYPE_NONE>,
					<0x0 0x1d 0x2 IRQ_TYPE_NONE>;
			interrupt-names = "bcl-ibat-lvl0",
						"bcl-ibat-lvl1",
						"bcl-vbat-lvl0",
						"bcl-vbat-lvl1",
						"bcl-vbat-lvl2";
			interrupt-names = "bcl-lvl0",
						"bcl-lvl1",
						"bcl-lvl2";
			#thermal-sensor-cells = <1>;
		};

@@ -564,7 +560,7 @@
	};

	pm6150-ibat-lvl0 {
		polling-delay-passive = <100>;
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm6150_bcl 0>;
@@ -596,7 +592,7 @@
	};

	pm6150-vbat-lvl0 {
		polling-delay-passive = <100>;
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "low_limits_cap";
		thermal-sensors = <&pm6150_bcl 2>;
@@ -646,6 +642,54 @@
		};
	};

	pm6150-bcl-lvl0 {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm6150_bcl 5>;
		wake-capable-sensor;

		trips {
			bcl_lvl0: bcl-lvl0 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};
	};

	pm6150-bcl-lvl1 {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm6150_bcl 6>;
		wake-capable-sensor;

		trips {
			bcl_lvl1: bcl-lvl1 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};
	};

	pm6150-bcl-lvl2 {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm6150_bcl 7>;
		wake-capable-sensor;

		trips {
			bcl_lvl2: bcl-lvl2 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};
	};

	soc {
		polling-delay-passive = <100>;
		polling-delay = <0>;
+51 −3
Original line number Diff line number Diff line
@@ -46,9 +46,9 @@
			interrupts = <0x4 0x3d 0x0 IRQ_TYPE_NONE>,
					<0x4 0x3d 0x1 IRQ_TYPE_NONE>,
					<0x4 0x3d 0x2 IRQ_TYPE_NONE>;
			interrupt-names = "bcl-vbat-lvl0",
						"bcl-vbat-lvl1",
						"bcl-vbat-lvl2";
			interrupt-names = "bcl-lvl0",
						"bcl-lvl1",
						"bcl-lvl2";
			#thermal-sensor-cells = <1>;
		};

@@ -511,4 +511,52 @@
			};
		};
	};

	pm6150l-bcl-lvl0 {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm6150l_bcl 5>;
		wake-capable-sensor;

		trips {
			l_bcl_lvl0: l-bcl-lvl0 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};
	};

	pm6150l-bcl-lvl1 {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm6150l_bcl 6>;
		wake-capable-sensor;

		trips {
			l_bcl_lvl1: l-bcl-lvl1 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};
	};

	pm6150l-bcl-lvl2 {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm6150l_bcl 7>;
		wake-capable-sensor;

		trips {
			l_bcl_lvl2: l-bcl-lvl2 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};
	};
};
+56 −12
Original line number Diff line number Diff line
@@ -365,15 +365,11 @@
			compatible = "qcom,bcl-v5";
			reg = <0x1d00 0x100>;
			interrupts = <0x2 0x1d 0x0 IRQ_TYPE_NONE>,
					<0x2 0x1d 0x1 IRQ_TYPE_NONE>,
					<0x2 0x1d 0x0 IRQ_TYPE_NONE>,
					<0x2 0x1d 0x1 IRQ_TYPE_NONE>,
					<0x2 0x1d 0x2 IRQ_TYPE_NONE>;
			interrupt-names = "bcl-ibat-lvl0",
						"bcl-ibat-lvl1",
						"bcl-vbat-lvl0",
						"bcl-vbat-lvl1",
						"bcl-vbat-lvl2";
			interrupt-names = "bcl-lvl0",
						"bcl-lvl1",
						"bcl-lvl2";
			#thermal-sensor-cells = <1>;
		};

@@ -603,7 +599,7 @@
	};

	pm8150b-ibat-lvl0 {
		polling-delay-passive = <100>;
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm8150b_bcl 0>;
@@ -619,7 +615,7 @@
	};

	pm8150b-ibat-lvl1 {
		polling-delay-passive = <100>;
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm8150b_bcl 1>;
@@ -635,7 +631,7 @@
	};

	pm8150b-vbat-lvl0 {
		polling-delay-passive = <100>;
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "low_limits_cap";
		thermal-sensors = <&pm8150b_bcl 2>;
@@ -652,7 +648,7 @@
	};

	pm8150b-vbat-lvl1 {
		polling-delay-passive = <100>;
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "low_limits_cap";
		thermal-sensors = <&pm8150b_bcl 3>;
@@ -669,7 +665,7 @@
	};

	pm8150b-vbat-lvl2 {
		polling-delay-passive = <100>;
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "low_limits_cap";
		thermal-sensors = <&pm8150b_bcl 4>;
@@ -685,6 +681,54 @@
		};
	};

	pm8150b-bcl-lvl0 {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm8150b_bcl 5>;
		wake-capable-sensor;

		trips {
			b_bcl_lvl0: b-bcl-lvl0 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};
	};

	pm8150b-bcl-lvl1 {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm8150b_bcl 6>;
		wake-capable-sensor;

		trips {
			b_bcl_lvl1: b-bcl-lvl1 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};
	};

	pm8150b-bcl-lvl2 {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm8150b_bcl 7>;
		wake-capable-sensor;

		trips {
			b_bcl_lvl2: b-bcl-lvl2 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};
	};

	soc {
		polling-delay-passive = <100>;
		polling-delay = <0>;
+54 −6
Original line number Diff line number Diff line
@@ -117,9 +117,9 @@
			interrupts = <0x4 0x3d 0x0 IRQ_TYPE_NONE>,
					<0x4 0x3d 0x1 IRQ_TYPE_NONE>,
					<0x4 0x3d 0x2 IRQ_TYPE_NONE>;
			interrupt-names = "bcl-vbat-lvl0",
						"bcl-vbat-lvl1",
						"bcl-vbat-lvl2";
			interrupt-names = "bcl-lvl0",
						"bcl-lvl1",
						"bcl-lvl2";
			#thermal-sensor-cells = <1>;
		};

@@ -464,7 +464,7 @@
	};

	pm8150l-vph-lvl0 {
		polling-delay-passive = <100>;
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "low_limits_cap";
		thermal-sensors = <&pm8150l_bcl 2>;
@@ -481,7 +481,7 @@
	};

	pm8150l-vph-lvl1 {
		polling-delay-passive = <100>;
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "low_limits_cap";
		thermal-sensors = <&pm8150l_bcl 3>;
@@ -498,7 +498,7 @@
	};

	pm8150l-vph-lvl2 {
		polling-delay-passive = <100>;
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "low_limits_cap";
		thermal-sensors = <&pm8150l_bcl 4>;
@@ -513,4 +513,52 @@
			};
		};
	};

	pm8150l-bcl-lvl0 {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm8150l_bcl 5>;
		wake-capable-sensor;

		trips {
			l_bcl_lvl0: l-bcl-lvl0 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};
	};

	pm8150l-bcl-lvl1 {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm8150l_bcl 6>;
		wake-capable-sensor;

		trips {
			l_bcl_lvl1: l-bcl-lvl1 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};
	};

	pm8150l-bcl-lvl2 {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&pm8150l_bcl 7>;
		wake-capable-sensor;

		trips {
			l_bcl_lvl2: l-bcl-lvl2 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};
	};
};
+56 −12
Original line number Diff line number Diff line
@@ -394,15 +394,11 @@
			compatible = "qcom,bcl-v5";
			reg = <0x3d00 0x100>;
			interrupts = <0x2 0x3d 0x0 IRQ_TYPE_NONE>,
					<0x2 0x3d 0x1 IRQ_TYPE_NONE>,
					<0x2 0x3d 0x0 IRQ_TYPE_NONE>,
					<0x2 0x3d 0x1 IRQ_TYPE_NONE>,
					<0x2 0x3d 0x2 IRQ_TYPE_NONE>;
			interrupt-names = "bcl-ibat-lvl0",
						"bcl-ibat-lvl1",
						"bcl-vbat-lvl0",
						"bcl-vbat-lvl1",
						"bcl-vbat-lvl2";
			interrupt-names = "bcl-lvl0",
						"bcl-lvl1",
						"bcl-lvl2";
			qcom,ibat-use-qg-adc-5a;
			#thermal-sensor-cells = <1>;
		};
@@ -636,7 +632,7 @@
	};

	pmi632-ibat-lvl0 {
		polling-delay-passive = <100>;
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&bcl_sensor 0>;
@@ -652,7 +648,7 @@
	};

	pmi632-ibat-lvl1 {
		polling-delay-passive = <100>;
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&bcl_sensor 1>;
@@ -668,7 +664,7 @@
	};

	pmi632-vbat-lvl0 {
		polling-delay-passive = <100>;
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "low_limits_cap";
		thermal-sensors = <&bcl_sensor 2>;
@@ -685,7 +681,7 @@
	};

	pmi632-vbat-lvl1 {
		polling-delay-passive = <100>;
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "low_limits_cap";
		thermal-sensors = <&bcl_sensor 3>;
@@ -702,7 +698,7 @@
	};

	pmi632-vbat-lvl2 {
		polling-delay-passive = <100>;
		polling-delay-passive = <0>;
		polling-delay = <0>;
		thermal-governor = "low_limits_cap";
		thermal-sensors = <&bcl_sensor 4>;
@@ -718,6 +714,54 @@
		};
	};

	pmi632-bcl-lvl0 {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&bcl_sensor 5>;
		wake-capable-sensor;

		trips {
			bcl_lvl0: bcl-lvl0 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};
	};

	pmi632-bcl-lvl1 {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&bcl_sensor 6>;
		wake-capable-sensor;

		trips {
			bcl_lvl1: bcl-lvl1 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};
	};

	pmi632-bcl-lvl2 {
		polling-delay-passive = <100>;
		polling-delay = <0>;
		thermal-governor = "step_wise";
		thermal-sensors = <&bcl_sensor 7>;
		wake-capable-sensor;

		trips {
			bcl_lvl2: bcl-lvl2 {
				temperature = <1>;
				hysteresis = <1>;
				type = "passive";
			};
		};
	};

	soc {
		polling-delay-passive = <100>;
		polling-delay = <0>;
Loading