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

Commit 98a4afd6 authored by Arjun Singh's avatar Arjun Singh Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: bgcom: disable/enable interrupt on device suspend/resume



BG interrupts serviced only if device is in resume state. BG
interrupt is disabled in suspend and enabled on device resume.

Change-Id: Ifd69c19c4f96351663ac9844d1f71514d8402ec4
Signed-off-by: default avatarArjun Singh <arsingh@codeaurora.org>
parent 389c184e
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -923,8 +923,12 @@ EXPORT_SYMBOL(bgcom_close);
static irqreturn_t bg_irq_tasklet_hndlr(int irq, void *device)
{
	struct bg_spi_priv *bg_spi = device;

	/* check if call-back exists */
	if (list_empty(&cb_head)) {
	if (!atomic_read(&bg_is_spi_active)) {
		pr_debug("Interrupt received in suspend state\n");
		return IRQ_HANDLED;
	} else if (list_empty(&cb_head)) {
		pr_debug("No callback registered\n");
		return IRQ_HANDLED;
	} else if (spi_state == BGCOM_SPI_BUSY) {
@@ -1056,6 +1060,7 @@ static int bgcom_pm_suspend(struct device *dev)
	if (ret == 0) {
		bg_spi->bg_state = BGCOM_STATE_SUSPEND;
		atomic_set(&bg_is_spi_active, 0);
		disable_irq(bg_irq);
	}
	pr_info("suspended with : %d\n", ret);
	return ret;
@@ -1072,7 +1077,8 @@ static int bgcom_pm_resume(struct device *dev)
	atomic_set(&bg_is_spi_active, 1);
	ret = bgcom_resume(&clnt_handle);
	if (ret == 0)
		pr_info("Bgcom resumed\n");
		enable_irq(bg_irq);
	pr_info("Bgcom resumed with : %d\n", ret);
	return ret;
}