Skip to content

Commit 9a0a809

Browse files
ujfalusibroonie
authored andcommitted
ASoC: SOF: stream-ipc: Add sof_set_stream_data_offset()
Add implementation for the generic set_stream_data_offset() callback in core to be used by platforms. Convert the sof_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-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent a6db22a commit 9a0a809

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

sound/soc/sof/sof-priv.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,9 @@ int sof_ipc_msg_data(struct snd_sof_dev *sdev,
638638
int sof_ipc_pcm_params(struct snd_sof_dev *sdev,
639639
struct snd_pcm_substream *substream,
640640
const struct sof_ipc_pcm_params_reply *reply);
641+
int sof_set_stream_data_offset(struct snd_sof_dev *sdev,
642+
struct snd_pcm_substream *substream,
643+
size_t posn_offset);
641644

642645
int sof_stream_pcm_open(struct snd_sof_dev *sdev,
643646
struct snd_pcm_substream *substream);

sound/soc/sof/stream-ipc.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ int sof_ipc_msg_data(struct snd_sof_dev *sdev,
4545
}
4646
EXPORT_SYMBOL(sof_ipc_msg_data);
4747

48-
int sof_ipc_pcm_params(struct snd_sof_dev *sdev,
49-
struct snd_pcm_substream *substream,
50-
const struct sof_ipc_pcm_params_reply *reply)
48+
int sof_set_stream_data_offset(struct snd_sof_dev *sdev,
49+
struct snd_pcm_substream *substream,
50+
size_t posn_offset)
5151
{
5252
struct sof_stream *stream = substream->runtime->private_data;
53-
size_t posn_offset = reply->posn_offset;
5453

5554
/* check if offset is overflow or it is not aligned */
5655
if (posn_offset > sdev->stream_box.size ||
@@ -64,6 +63,14 @@ int sof_ipc_pcm_params(struct snd_sof_dev *sdev,
6463

6564
return 0;
6665
}
66+
EXPORT_SYMBOL(sof_set_stream_data_offset);
67+
68+
int sof_ipc_pcm_params(struct snd_sof_dev *sdev,
69+
struct snd_pcm_substream *substream,
70+
const struct sof_ipc_pcm_params_reply *reply)
71+
{
72+
return sof_set_stream_data_offset(sdev, substream, reply->posn_offset);
73+
}
6774
EXPORT_SYMBOL(sof_ipc_pcm_params);
6875

6976
int sof_stream_pcm_open(struct snd_sof_dev *sdev,

0 commit comments

Comments
 (0)