]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: SOF: stream-ipc: Add sof_set_stream_data_offset()
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Thu, 10 Mar 2022 04:27:16 +0000 (20:27 -0800)
committerMark Brown <broonie@kernel.org>
Fri, 11 Mar 2022 13:41:05 +0000 (13:41 +0000)
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>
sound/soc/sof/sof-priv.h
sound/soc/sof/stream-ipc.c

index 4b235ce74dfedd1fe9e3e18eb088af471c7b354c..e6fd3910634f4c7d0f04ba7b9915809c66f1af31 100644 (file)
@@ -638,6 +638,9 @@ int sof_ipc_msg_data(struct snd_sof_dev *sdev,
 int sof_ipc_pcm_params(struct snd_sof_dev *sdev,
                       struct snd_pcm_substream *substream,
                       const struct sof_ipc_pcm_params_reply *reply);
+int sof_set_stream_data_offset(struct snd_sof_dev *sdev,
+                              struct snd_pcm_substream *substream,
+                              size_t posn_offset);
 
 int sof_stream_pcm_open(struct snd_sof_dev *sdev,
                        struct snd_pcm_substream *substream);
index 15a55851faeb3cf6919b05f7f67c219b1a11ad37..b7b96b9f52799ac99e01b249990f7eb484673c6a 100644 (file)
@@ -45,12 +45,11 @@ int sof_ipc_msg_data(struct snd_sof_dev *sdev,
 }
 EXPORT_SYMBOL(sof_ipc_msg_data);
 
-int sof_ipc_pcm_params(struct snd_sof_dev *sdev,
-                      struct snd_pcm_substream *substream,
-                      const struct sof_ipc_pcm_params_reply *reply)
+int sof_set_stream_data_offset(struct snd_sof_dev *sdev,
+                              struct snd_pcm_substream *substream,
+                              size_t posn_offset)
 {
        struct sof_stream *stream = substream->runtime->private_data;
-       size_t posn_offset = reply->posn_offset;
 
        /* check if offset is overflow or it is not aligned */
        if (posn_offset > sdev->stream_box.size ||
@@ -64,6 +63,14 @@ int sof_ipc_pcm_params(struct snd_sof_dev *sdev,
 
        return 0;
 }
+EXPORT_SYMBOL(sof_set_stream_data_offset);
+
+int sof_ipc_pcm_params(struct snd_sof_dev *sdev,
+                      struct snd_pcm_substream *substream,
+                      const struct sof_ipc_pcm_params_reply *reply)
+{
+       return sof_set_stream_data_offset(sdev, substream, reply->posn_offset);
+}
 EXPORT_SYMBOL(sof_ipc_pcm_params);
 
 int sof_stream_pcm_open(struct snd_sof_dev *sdev,