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

Commit 21ba0775 authored by Vatsal Bucha's avatar Vatsal Bucha Committed by Gerrit - the friendly Code Review server
Browse files

soc: swr-mstr: Fix headset not detetcted issue on devnum 0 detached



Headset is not detected if devnum 0 gets detached at bootup.
This is because on detach being called hw will mask interrupt
at slave side but will not unmask it afterwards.
Also device 0 is used only for discovery purpose and
interrupt shouldnt be masked if it detaches.

Change-Id: I78d47243ef67ea5ee1fe3badaec94e596bc8faf3
Signed-off-by: default avatarVatsal Bucha <vbucha@codeaurora.org>
parent 4e8e51f8
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -1636,9 +1636,12 @@ static void swrm_enable_slave_irq(struct swr_mstr_ctrl *swrm)
	}
	dev_dbg(swrm->dev, "%s: slave status: 0x%x\n", __func__, status);
	for (i = 0; i < (swrm->master.num_dev + 1); i++) {
		if (status & SWRM_MCP_SLV_STATUS_MASK)
		if (status & SWRM_MCP_SLV_STATUS_MASK) {
			swrm_cmd_fifo_wr_cmd(swrm, 0xFF, i, 0x0,
					SWRS_SCP_INT_STATUS_CLEAR_1);
			swrm_cmd_fifo_wr_cmd(swrm, 0x4, i, 0x0,
					SWRS_SCP_INT_STATUS_MASK_1);
		}
		status >>= 2;
	}
}
@@ -1943,6 +1946,17 @@ static irqreturn_t swr_mstr_interrupt_v2(int irq, void *dev)
				dev_dbg(swrm->dev,
					"%s: device %d got detached\n",
					__func__, devnum);
				if (devnum == 0) {
					/*
					 * enable host irq if device 0 detached
					 * as hw will mask host_irq at slave
					 * but will not unmask it afterwards.
					 */
					swrm_cmd_fifo_wr_cmd(swrm, 0xFF, devnum, 0x0,
						SWRS_SCP_INT_STATUS_CLEAR_1);
					swrm_cmd_fifo_wr_cmd(swrm, 0x4, devnum, 0x0,
						SWRS_SCP_INT_STATUS_MASK_1);
				}
				break;
			case SWR_ATTACHED_OK:
				dev_dbg(swrm->dev,