Unverified Commit 249f186d authored by Daniel Baluta's avatar Daniel Baluta Committed by Mark Brown
Browse files

ASoC: SOF: Prepare set_stream_data_offset for compress API



Make second parameter of set_stream_data_offset generic
in order to be used for both PCM and compress streams.

Current patch doesn't introduce any functional change,
just prepare the code for compress support.

Reviewed-by: default avatarPaul Olaru <paul.olaru@nxp.com>
Reviewed-by: default avatarIuliana Prodan <iuliana.prodan@nxp.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20230117122533.201708-3-daniel.baluta@oss.nxp.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1b905942
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -222,9 +222,10 @@ int acp_sof_ipc_msg_data(struct snd_sof_dev *sdev, struct snd_sof_pcm_stream *sp
EXPORT_SYMBOL_NS(acp_sof_ipc_msg_data, SND_SOC_SOF_AMD_COMMON);

int acp_set_stream_data_offset(struct snd_sof_dev *sdev,
			       struct snd_pcm_substream *substream,
			       struct snd_sof_pcm_stream *sps,
			       size_t posn_offset)
{
	struct snd_pcm_substream *substream = sps->substream;
	struct acp_dsp_stream *stream = substream->runtime->private_data;

	/* check for unaligned offset or overflow */
+1 −1
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ irqreturn_t acp_sof_ipc_irq_thread(int irq, void *context);
int acp_sof_ipc_msg_data(struct snd_sof_dev *sdev, struct snd_sof_pcm_stream *sps,
			 void *p, size_t sz);
int acp_set_stream_data_offset(struct snd_sof_dev *sdev,
			       struct snd_pcm_substream *substream,
			       struct snd_sof_pcm_stream *sps,
			       size_t posn_offset);
int acp_sof_ipc_send_msg(struct snd_sof_dev *sdev,
			 struct snd_sof_ipc_msg *msg);
+2 −1
Original line number Diff line number Diff line
@@ -386,9 +386,10 @@ int hda_ipc_msg_data(struct snd_sof_dev *sdev,
}

int hda_set_stream_data_offset(struct snd_sof_dev *sdev,
			       struct snd_pcm_substream *substream,
			       struct snd_sof_pcm_stream *sps,
			       size_t posn_offset)
{
	struct snd_pcm_substream *substream = sps->substream;
	struct hdac_stream *hstream = substream->runtime->private_data;
	struct sof_intel_hda_stream *hda_stream;

+1 −1
Original line number Diff line number Diff line
@@ -659,7 +659,7 @@ int hda_ipc_msg_data(struct snd_sof_dev *sdev,
		     struct snd_sof_pcm_stream *sps,
		     void *p, size_t sz);
int hda_set_stream_data_offset(struct snd_sof_dev *sdev,
			       struct snd_pcm_substream *substream,
			       struct snd_sof_pcm_stream *sps,
			       size_t posn_offset);

/*
+2 −1
Original line number Diff line number Diff line
@@ -129,7 +129,8 @@ static int sof_ipc3_pcm_hw_params(struct snd_soc_component *component,
		return ret;
	}

	ret = snd_sof_set_stream_data_offset(sdev, substream, ipc_params_reply.posn_offset);
	ret = snd_sof_set_stream_data_offset(sdev, &spcm->stream[substream->stream],
					     ipc_params_reply.posn_offset);
	if (ret < 0) {
		dev_err(component->dev, "%s: invalid stream data offset for PCM %d\n",
			__func__, spcm->pcm.pcm_id);
Loading