diff options
author | Vijendar Mukunda <Vijendar.Mukunda@amd.com> | 2022-12-21 18:28:50 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-12-26 00:33:37 +0100 |
commit | 9d327a4443bffe8d48acc6a31c0198f251fca08b (patch) | |
tree | 22588abcbee5c7edd5b42c3259b676257e658256 /sound/soc/amd/ps | |
parent | ASoC: amd: ps: refactor platform device creation logic (diff) | |
download | linux-9d327a4443bffe8d48acc6a31c0198f251fca08b.tar.xz linux-9d327a4443bffe8d48acc6a31c0198f251fca08b.zip |
ASoC: amd: ps: update dev index value in irq handler
Instead of using hard coded index value for platform device index,
retrieve the device index based on platform devices created.
In PDM config case, ACP PCI driver retrieves dev index from
pdm_dev_index variable.
This will avoid overhead when multiple endpoint combinations
support is added later.
platform device index will vary based on audio endpoint
configuration.
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20221221172855.1618766-3-Vijendar.Mukunda@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd/ps')
-rw-r--r-- | sound/soc/amd/ps/pci-ps.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c index 8ae7bdfb0e8c..4553e81da164 100644 --- a/sound/soc/amd/ps/pci-ps.c +++ b/sound/soc/amd/ps/pci-ps.c @@ -116,6 +116,7 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id) struct acp63_dev_data *adata; struct pdm_dev_data *ps_pdm_data; u32 val; + u16 pdev_index; adata = dev_id; if (!adata) @@ -123,7 +124,8 @@ static irqreturn_t acp63_irq_handler(int irq, void *dev_id) val = acp63_readl(adata->acp63_base + ACP_EXTERNAL_INTR_STAT); if (val & BIT(PDM_DMA_STAT)) { - ps_pdm_data = dev_get_drvdata(&adata->pdev[0]->dev); + pdev_index = adata->pdm_dev_index; + ps_pdm_data = dev_get_drvdata(&adata->pdev[pdev_index]->dev); acp63_writel(BIT(PDM_DMA_STAT), adata->acp63_base + ACP_EXTERNAL_INTR_STAT); if (ps_pdm_data->capture_stream) snd_pcm_period_elapsed(ps_pdm_data->capture_stream); |