Skip to content

Commit 3a0aa29

Browse files
ujfalusiplbossart
authored andcommitted
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. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
1 parent 7064fb9 commit 3a0aa29

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

sound/soc/sof/amd/acp-pcm.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919
int acp_pcm_hw_params(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream,
2020
struct snd_pcm_hw_params *params, struct sof_ipc_stream_params *ipc_params)
2121
{
22-
struct acp_dsp_stream *stream = substream->runtime->private_data;
22+
struct snd_pcm_runtime *runtime = substream->runtime;
23+
struct acp_dsp_stream *stream = runtime->private_data;
2324
unsigned int buf_offset, index;
2425
u32 size;
2526
int ret;
2627

27-
size = ipc_params->buffer.size;
28-
stream->num_pages = ipc_params->buffer.pages;
28+
size = runtime->dma_bytes;
29+
stream->num_pages = PFN_UP(runtime->dma_bytes);
2930
stream->dmab = substream->runtime->dma_buffer_p;
3031

3132
ret = acp_dsp_stream_config(sdev, stream);

0 commit comments

Comments
 (0)