diff options
author | Vatsal Bucha <vbucha@codeaurora.org> | 2020-12-30 19:05:37 +0530 |
---|---|---|
committer | Shashi Kant Maurya <smaury@codeaurora.org> | 2021-01-11 11:14:02 +0530 |
commit | 27e8e9bf68f7d2cc23f7d42407a213a03e3faaa5 (patch) | |
tree | c2bd760f8304354a10a4ecf6b9455df4810d1a74 /soc | |
parent | 8b699bc1775f1df3eeed557c6aaf5fa2d647d6f6 (diff) | |
download | msm-extra-27e8e9bf68f7d2cc23f7d42407a213a03e3faaa5.tar.gz |
soc: swr-mstr: Fix headset detect issue during clk stop wakeup
When ext clk stop wakeup and slave_pending_irq come together
then interrupt at swrslave is cleared due to calling
enable_slave_irq. Do not clear interrupts for enable_slave_irq
when its called from clk stop wakeup.
Change-Id: Ia710030ab80306d6750bea7264f0d4c07053d701
Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
Diffstat (limited to 'soc')
-rw-r--r-- | soc/swr-mstr-ctrl.c | 12 | ||||
-rw-r--r-- | soc/swr-mstr-ctrl.h | 3 |
2 files changed, 11 insertions, 4 deletions
diff --git a/soc/swr-mstr-ctrl.c b/soc/swr-mstr-ctrl.c index d594a992..e9dfcf4d 100644 --- a/soc/swr-mstr-ctrl.c +++ b/soc/swr-mstr-ctrl.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. */ #include <linux/irq.h> @@ -1755,10 +1755,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) { - swrm_cmd_fifo_rd_cmd(swrm, &temp, i, 0x0, + if (!swrm->clk_stop_wakeup) { + swrm_cmd_fifo_rd_cmd(swrm, &temp, i, 0x0, SWRS_SCP_INT_STATUS_CLEAR_1, 1); - swrm_cmd_fifo_wr_cmd(swrm, 0xFF, i, 0x0, + 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); } @@ -2170,7 +2172,9 @@ handle_irq: * re-enable Host IRQ and process slave pending * interrupts, if any. */ + swrm->clk_stop_wakeup = true; swrm_enable_slave_irq(swrm); + swrm->clk_stop_wakeup = false; } break; default: @@ -2741,6 +2745,8 @@ static int swrm_probe(struct platform_device *pdev) swrm->dev_up = true; swrm->state = SWR_MSTR_UP; swrm->ipc_wakeup = false; + swrm->enable_slave_irq = false; + swrm->clk_stop_wakeup = false; swrm->ipc_wakeup_triggered = false; swrm->disable_div2_clk_switch = FALSE; init_completion(&swrm->reset); diff --git a/soc/swr-mstr-ctrl.h b/soc/swr-mstr-ctrl.h index ed67f0e4..1b707166 100644 --- a/soc/swr-mstr-ctrl.h +++ b/soc/swr-mstr-ctrl.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. */ #ifndef _SWR_WCD_CTRL_H @@ -186,6 +186,7 @@ struct swr_mstr_ctrl { u32 rd_fifo_depth; u32 wr_fifo_depth; bool enable_slave_irq; + bool clk_stop_wakeup; #ifdef CONFIG_DEBUG_FS struct dentry *debugfs_swrm_dent; struct dentry *debugfs_peek; |