Lines Matching refs:swidget

71 static int sof_widget_kcontrol_setup(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)  in sof_widget_kcontrol_setup()  argument
78 if (scontrol->comp_id == swidget->comp_id) { in sof_widget_kcontrol_setup()
82 swidget->widget->name); in sof_widget_kcontrol_setup()
99 int sof_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget) in sof_widget_free() argument
106 .id = swidget->comp_id, in sof_widget_free()
111 if (!swidget->private) in sof_widget_free()
115 if (--swidget->use_count) in sof_widget_free()
118 switch (swidget->id) { in sof_widget_free()
133 dev_err(sdev->dev, "error: failed to free widget %s\n", swidget->widget->name); in sof_widget_free()
134 swidget->use_count++; in sof_widget_free()
139 sof_reset_route_setup_status(sdev, swidget); in sof_widget_free()
140 swidget->complete = 0; in sof_widget_free()
141 dev_dbg(sdev->dev, "widget %s freed\n", swidget->widget->name); in sof_widget_free()
147 int sof_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget) in sof_widget_setup() argument
158 if (!swidget->private) in sof_widget_setup()
162 if (++swidget->use_count > 1) in sof_widget_setup()
165 ret = sof_pipeline_core_enable(sdev, swidget); in sof_widget_setup()
168 ret, swidget->widget->name); in sof_widget_setup()
172 switch (swidget->id) { in sof_widget_setup()
180 dai = swidget->private; in sof_widget_setup()
185 memcpy((u8 *)comp + sizeof(struct sof_ipc_comp_dai), &swidget->comp_ext, in sof_widget_setup()
186 sizeof(swidget->comp_ext)); in sof_widget_setup()
192 swidget->widget->name); in sof_widget_setup()
199 swidget->widget->name); in sof_widget_setup()
200 sof_widget_free(sdev, swidget); in sof_widget_setup()
205 pipeline = swidget->private; in sof_widget_setup()
209 hdr = swidget->private; in sof_widget_setup()
210 ret = sof_ipc_tx_message(sdev->ipc, hdr->cmd, swidget->private, hdr->size, in sof_widget_setup()
215 dev_err(sdev->dev, "error: failed to load widget %s\n", swidget->widget->name); in sof_widget_setup()
220 ret = sof_widget_kcontrol_setup(sdev, swidget); in sof_widget_setup()
223 swidget->widget->name); in sof_widget_setup()
224 sof_widget_free(sdev, swidget); in sof_widget_setup()
228 dev_dbg(sdev->dev, "widget %s setup complete\n", swidget->widget->name); in sof_widget_setup()
233 swidget->use_count--; in sof_widget_setup()
371 struct snd_sof_widget *swidget = widget->dobj.private; in sof_widget_list_setup() local
374 if (!swidget) in sof_widget_list_setup()
384 pipe_widget = swidget->pipe_widget; in sof_widget_list_setup()
387 swidget->widget->name); in sof_widget_list_setup()
397 ret = sof_widget_setup(sdev, swidget); in sof_widget_list_setup()
414 struct snd_sof_widget *swidget = widget->dobj.private; in sof_widget_list_setup() local
417 if (!swidget) in sof_widget_list_setup()
420 pipe_widget = swidget->pipe_widget; in sof_widget_list_setup()
423 swidget->widget->name); in sof_widget_list_setup()
443 struct snd_sof_widget *swidget = widget->dobj.private; in sof_widget_list_setup() local
445 if (!swidget) in sof_widget_list_setup()
451 sof_widget_free(sdev, swidget); in sof_widget_list_setup()
452 sof_widget_free(sdev, swidget->pipe_widget); in sof_widget_list_setup()
474 struct snd_sof_widget *swidget = widget->dobj.private; in sof_widget_list_free() local
476 if (!swidget) in sof_widget_list_free()
483 ret = sof_widget_free(sdev, swidget); in sof_widget_list_free()
487 ret = sof_widget_free(sdev, swidget->pipe_widget); in sof_widget_list_free()
583 const struct snd_sof_widget *swidget; in snd_sof_pipeline_find() local
585 list_for_each_entry(swidget, &sdev->widget_list, list) in snd_sof_pipeline_find()
586 if (swidget->id == snd_soc_dapm_scheduler) { in snd_sof_pipeline_find()
588 swidget->private; in snd_sof_pipeline_find()
598 struct snd_sof_widget *swidget; in sof_set_up_pipelines() local
603 list_for_each_entry_reverse(swidget, &sdev->widget_list, list) { in sof_set_up_pipelines()
605 if (!verify && swidget->dynamic_pipeline_widget) in sof_set_up_pipelines()
609 if (WIDGET_IS_DAI(swidget->id)) { in sof_set_up_pipelines()
610 struct snd_sof_dai *dai = swidget->private; in sof_set_up_pipelines()
627 ret = sof_widget_setup(sdev, swidget); in sof_set_up_pipelines()
648 list_for_each_entry(swidget, &sdev->widget_list, list) { in sof_set_up_pipelines()
649 switch (swidget->id) { in sof_set_up_pipelines()
652 if (!verify && swidget->dynamic_pipeline_widget) in sof_set_up_pipelines()
655 swidget->complete = in sof_set_up_pipelines()
656 snd_sof_complete_pipeline(sdev, swidget); in sof_set_up_pipelines()
672 struct snd_sof_widget *swidget; in sof_tear_down_pipelines() local
682 list_for_each_entry_reverse(swidget, &sdev->widget_list, list) { in sof_tear_down_pipelines()
684 swidget->use_count = 0; in sof_tear_down_pipelines()
688 ret = sof_widget_free(sdev, swidget); in sof_tear_down_pipelines()
766 struct snd_sof_widget *swidget; in snd_sof_find_swidget() local
768 list_for_each_entry(swidget, &sdev->widget_list, list) { in snd_sof_find_swidget()
769 if (strcmp(name, swidget->widget->name) == 0) in snd_sof_find_swidget()
770 return swidget; in snd_sof_find_swidget()
782 struct snd_sof_widget *swidget; in snd_sof_find_swidget_sname() local
790 list_for_each_entry(swidget, &sdev->widget_list, list) { in snd_sof_find_swidget_sname()
791 if (!strcmp(pcm_name, swidget->widget->sname) && in snd_sof_find_swidget_sname()
792 swidget->id == type) in snd_sof_find_swidget_sname()
793 return swidget; in snd_sof_find_swidget_sname()