aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Ujfalusi <[email protected]>2022-03-04 14:57:25 -0600
committerMark Brown <[email protected]>2022-03-07 13:12:46 +0000
commitedca0623f6d7928b312780d4e885258ca9e562fe (patch)
tree45cbf1c5d42da8ecdf1c5ff5b5efebe5f6744add
parentd66c57c5ff8a24859fe7506d290d0b705c2576c0 (diff)
ASoC: SOF: amd: acp-pcm: Take buffer information directly from runtime
Instead of using the values from ipc_params, take them directly from substream->runtime. This is in preparation of making the platform hw_params callback to be IPC agnostic. Reviewed-by: Ranjani Sridharan <[email protected]> Reviewed-by: Rander Wang <[email protected]> Reviewed-by: Daniel Baluta <[email protected]> Signed-off-by: Peter Ujfalusi <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
-rw-r--r--sound/soc/sof/amd/acp-pcm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/sof/amd/acp-pcm.c b/sound/soc/sof/amd/acp-pcm.c
index 5b23830cb1f3..b49cc55980ae 100644
--- a/sound/soc/sof/amd/acp-pcm.c
+++ b/sound/soc/sof/amd/acp-pcm.c
@@ -19,13 +19,14 @@
int acp_pcm_hw_params(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct sof_ipc_stream_params *ipc_params)
{
- struct acp_dsp_stream *stream = substream->runtime->private_data;
+ struct snd_pcm_runtime *runtime = substream->runtime;
+ struct acp_dsp_stream *stream = runtime->private_data;
unsigned int buf_offset, index;
u32 size;
int ret;
- size = ipc_params->buffer.size;
- stream->num_pages = ipc_params->buffer.pages;
+ size = runtime->dma_bytes;
+ stream->num_pages = PFN_UP(runtime->dma_bytes);
stream->dmab = substream->runtime->dma_buffer_p;
ret = acp_dsp_stream_config(sdev, stream);