diff options
author | Syed Saba Kareem <Syed.SabaKareem@amd.com> | 2023-06-26 19:25:07 +0530 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-07-09 22:47:35 +0100 |
commit | fc11d3266dc7ed386efe91c20d09780bbded1f03 (patch) | |
tree | 7f6a29e7de6e0d9ea4cc925f80483e9e1622e24e /sound/soc/amd/acp/acp-legacy-common.c | |
parent | 7ad6fb9dd1ca63f9f36e413036f36f075cdaec4a (diff) | |
download | lwn-fc11d3266dc7ed386efe91c20d09780bbded1f03.tar.gz lwn-fc11d3266dc7ed386efe91c20d09780bbded1f03.zip |
ASoC: amd: acp: remove the redundant acp enable/disable interrupts functions
Instead of having individual acp enable/disable interrupts functions for
each platform, implement common place holder to handle the same for all
AMD platforms.
Signed-off-by: Syed Saba Kareem <Syed.SabaKareem@amd.com>
Link: https://lore.kernel.org/r/20230626135515.1252063-4-Syed.SabaKareem@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd/acp/acp-legacy-common.c')
-rw-r--r-- | sound/soc/amd/acp/acp-legacy-common.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c index 4302d8db88a4..45a45d002915 100644 --- a/sound/soc/amd/acp/acp-legacy-common.c +++ b/sound/soc/amd/acp/acp-legacy-common.c @@ -16,6 +16,27 @@ #include <linux/pci.h> #include <linux/export.h> +void acp_enable_interrupts(struct acp_dev_data *adata) +{ + struct acp_resource *rsrc = adata->rsrc; + u32 ext_intr_ctrl; + + writel(0x01, ACP_EXTERNAL_INTR_ENB(adata)); + ext_intr_ctrl = readl(ACP_EXTERNAL_INTR_CNTL(adata, rsrc->irqp_used)); + ext_intr_ctrl |= ACP_ERROR_MASK; + writel(ext_intr_ctrl, ACP_EXTERNAL_INTR_CNTL(adata, rsrc->irqp_used)); +} +EXPORT_SYMBOL_NS_GPL(acp_enable_interrupts, SND_SOC_ACP_COMMON); + +void acp_disable_interrupts(struct acp_dev_data *adata) +{ + struct acp_resource *rsrc = adata->rsrc; + + writel(ACP_EXT_INTR_STAT_CLEAR_MASK, ACP_EXTERNAL_INTR_STAT(adata, rsrc->irqp_used)); + writel(0x00, ACP_EXTERNAL_INTR_ENB(adata)); +} +EXPORT_SYMBOL_NS_GPL(acp_disable_interrupts, SND_SOC_ACP_COMMON); + static int acp_power_on(struct acp_chip_info *chip) { u32 val, acp_pgfsm_stat_reg, acp_pgfsm_ctrl_reg; |