Lines Matching defs:widget

18  * Check if a DAI widget is an aggregated DAI. Aggregated DAI's have names ending in numbers
28 isdigit(swidget->widget->name[strlen(swidget->widget->name) - 1]) &&
29 swidget->widget->name[strlen(swidget->widget->name) - 1] != '0');
32 static bool is_virtual_widget(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget *widget,
35 switch (widget->id) {
39 dev_dbg(sdev->dev, "%s: %s is a virtual widget\n", func, widget->name);
46 static void sof_reset_route_setup_status(struct snd_sof_dev *sdev, struct snd_sof_widget *widget)
52 if (sroute->src_widget == widget || sroute->sink_widget == widget) {
77 /* reset route setup status for all routes that contain this widget */
80 /* free DAI config and continue to free widget even if it fails */
90 dev_err(sdev->dev, "failed to free config for widget %s\n",
91 swidget->widget->name);
113 i, swidget->widget->name);
122 * free the scheduler widget (same as pipe_widget) associated with the current swidget.
133 dev_dbg(sdev->dev, "widget %s freed\n", swidget->widget->name);
159 /* widget already set up */
164 * The scheduler widget for a pipeline is not part of the connected DAPM
165 * widget list and it needs to be set up before the widgets in the pipeline
166 * are set up. The use_count for the scheduler widget is incremented for every
167 * widget in a given pipeline to ensure that it is freed only after the last
168 * widget in the pipeline is freed. Skip setting up scheduler widget for static pipelines.
172 dev_err(sdev->dev, "No pipeline set for %s\n", swidget->widget->name);
188 i, swidget->widget->name);
194 /* setup widget in the DSP */
216 /* restore kcontrols for widget */
223 dev_dbg(sdev->dev, "widget %s setup complete\n", swidget->widget->name);
228 /* widget use_count and core_put handled by sof_widget_free() */
268 if (is_virtual_widget(sdev, src_widget->widget, __func__) ||
269 is_virtual_widget(sdev, sink_widget->widget, __func__))
272 /* skip route if source/sink widget is not set up */
332 struct snd_soc_dapm_widget *widget;
345 for_each_dapm_widgets(list, i, widget) {
346 if (!widget->dobj.private)
349 snd_soc_dapm_widget_for_each_sink_path(widget, p) {
354 ret = sof_set_up_same_dir_widget_routes(sdev, widget,
362 for_each_dapm_widgets(list, i, widget) {
363 if (!widget->dobj.private)
366 snd_soc_dapm_widget_for_each_source_path(widget, p) {
372 widget);
381 * The above loop handles connections between widgets that belong to the DAPM widget list.
392 src_widget_in_dapm_list = widget_in_list(list, sroute->src_widget->widget);
393 sink_widget_in_dapm_list = widget_in_list(list, sroute->sink_widget->widget);
410 src_widget = sroute->src_widget->widget->dobj.private;
411 sink_widget = sroute->sink_widget->widget->dobj.private;
424 ret = sof_route_setup(sdev, sroute->src_widget->widget,
425 sroute->sink_widget->widget);
435 sof_unprepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget *widget,
439 struct snd_sof_widget *swidget = widget->dobj.private;
443 if (is_virtual_widget(sdev, widget, __func__))
457 widget_ops = tplg_ops ? tplg_ops->widget : NULL;
458 if (widget_ops && widget_ops[widget->id].ipc_unprepare)
459 /* unprepare the source widget */
460 widget_ops[widget->id].ipc_unprepare(swidget);
466 snd_soc_dapm_widget_for_each_sink_path(widget, p) {
479 sof_prepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget *widget,
486 struct snd_sof_widget *swidget = widget->dobj.private;
491 if (is_virtual_widget(sdev, widget, __func__))
497 widget_ops = tplg_ops ? tplg_ops->widget : NULL;
506 if (!widget_ops[widget->id].ipc_prepare || is_aggregated_dai(swidget))
509 /* prepare the source widget */
510 ret = widget_ops[widget->id].ipc_prepare(swidget, fe_params, platform_params,
513 dev_err(sdev->dev, "failed to prepare widget %s\n", widget->name);
521 snd_soc_dapm_widget_for_each_sink_path(widget, p) {
532 /* unprepare the source widget */
533 if (widget_ops[widget->id].ipc_unprepare &&
535 widget_ops[widget->id].ipc_unprepare(swidget);
547 * free all widgets in the sink path starting from the source widget
550 static int sof_free_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget *widget,
554 struct snd_sof_widget *swidget = widget->dobj.private;
559 if (is_virtual_widget(sdev, widget, __func__))
573 err = sof_widget_free(sdev, widget->dobj.private);
578 snd_soc_dapm_widget_for_each_sink_path(widget, p) {
596 * set up all widgets in the sink path starting from the source widget
600 static int sof_set_up_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget *widget,
605 struct snd_sof_widget *swidget = widget->dobj.private;
610 if (is_virtual_widget(sdev, widget, __func__))
632 /* a widget which is not part of a pipeline has nothing to trigger */
637 * Add the widget's pipe_widget to the list of pipelines to be triggered if not
654 snd_soc_dapm_widget_for_each_sink_path(widget, p) {
681 struct snd_soc_dapm_widget *widget;
689 for_each_dapm_widgets(list, i, widget) {
690 /* starting widget for playback is of AIF type */
691 if (dir == SNDRV_PCM_STREAM_PLAYBACK && widget->id != snd_soc_dapm_aif_in)
694 /* starting widget for capture is DAI type */
695 if (dir == SNDRV_PCM_STREAM_CAPTURE && widget->id != snd_soc_dapm_dai_out &&
696 widget->id != snd_soc_dapm_output)
701 ret = sof_set_up_widgets_in_path(sdev, widget, dir, spcm);
705 ret = sof_free_widgets_in_path(sdev, widget, dir, spcm);
715 * widget is modified by the source widget in the path. Use a local
721 ret = sof_prepare_widgets_in_path(sdev, widget, fe_params, platform_params,
726 sof_unprepare_widgets_in_path(sdev, widget, list, dir);
729 dev_err(sdev->dev, "Invalid widget op %d\n", op);
748 * instance ID and pick the widget configuration based on the runtime PCM params.
758 /* unprepare the widget */
772 struct snd_soc_dapm_widget *widget;
779 /* Set up is used to send the IPC to the DSP to create the widget */
797 for_each_dapm_widgets(list, i, widget) {
798 struct snd_sof_widget *swidget = widget->dobj.private;
808 swidget->widget->name);
815 dev_err(sdev->dev, "error: no pipeline widget found for %s\n",
816 swidget->widget->name);
855 /* send IPC to free widget in the DSP */
966 if (strcmp(name, swidget->widget->name) == 0)
973 /* find widget by stream name and direction */
988 if (!strcmp(pcm_name, swidget->widget->sname) &&