Lines Matching +full:dual +full:- +full:direction
1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
3 // This file is provided under a dual BSD/GPLv2 license. When using or
21 #include "sof-priv.h"
22 #include "sof-audio.h"
28 /* Mailbox-based Generic IPC implementation */
33 if (!sps || !sdev->stream_box.size) { in sof_ipc_msg_data()
34 snd_sof_dsp_mailbox_read(sdev, sdev->dsp_box.offset, p, sz); in sof_ipc_msg_data()
38 if (sps->substream) { in sof_ipc_msg_data()
39 struct sof_stream *stream = sps->substream->runtime->private_data; in sof_ipc_msg_data()
43 return -ESTRPIPE; in sof_ipc_msg_data()
45 posn_offset = stream->posn_offset; in sof_ipc_msg_data()
48 struct sof_compr_stream *sstream = sps->cstream->runtime->private_data; in sof_ipc_msg_data()
51 return -ESTRPIPE; in sof_ipc_msg_data()
53 posn_offset = sstream->posn_offset; in sof_ipc_msg_data()
68 if (posn_offset > sdev->stream_box.size || in sof_set_stream_data_offset()
70 return -EINVAL; in sof_set_stream_data_offset()
72 posn_offset += sdev->stream_box.offset; in sof_set_stream_data_offset()
74 if (sps->substream) { in sof_set_stream_data_offset()
75 struct sof_stream *stream = sps->substream->runtime->private_data; in sof_set_stream_data_offset()
77 stream->posn_offset = posn_offset; in sof_set_stream_data_offset()
78 dev_dbg(sdev->dev, "pcm: stream dir %d, posn mailbox offset is %zu", in sof_set_stream_data_offset()
79 sps->substream->stream, posn_offset); in sof_set_stream_data_offset()
80 } else if (sps->cstream) { in sof_set_stream_data_offset()
81 struct sof_compr_stream *sstream = sps->cstream->runtime->private_data; in sof_set_stream_data_offset()
83 sstream->posn_offset = posn_offset; in sof_set_stream_data_offset()
84 dev_dbg(sdev->dev, "compr: stream dir %d, posn mailbox offset is %zu", in sof_set_stream_data_offset()
85 sps->cstream->direction, posn_offset); in sof_set_stream_data_offset()
87 dev_err(sdev->dev, "No stream opened"); in sof_set_stream_data_offset()
88 return -EINVAL; in sof_set_stream_data_offset()
101 return -ENOMEM; in sof_stream_pcm_open()
104 substream->runtime->private_data = stream; in sof_stream_pcm_open()
107 snd_pcm_hw_constraint_step(substream->runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4); in sof_stream_pcm_open()
110 snd_pcm_hw_constraint_integer(substream->runtime, in sof_stream_pcm_open()
120 struct sof_stream *stream = substream->runtime->private_data; in sof_stream_pcm_close()
122 substream->runtime->private_data = NULL; in sof_stream_pcm_close()