summaryrefslogtreecommitdiffstats
path: root/sound/soc/amd/acp/amd.h
diff options
context:
space:
mode:
authorAjit Kumar Pandey <AjitKumar.Pandey@amd.com>2022-08-10 15:29:12 +0200
committerMark Brown <broonie@kernel.org>2022-08-15 02:19:41 +0200
commit7929985cfe36c336e3d0753e9f23ac4c7758ea7e (patch)
tree148a1ed8388cce92efe085229cccedbcca01e853 /sound/soc/amd/acp/amd.h
parentMerge remote-tracking branch 'asoc/for-5.20' into asoc-6.0 (diff)
downloadlinux-7929985cfe36c336e3d0753e9f23ac4c7758ea7e.tar.xz
linux-7929985cfe36c336e3d0753e9f23ac4c7758ea7e.zip
ASoC: amd: acp: Initialize list to store acp_stream during pcm_open
We are currently allocating acp_stream during pcm_open and saving it in static array corresponds to array index calculated based on cpu dai->driver id. This approach will fail if we have single dai linked to multiple pcm device as we will have same dai->driver id or array index for multiple pcm open. Initialize new linked list stream_list to store opened pcm stream info dynamically. Signed-off-by: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com> Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com> Reviewed-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://lore.kernel.org/r/20220810132913.1181247-2-venkataprasad.potturu@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd/acp/amd.h')
-rw-r--r--sound/soc/amd/acp/amd.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h
index af9603724a68..e49269f42a4e 100644
--- a/sound/soc/amd/acp/amd.h
+++ b/sound/soc/amd/acp/amd.h
@@ -91,6 +91,7 @@ struct acp_chip_info {
};
struct acp_stream {
+ struct list_head list;
struct snd_pcm_substream *substream;
int irq_bit;
int dai_id;
@@ -123,7 +124,8 @@ struct acp_dev_data {
struct snd_soc_dai_driver *dai_driver;
int num_dai;
- struct acp_stream *stream[ACP_MAX_STREAM];
+ struct list_head stream_list;
+ spinlock_t acp_lock;
struct snd_soc_acpi_mach *machines;
struct platform_device *mach_dev;