diff options
author | Rander Wang <rander.wang@intel.com> | 2020-01-10 15:57:27 -0600 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2020-01-14 11:53:12 +0530 |
commit | 5ebb0945419e5845137102c20b99714ea574a3d8 (patch) | |
tree | 13ec210aa9128ec8b841b78c205bc6cb3082581c /drivers/soundwire | |
parent | a2cff9ee4b0200b675ad2dbe00081ff118b6b8a9 (diff) | |
download | linux-5ebb0945419e5845137102c20b99714ea574a3d8.tar.bz2 |
soundwire: cadence_master: clear interrupt status before enabling interrupt
make sure all interrupts status are cleared before enabling interrupt
so that there is no unexpected interrupt triggered.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200110215731.30747-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/soundwire')
-rw-r--r-- | drivers/soundwire/cadence_master.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c index a0ec21b64d42..847b8f5f0a32 100644 --- a/drivers/soundwire/cadence_master.c +++ b/drivers/soundwire/cadence_master.c @@ -856,6 +856,16 @@ int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns, bool state) mask = interrupt_mask; update_masks: + /* clear slave interrupt status before enabling interrupt */ + if (state) { + u32 slave_state; + + slave_state = cdns_readl(cdns, CDNS_MCP_SLAVE_INTSTAT0); + cdns_writel(cdns, CDNS_MCP_SLAVE_INTSTAT0, slave_state); + slave_state = cdns_readl(cdns, CDNS_MCP_SLAVE_INTSTAT1); + cdns_writel(cdns, CDNS_MCP_SLAVE_INTSTAT1, slave_state); + } + cdns_writel(cdns, CDNS_MCP_SLAVE_INTMASK0, slave_intmask0); cdns_writel(cdns, CDNS_MCP_SLAVE_INTMASK1, slave_intmask1); cdns_writel(cdns, CDNS_MCP_INTMASK, mask); |