Skip to content

Commit 29e3aa0

Browse files
ujfalusibroonie
authored andcommitted
ASoC: SOF: Intel: hda-ipc: Add hda_set_stream_data_offset()
Add implementation for the generic set_stream_data_offset() callback to be used by HDA platforms. Convert the hda_ipc_pcm_params() to a wrapper for the new function. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://lore.kernel.org/r/20220310042720.976809-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 9a0a809 commit 29e3aa0

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

sound/soc/sof/intel/hda-ipc.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,12 @@ int hda_ipc_msg_data(struct snd_sof_dev *sdev,
267267
return 0;
268268
}
269269

270-
int hda_ipc_pcm_params(struct snd_sof_dev *sdev,
271-
struct snd_pcm_substream *substream,
272-
const struct sof_ipc_pcm_params_reply *reply)
270+
int hda_set_stream_data_offset(struct snd_sof_dev *sdev,
271+
struct snd_pcm_substream *substream,
272+
size_t posn_offset)
273273
{
274274
struct hdac_stream *hstream = substream->runtime->private_data;
275275
struct sof_intel_hda_stream *hda_stream;
276-
/* validate offset */
277-
size_t posn_offset = reply->posn_offset;
278276

279277
hda_stream = container_of(hstream, struct sof_intel_hda_stream,
280278
hext_stream.hstream);
@@ -291,3 +289,10 @@ int hda_ipc_pcm_params(struct snd_sof_dev *sdev,
291289

292290
return 0;
293291
}
292+
293+
int hda_ipc_pcm_params(struct snd_sof_dev *sdev,
294+
struct snd_pcm_substream *substream,
295+
const struct sof_ipc_pcm_params_reply *reply)
296+
{
297+
return hda_set_stream_data_offset(sdev, substream, reply->posn_offset);
298+
}

sound/soc/sof/intel/hda.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,9 @@ int hda_ipc_msg_data(struct snd_sof_dev *sdev,
569569
int hda_ipc_pcm_params(struct snd_sof_dev *sdev,
570570
struct snd_pcm_substream *substream,
571571
const struct sof_ipc_pcm_params_reply *reply);
572+
int hda_set_stream_data_offset(struct snd_sof_dev *sdev,
573+
struct snd_pcm_substream *substream,
574+
size_t posn_offset);
572575

573576
/*
574577
* DSP IPC Operations.

0 commit comments

Comments
 (0)