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

Commit 184d0814 authored by Yeleswarapu Nagaradhesh's avatar Yeleswarapu Nagaradhesh
Browse files

ASoC: msm8x16-wcd: modify interrupt handling



In current SW, if multiple interrupts occurs at same time,
all the interrupts are handled in first interrupt context
and each interrupt is handled again in its own context.
Due to which single interrupt is handled twice which is inturn
configuring HW wrongly. Hence donot handle an interrupt in other
interrupt context.

CRs-Fixed: 1072485
Change-Id: I5bf7b69f39d903aa5ebb31d63d181b3f0785684a
Signed-off-by: default avatarYeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
parent 4f11fdea
Loading
Loading
Loading
Loading
+4 −17
Original line number Diff line number Diff line
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015,2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -210,14 +210,9 @@ static int get_irq_bit(int linux_irq)
	return i;
}

static int get_order_irq(int  i)
{
	return order[i];
}

static irqreturn_t wcd9xxx_spmi_irq_handler(int linux_irq, void *data)
{
	int irq, i, j;
	int irq, i;
	unsigned long status[NUM_IRQ_REGS] = {0};

	if (unlikely(wcd9xxx_spmi_lock_sleep() == false)) {
@@ -236,16 +231,8 @@ static irqreturn_t wcd9xxx_spmi_irq_handler(int linux_irq, void *data)
			MSM8X16_WCD_A_DIGITAL_INT_LATCHED_STS);
		status[i] &= ~map.mask[i];
	}
	for (i = 0; i < MAX_NUM_IRQS; i++) {
		j = get_order_irq(i);
		if ((status[BIT_BYTE(j)] & BYTE_BIT_MASK(j)) &&
			((map.handled[BIT_BYTE(j)] &
			BYTE_BIT_MASK(j)) == 0)) {
			map.handler[j](irq, data);
			map.handled[BIT_BYTE(j)] |=
					BYTE_BIT_MASK(j);
		}
	}

	map.handler[irq](irq, data);
	map.handled[BIT_BYTE(irq)] &= ~BYTE_BIT_MASK(irq);
	wcd9xxx_spmi_unlock_sleep();