diff --git a/soc/swr-mstr-ctrl.c b/soc/swr-mstr-ctrl.c index 0bcfabb7b5ec..297822e84737 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 @@ -1944,10 +1944,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); } @@ -2193,7 +2195,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: @@ -2827,6 +2831,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 0f95572fa12c..8cb613aaf125 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 @@ -198,6 +198,7 @@ struct swr_mstr_ctrl { u64 phy_dev[SWRM_NUM_AUTO_ENUM_SLAVES + 1]; bool use_custom_phy_addr; u32 is_always_on; + bool clk_stop_wakeup; #ifdef CONFIG_DEBUG_FS struct dentry *debugfs_swrm_dent; struct dentry *debugfs_peek;