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

Commit 3198b9eb authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: Acknowledge WM8962 interrupts before acting on them



This closes the small race between a status being read in response to an
interrupt and clearing the interrupt, meaning that if the status changes
between those periods we might not get a reassertion of the interrupt.

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
parent 09bddc8e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3409,6 +3409,9 @@ static irqreturn_t wm8962_irq(int irq, void *data)
	active = snd_soc_read(codec, WM8962_INTERRUPT_STATUS_2);
	active &= ~mask;

	/* Acknowledge the interrupts */
	snd_soc_write(codec, WM8962_INTERRUPT_STATUS_2, active);

	if (active & WM8962_FLL_LOCK_EINT) {
		dev_dbg(codec->dev, "FLL locked\n");
		complete(&wm8962->fll_lock);
@@ -3433,9 +3436,6 @@ static irqreturn_t wm8962_irq(int irq, void *data)
				      msecs_to_jiffies(250));
	}

	/* Acknowledge the interrupts */
	snd_soc_write(codec, WM8962_INTERRUPT_STATUS_2, active);

	return IRQ_HANDLED;
}