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

Commit 4bbf6877 authored by Siddartha Mohanadoss's avatar Siddartha Mohanadoss
Browse files

thermal: tsens: Update interrupt handling



There may be a case where if the temperature lowers
below the set threshold thermal driver may skip setting
thresholds as part of optimization instead of resetting new
thresholds. This may leave the sensor trips disabled. Let
thermal core decide on enabling or disabling the sensor.

Remove masking interrupt within TSENS (Temperature sensor)
driver Upper/Lower interrupt threaded IRQ handling. Instead
let the thermal core handle setting trip thresholds and
activate or mask the sensor interrupt.

Change-Id: Ib205ca92716028b9841c12deb3ac2169278675a1
Signed-off-by: default avatarSiddartha Mohanadoss <smohanad@codeaurora.org>
parent 1529c90d
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -225,6 +225,9 @@ static int tsens2xxx_set_trip_temp(struct tsens_sensor *tm_sensor,
	if (!tmdev)
		return -EINVAL;

	pr_debug("%s:low_temp(mdegC):%d, high_temp(mdegC):%d\n", __func__,
							low_temp, high_temp);

	spin_lock_irqsave(&tmdev->tsens_upp_low_lock, flags);

	if (high_temp != INT_MAX) {
@@ -429,10 +432,6 @@ static irqreturn_t tsens_tm_irq_thread(int irq, void *data)
			int_mask = readl_relaxed(sensor_int_mask_addr);
			int_mask_val = TSENS_TM_UPPER_INT_SET(
					tm->sensor[i].hw_id);
			/* Mask the corresponding interrupt for the sensors */
			writel_relaxed(int_mask | int_mask_val,
				TSENS_TM_UPPER_LOWER_INT_MASK(
					tm->tsens_tm_addr));
			/* Clear the corresponding sensors interrupt */
			writel_relaxed(int_mask_val,
				TSENS_TM_UPPER_LOWER_INT_CLEAR(
@@ -461,10 +460,6 @@ static irqreturn_t tsens_tm_irq_thread(int irq, void *data)
				(1 << tm->sensor[i].hw_id))) {
			int_mask = readl_relaxed(sensor_int_mask_addr);
			int_mask_val = (1 << tm->sensor[i].hw_id);
			/* Mask the corresponding interrupt for the sensors */
			writel_relaxed(int_mask | int_mask_val,
				TSENS_TM_UPPER_LOWER_INT_MASK(
					tm->tsens_tm_addr));
			/* Clear the corresponding sensors interrupt */
			writel_relaxed(int_mask_val,
				TSENS_TM_UPPER_LOWER_INT_CLEAR(