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
11 #include "sof-audio.h"
25 list_for_each_entry(spcm, &sdev->pcm_list, list) { in snd_sof_dsp_only_d0i3_compatible_stream_active()
27 substream = spcm->stream[dir].substream; in snd_sof_dsp_only_d0i3_compatible_stream_active()
28 if (!substream || !substream->runtime) in snd_sof_dsp_only_d0i3_compatible_stream_active()
32 * substream->runtime being not NULL indicates in snd_sof_dsp_only_d0i3_compatible_stream_active()
36 if (!spcm->stream[dir].d0i3_compatible) in snd_sof_dsp_only_d0i3_compatible_stream_active()
51 list_for_each_entry(spcm, &sdev->pcm_list, list) { in snd_sof_stream_suspend_ignored()
52 if (spcm->stream[SNDRV_PCM_STREAM_PLAYBACK].suspend_ignored || in snd_sof_stream_suspend_ignored()
53 spcm->stream[SNDRV_PCM_STREAM_CAPTURE].suspend_ignored) in snd_sof_stream_suspend_ignored()
69 * SOF requires hw_params to be set-up internally upon resume. in sof_set_hw_params_upon_resume()
73 list_for_each_entry(spcm, &sdev->pcm_list, list) { in sof_set_hw_params_upon_resume()
79 if (spcm->stream[dir].suspend_ignored) in sof_set_hw_params_upon_resume()
82 substream = spcm->stream[dir].substream; in sof_set_hw_params_upon_resume()
83 if (!substream || !substream->runtime) in sof_set_hw_params_upon_resume()
86 state = substream->runtime->status->state; in sof_set_hw_params_upon_resume()
88 spcm->prepared[dir] = false; in sof_set_hw_params_upon_resume()
104 list_for_each_entry(scontrol, &sdev->kcontrol_list, list) { in sof_restore_kcontrols()
106 scontrol->readback_offset = 0; in sof_restore_kcontrols()
109 switch (scontrol->cmd) { in sof_restore_kcontrols()
117 scontrol->cmd, in sof_restore_kcontrols()
125 scontrol->cmd, in sof_restore_kcontrols()
136 scontrol->comp_id); in sof_restore_kcontrols()
150 list_for_each_entry(swidget, &sdev->widget_list, list) in snd_sof_pipeline_find()
151 if (swidget->id == snd_soc_dapm_scheduler) { in snd_sof_pipeline_find()
153 swidget->private; in snd_sof_pipeline_find()
154 if (pipeline->pipeline_id == pipeline_id) in snd_sof_pipeline_find()
174 list_for_each_entry_reverse(swidget, &sdev->widget_list, list) { in sof_restore_pipelines()
178 if (!swidget->private) in sof_restore_pipelines()
190 switch (swidget->id) { in sof_restore_pipelines()
197 return -ENOMEM; in sof_restore_pipelines()
199 dai = swidget->private; in sof_restore_pipelines()
200 memcpy(comp, &dai->comp_dai, in sof_restore_pipelines()
205 &swidget->comp_ext, sizeof(swidget->comp_ext)); in sof_restore_pipelines()
207 ret = sof_ipc_tx_message(sdev->ipc, comp->hdr.cmd, in sof_restore_pipelines()
220 pipeline = swidget->private; in sof_restore_pipelines()
224 hdr = swidget->private; in sof_restore_pipelines()
225 ret = sof_ipc_tx_message(sdev->ipc, hdr->cmd, in sof_restore_pipelines()
226 swidget->private, hdr->size, in sof_restore_pipelines()
233 swidget->widget->id, swidget->comp_id); in sof_restore_pipelines()
240 list_for_each_entry_reverse(sroute, &sdev->route_list, list) { in sof_restore_pipelines()
245 if (!sroute->private) in sof_restore_pipelines()
248 connect = sroute->private; in sof_restore_pipelines()
251 ret = sof_ipc_tx_message(sdev->ipc, in sof_restore_pipelines()
252 connect->hdr.cmd, in sof_restore_pipelines()
258 sroute->route->sink, in sof_restore_pipelines()
259 sroute->route->control ? sroute->route->control in sof_restore_pipelines()
261 sroute->route->source); in sof_restore_pipelines()
268 list_for_each_entry_reverse(dai, &sdev->dai_list, list) { in sof_restore_pipelines()
270 struct sof_ipc_dai_config *config = dai->dai_config; in sof_restore_pipelines()
274 dai->name); in sof_restore_pipelines()
284 if (config->type == SOF_DAI_INTEL_HDA) in sof_restore_pipelines()
285 config->hda.link_dma_ch = DMA_CHAN_INVALID; in sof_restore_pipelines()
287 ret = sof_ipc_tx_message(sdev->ipc, in sof_restore_pipelines()
288 config->hdr.cmd, config, in sof_restore_pipelines()
289 config->hdr.size, in sof_restore_pipelines()
295 dai->name); in sof_restore_pipelines()
302 list_for_each_entry(swidget, &sdev->widget_list, list) { in sof_restore_pipelines()
303 switch (swidget->id) { in sof_restore_pipelines()
305 swidget->complete = in sof_restore_pipelines()
332 list_for_each_entry(spcm, &sdev->pcm_list, list) { in snd_sof_find_spcm_name()
334 if (strcmp(spcm->pcm.dai_name, name) == 0) in snd_sof_find_spcm_name()
338 if (*spcm->pcm.caps[0].name && in snd_sof_find_spcm_name()
339 !strcmp(spcm->pcm.caps[0].name, name)) in snd_sof_find_spcm_name()
343 if (*spcm->pcm.caps[1].name && in snd_sof_find_spcm_name()
344 !strcmp(spcm->pcm.caps[1].name, name)) in snd_sof_find_spcm_name()
353 int *direction) in snd_sof_find_spcm_comp() argument
359 list_for_each_entry(spcm, &sdev->pcm_list, list) { in snd_sof_find_spcm_comp()
361 if (spcm->stream[dir].comp_id == comp_id) { in snd_sof_find_spcm_comp()
362 *direction = dir; in snd_sof_find_spcm_comp()
377 list_for_each_entry(spcm, &sdev->pcm_list, list) { in snd_sof_find_spcm_pcm_id()
378 if (le32_to_cpu(spcm->pcm.pcm_id) == pcm_id) in snd_sof_find_spcm_pcm_id()
391 list_for_each_entry(swidget, &sdev->widget_list, list) { in snd_sof_find_swidget()
392 if (strcmp(name, swidget->widget->name) == 0) in snd_sof_find_swidget()
399 /* find widget by stream name and direction */
413 list_for_each_entry(swidget, &sdev->widget_list, list) { in snd_sof_find_swidget_sname()
414 if (!strcmp(pcm_name, swidget->widget->sname) && in snd_sof_find_swidget_sname()
415 swidget->id == type) in snd_sof_find_swidget_sname()
428 list_for_each_entry(dai, &sdev->dai_list, list) { in snd_sof_find_dai()
429 if (dai->name && (strcmp(name, dai->name) == 0)) in snd_sof_find_dai()
441 struct snd_sof_pdata *sof_pdata = sdev->pdata; in sof_machine_check()
442 const struct sof_dev_desc *desc = sof_pdata->desc; in sof_machine_check()
448 dev_warn(sdev->dev, "Force to use nocodec mode\n"); in sof_machine_check()
454 if (sof_pdata->machine) { in sof_machine_check()
455 snd_sof_set_mach_params(sof_pdata->machine, sdev->dev); in sof_machine_check()
460 dev_err(sdev->dev, "error: no matching ASoC machine driver found - aborting probe\n"); in sof_machine_check()
461 return -ENODEV; in sof_machine_check()
467 dev_warn(sdev->dev, "Using nocodec machine driver\n"); in sof_machine_check()
468 mach = devm_kzalloc(sdev->dev, sizeof(*mach), GFP_KERNEL); in sof_machine_check()
470 return -ENOMEM; in sof_machine_check()
472 mach->drv_name = "sof-nocodec"; in sof_machine_check()
473 sof_pdata->tplg_filename = desc->nocodec_tplg_filename; in sof_machine_check()
475 ret = sof_nocodec_setup(sdev->dev, desc->ops); in sof_machine_check()
479 sof_pdata->machine = mach; in sof_machine_check()
480 snd_sof_set_mach_params(sof_pdata->machine, sdev->dev); in sof_machine_check()
493 drv_name = plat_data->machine->drv_name; in sof_machine_register()
494 mach = plat_data->machine; in sof_machine_register()
495 size = sizeof(*plat_data->machine); in sof_machine_register()
498 plat_data->pdev_mach = in sof_machine_register()
499 platform_device_register_data(sdev->dev, drv_name, in sof_machine_register()
501 if (IS_ERR(plat_data->pdev_mach)) in sof_machine_register()
502 return PTR_ERR(plat_data->pdev_mach); in sof_machine_register()
504 dev_dbg(sdev->dev, "created machine %s\n", in sof_machine_register()
505 dev_name(&plat_data->pdev_mach->dev)); in sof_machine_register()
515 if (!IS_ERR_OR_NULL(plat_data->pdev_mach)) in sof_machine_unregister()
516 platform_device_unregister(plat_data->pdev_mach); in sof_machine_unregister()