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

Commit ae54f09e authored by Siddartha Mohanadoss's avatar Siddartha Mohanadoss Committed by Gerrit - the friendly Code Review server
Browse files

thermal: tsens: Fix TSENS Upper/Lower IRQ type



Update TSENS IRQ to level trigger instead of using
edge trigger interrupt.

When a sensors temperature threshold is crossed the
controller asserts a level trigger. This level goes
low when the Upper/Lower status threshold is masked.
However, if another sensor threshold is crossed while we
are in the middle of servicing the previous sensors
threshold crossing in the workqueue the new sensors
threshold crossing will be missed as the interrupt level
remains high. Fix it by registering the interrupt as a
level interrupt, disable the interrupt in the
handler and enable it while we exit from the workqueue.

CRs-Fixed: 768227
Change-Id: I7b3f38afd8acb2903f85dcc23e1bfe70d7d9059a
Signed-off-by: default avatarSiddartha Mohanadoss <smohanad@codeaurora.org>
parent 32de6391
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1064,10 +1064,14 @@ static void tsens_scheduler_fn(struct work_struct *work)
		}
	}
	mb();

	enable_irq(tmdev->tsens_irq);
}

static irqreturn_t tsens_isr(int irq, void *data)
{
	disable_irq_nosync(tmdev->tsens_irq);

	queue_work(tmdev->tsens_wq, &tmdev->tsens_work);

	return IRQ_HANDLED;
@@ -3142,7 +3146,7 @@ static int _tsens_register_thermal(void)
	}

	rc = request_irq(tmdev->tsens_irq, tsens_isr,
		IRQF_TRIGGER_RISING, "tsens_interrupt", tmdev);
		IRQF_TRIGGER_HIGH, "tsens_interrupt", tmdev);
	if (rc < 0) {
		pr_err("%s: request_irq FAIL: %d\n", __func__, rc);
		for (i = 0; i < tmdev->tsens_num_sensor; i++)