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
20 #include "../sof-audio.h"
25 #define SDnFMT_MULT(x) (((x) - 1) << 11)
26 #define SDnFMT_DIV(x) (((x) - 1) << 8)
58 dev_warn(sdev->dev, "can't find div rate %d using 48kHz\n", in hda_dsp_get_mult_div()
78 dev_warn(sdev->dev, "can't find %d bits using 16bit\n", in hda_dsp_get_bits()
89 struct hdac_stream *hstream = substream->runtime->private_data; in hda_dsp_pcm_hw_params()
91 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_pcm_hw_params()
93 struct sof_ipc_fw_version *v = &sdev->fw_ready.version; in hda_dsp_pcm_hw_params()
101 hstream->substream = substream; in hda_dsp_pcm_hw_params()
103 dmab = substream->runtime->dma_buffer_p; in hda_dsp_pcm_hw_params()
105 hstream->format_val = rate | bits | (params_channels(params) - 1); in hda_dsp_pcm_hw_params()
106 hstream->bufsize = size; in hda_dsp_pcm_hw_params()
107 hstream->period_bytes = params_period_bytes(params); in hda_dsp_pcm_hw_params()
108 hstream->no_period_wakeup = in hda_dsp_pcm_hw_params()
109 (params->info & SNDRV_PCM_INFO_NO_PERIOD_WAKEUP) && in hda_dsp_pcm_hw_params()
110 (params->flags & SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP); in hda_dsp_pcm_hw_params()
114 dev_err(sdev->dev, "error: hdac prepare failed: %x\n", ret); in hda_dsp_pcm_hw_params()
122 if (hda && hda->no_ipc_position) { in hda_dsp_pcm_hw_params()
127 if (v->abi_version < SOF_ABI_VER(3, 10, 0)) in hda_dsp_pcm_hw_params()
128 ipc_params->host_period_bytes = 0; in hda_dsp_pcm_hw_params()
130 ipc_params->no_stream_position = 1; in hda_dsp_pcm_hw_params()
133 ipc_params->stream_tag = hstream->stream_tag; in hda_dsp_pcm_hw_params()
141 struct hdac_stream *hstream = substream->runtime->private_data; in hda_dsp_pcm_trigger()
151 struct snd_soc_component *scomp = sdev->component; in hda_dsp_pcm_pointer()
152 struct hdac_stream *hstream = substream->runtime->private_data; in hda_dsp_pcm_pointer()
153 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_pcm_pointer()
159 dev_warn_ratelimited(sdev->dev, "warn: can't find PCM with DAI ID %d\n", in hda_dsp_pcm_pointer()
160 rtd->dai_link->id); in hda_dsp_pcm_pointer()
164 if (hda && !hda->no_ipc_position) { in hda_dsp_pcm_pointer()
166 pos = spcm->stream[substream->stream].posn.host_posn; in hda_dsp_pcm_pointer()
178 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in hda_dsp_pcm_pointer()
182 hstream->index)); in hda_dsp_pcm_pointer()
200 hstream->index)); in hda_dsp_pcm_pointer()
204 if (pos >= hstream->bufsize) in hda_dsp_pcm_pointer()
208 pos = bytes_to_frames(substream->runtime, pos); in hda_dsp_pcm_pointer()
210 dev_vdbg(sdev->dev, "PCM: stream %d dir %d position %lu\n", in hda_dsp_pcm_pointer()
211 hstream->index, substream->stream, pos); in hda_dsp_pcm_pointer()
219 int direction = substream->stream; in hda_dsp_pcm_open() local
221 dsp_stream = hda_dsp_stream_get(sdev, direction); in hda_dsp_pcm_open()
224 dev_err(sdev->dev, "error: no stream available\n"); in hda_dsp_pcm_open()
225 return -ENODEV; in hda_dsp_pcm_open()
229 substream->runtime->private_data = &dsp_stream->hstream; in hda_dsp_pcm_open()
236 struct hdac_stream *hstream = substream->runtime->private_data; in hda_dsp_pcm_close()
237 int direction = substream->stream; in hda_dsp_pcm_close() local
240 ret = hda_dsp_stream_put(sdev, direction, hstream->stream_tag); in hda_dsp_pcm_close()
243 dev_dbg(sdev->dev, "stream %s not opened!\n", substream->name); in hda_dsp_pcm_close()
244 return -ENODEV; in hda_dsp_pcm_close()
248 substream->runtime->private_data = NULL; in hda_dsp_pcm_close()