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

Commit a618cac7 authored by Anish Kumar's avatar Anish Kumar Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: wcd9320: Handle the port disconnect correctly



In irq handler driver goes through all irq register
status bits to check which interrupt has really
triggered. However hardware sets the irq status register
regardless of mask value set by the driver. This has
an un-intended consequence of stack dump in driver as
it was not expecting this interrupt.

Change-Id: I2fd9ff93134f76cd924fdab7024e712f95caf7fe
Signed-off-by: default avatarAnish Kumar <kanish@codeaurora.org>
parent 5f953ec6
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -6181,6 +6181,22 @@ static irqreturn_t taiko_slimbus_irq(int irq, void *data)
		port_id = (tx ? j - 16 : j);
		val = wcd9xxx_interface_reg_read(codec->control_data,
					TAIKO_SLIM_PGD_PORT_INT_RX_SOURCE0 + j);
		if (val) {
			if (!tx)
				reg = TAIKO_SLIM_PGD_PORT_INT_EN0 +
					(port_id / 8);
			else
				reg = TAIKO_SLIM_PGD_PORT_INT_TX_EN0 +
					(port_id / 8);
			int_val = wcd9xxx_interface_reg_read(
				codec->control_data, reg);
			/*
			 * Ignore interrupts for ports for which the
			 * interrupts are not specifically enabled.
			 */
			if (!(int_val & (1 << (port_id % 8))))
				continue;
		}
		if (val & TAIKO_SLIM_IRQ_OVERFLOW)
			pr_err_ratelimited(
			   "%s: overflow error on %s port %d, value %x\n",