Unverified Commit edca0623 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown
Browse files

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: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarRander Wang <rander.wang@intel.com>
Reviewed-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220304205733.62233-3-pierre-louis.bossart@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent d66c57c5
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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);