summary refs log tree commit diff
path: root/sound/soc/sof/ops.h
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>2022-03-09 20:27:14 -0800
committerMark Brown <broonie@kernel.org>2022-03-11 13:41:03 +0000
commit757ce8103c9e5b83cf18a669fe38484b0be3cfaf (patch)
treed475298ed25b318b0303529da9c37853b8943797 /sound/soc/sof/ops.h
parentd1b1146fc708eff661c2becb9bf78374adde6db7 (diff)
downloadlinux-757ce8103c9e5b83cf18a669fe38484b0be3cfaf.tar.gz
ASoC: SOF: Introduce optional callback to configure stream data offset
Each running audio stream's data have distinct start offset within the
stream mailbox area from/to where the host can read/write.

Instead of using the struct sof_ipc_pcm_params_reply to configure this
offset, add an optional callback which is IPC agnostic.

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-5-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/ops.h')
-rw-r--r--sound/soc/sof/ops.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/sound/soc/sof/ops.h b/sound/soc/sof/ops.h
index 98fa91f5927d..f21d4a7ac261 100644
--- a/sound/soc/sof/ops.h
+++ b/sound/soc/sof/ops.h
@@ -476,6 +476,19 @@ snd_sof_ipc_pcm_params(struct snd_sof_dev *sdev,
 	return sof_ops(sdev)->ipc_pcm_params(sdev, substream, reply);
 }
 
+/* host side configuration of the stream's data offset in stream mailbox area */
+static inline int
+snd_sof_set_stream_data_offset(struct snd_sof_dev *sdev,
+			       struct snd_pcm_substream *substream,
+			       size_t posn_offset)
+{
+	if (sof_ops(sdev) && sof_ops(sdev)->set_stream_data_offset)
+		return sof_ops(sdev)->set_stream_data_offset(sdev, substream,
+							     posn_offset);
+
+	return 0;
+}
+
 /* host stream pointer */
 static inline snd_pcm_uframes_t
 snd_sof_pcm_platform_pointer(struct snd_sof_dev *sdev,