Lines Matching full:widget
42 #define DAPM_UPDATE_STAT(widget, val) widget->dapm->card->dapm_stats.val++; argument
59 const struct snd_soc_dapm_widget *widget);
63 const struct snd_soc_dapm_widget *widget);
238 * @w: The widget for which to invalidate the cached number of input paths
240 * Resets the cached number of inputs for the specified widget and all widgets
241 * that can be reached via outcoming paths from the widget.
243 * This function must be called if the number of output paths for a widget might
244 * have changed. E.g. if the source state of a widget changes or a path is added
245 * or activated with the widget as the sink.
255 * @w: The widget for which to invalidate the cached number of output paths
257 * Resets the cached number of outputs for the specified widget and all widgets
258 * that can be reached via incoming paths from the widget.
260 * This function must be called if the number of output paths for a widget might
261 * have changed. E.g. if the sink state of a widget changes or a path is added
262 * or activated with the widget as the source.
321 /* create a new dapm widget */
347 struct snd_soc_dapm_widget *widget; member
352 static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget, in dapm_kcontrol_data_alloc() argument
367 switch (widget->id) { in dapm_kcontrol_data_alloc()
374 dev_warn(widget->dapm->dev, in dapm_kcontrol_data_alloc()
402 data->widget = in dapm_kcontrol_data_alloc()
403 snd_soc_dapm_new_control_unlocked(widget->dapm, in dapm_kcontrol_data_alloc()
406 if (IS_ERR(data->widget)) { in dapm_kcontrol_data_alloc()
407 ret = PTR_ERR(data->widget); in dapm_kcontrol_data_alloc()
437 data->widget = snd_soc_dapm_new_control_unlocked( in dapm_kcontrol_data_alloc()
438 widget->dapm, &template); in dapm_kcontrol_data_alloc()
440 if (IS_ERR(data->widget)) { in dapm_kcontrol_data_alloc()
441 ret = PTR_ERR(data->widget); in dapm_kcontrol_data_alloc()
445 snd_soc_dapm_add_path(widget->dapm, data->widget, in dapm_kcontrol_data_alloc()
446 widget, NULL, NULL); in dapm_kcontrol_data_alloc()
448 data->value = soc_dapm_read(widget->dapm, e->reg) & in dapm_kcontrol_data_alloc()
483 struct snd_soc_dapm_widget *widget) in dapm_kcontrol_add_widget() argument
500 new_wlist->widgets[n - 1] = widget; in dapm_kcontrol_add_widget()
520 if (!data->widget) in dapm_kcontrol_is_powered()
523 return data->widget->power; in dapm_kcontrol_is_powered()
554 if (data->widget) { in dapm_kcontrol_set_value()
559 data->widget->on_val = value & data->widget->mask; in dapm_kcontrol_set_value()
563 data->widget->on_val = value >> data->widget->shift; in dapm_kcontrol_set_value()
566 data->widget->on_val = value; in dapm_kcontrol_set_value()
577 * snd_soc_dapm_kcontrol_widget() - Returns the widget associated to a
657 struct snd_soc_dapm_widget *w = wcache->widget; in dapm_wcache_lookup()
680 wcache->widget = w; in dapm_wcache_update()
749 /* connect mux widget to its interconnecting audio paths */
831 /* connect mixer widget to its interconnecting audio paths */
875 * create it. Either way, add the widget into the control's widget list
933 * front of the widget name. in dapm_create_or_share_kcontrol()
968 "ASoC: failed to add widget %s dapm kcontrol %s: %d\n", in dapm_create_or_share_kcontrol()
1008 if (data->widget) in dapm_new_mixer()
1009 snd_soc_dapm_add_path(data->widget->dapm, in dapm_new_mixer()
1010 data->widget, in dapm_new_mixer()
1099 "ASoC: failed to add widget %s dapm kcontrol %s: %d\n", in dapm_new_dai_link()
1114 static int snd_soc_dapm_suspend_check(struct snd_soc_dapm_widget *widget) in snd_soc_dapm_suspend_check() argument
1116 int level = snd_power_get_state(widget->dapm->card->snd_card); in snd_soc_dapm_suspend_check()
1121 if (widget->ignore_suspend) in snd_soc_dapm_suspend_check()
1122 dev_dbg(widget->dapm->dev, "ASoC: %s ignoring suspend\n", in snd_soc_dapm_suspend_check()
1123 widget->name); in snd_soc_dapm_suspend_check()
1124 return widget->ignore_suspend; in snd_soc_dapm_suspend_check()
1160 * widget and all widgets that can be reached via incoming or outcoming paths
1161 * from the widget.
1163 static void invalidate_paths_ep(struct snd_soc_dapm_widget *widget, in invalidate_paths_ep() argument
1169 widget->endpoints[dir] = -1; in invalidate_paths_ep()
1171 snd_soc_dapm_widget_for_each_path(widget, rdir, path) { in invalidate_paths_ep()
1193 static __always_inline int is_connected_ep(struct snd_soc_dapm_widget *widget, in is_connected_ep() argument
1205 if (widget->endpoints[dir] >= 0) in is_connected_ep()
1206 return widget->endpoints[dir]; in is_connected_ep()
1208 DAPM_UPDATE_STAT(widget, path_checks); in is_connected_ep()
1210 /* do we need to add this widget to the list ? */ in is_connected_ep()
1212 list_add_tail(&widget->work_list, list); in is_connected_ep()
1214 if (custom_stop_condition && custom_stop_condition(widget, dir)) { in is_connected_ep()
1219 if ((widget->is_ep & SND_SOC_DAPM_DIR_TO_EP(dir)) && widget->connected) { in is_connected_ep()
1220 widget->endpoints[dir] = snd_soc_dapm_suspend_check(widget); in is_connected_ep()
1221 return widget->endpoints[dir]; in is_connected_ep()
1224 snd_soc_dapm_widget_for_each_path(widget, rdir, path) { in is_connected_ep()
1225 DAPM_UPDATE_STAT(widget, neighbour_checks); in is_connected_ep()
1233 trace_snd_soc_dapm_path(widget, dir, path); in is_connected_ep()
1242 widget->endpoints[dir] = con; in is_connected_ep()
1249 * output widget. Returns number of complete paths.
1252 * This function takes the dapm widget currently being examined and the walk
1254 * in the graph onwards should not be added to the widget list.
1256 static int is_connected_output_ep(struct snd_soc_dapm_widget *widget, in is_connected_output_ep() argument
1261 return is_connected_ep(widget, list, SND_SOC_DAPM_DIR_OUT, in is_connected_output_ep()
1267 * input widget. Returns number of complete paths.
1270 * This function takes the dapm widget currently being examined and the walk
1274 static int is_connected_input_ep(struct snd_soc_dapm_widget *widget, in is_connected_input_ep() argument
1279 return is_connected_ep(widget, list, SND_SOC_DAPM_DIR_IN, in is_connected_input_ep()
1288 * @custom_stop_condition: (optional) a function meant to stop the widget graph
1296 * This function takes the dapm widget currently being examined and the walk
1346 * Handler for regulator supply widget.
1380 * Handler for pinctrl widget.
1405 * Handler for clock supply widget.
1441 /* Generic check to see if a widget should be powered. */
1516 /* Insert a widget in order into a DAPM power sequence. */
1618 /* Any widget will do, they should all be updating the in dapm_seq_run_coalesced()
1725 "ASoC: Failed to apply widget power: %d\n", ret); in dapm_seq_run()
1949 * Scan each dapm widget for complete audio path.
2273 /* test and update the power status of a mux widget */
2283 /* find dapm widget path assoc with kcontrol */ in soc_dapm_mux_update_power()
2319 /* test and update the power status of a mixer or switch widget */
2329 /* find dapm widget path assoc with kcontrol */ in soc_dapm_mixer_update_power()
2449 /* show dapm widget status in sys fs */
2494 * remove source and sink paths associated to this widget. in snd_soc_dapm_free_widget()
2511 dapm->path_sink_cache.widget = NULL; in snd_soc_dapm_reset_cache()
2512 dapm->path_source_cache.widget = NULL; in snd_soc_dapm_reset_cache()
2722 * dapm_update_widget_flags() - Re-compute widget sink and source flags
2723 * @w: The widget for which to update the flags
2728 * This function must be called whenever a path is added or removed to a widget.
2838 "Connecting non-supply widget to supply widget is not supported (%s -> %s)\n", in snd_soc_dapm_add_path()
2961 * find src and dest widgets over all widgets but favor a widget from in snd_soc_dapm_add_route()
2975 "ASoC: sink widget %s overwritten\n", in snd_soc_dapm_add_route()
2989 "ASoC: source widget %s overwritten\n", in snd_soc_dapm_add_route()
2993 /* use widget from another DAPM context if not found from this */ in snd_soc_dapm_add_route()
3000 dev_err(dapm->dev, "ASoC: no source widget found for %s\n", in snd_soc_dapm_add_route()
3005 dev_err(dapm->dev, "ASoC: no sink widget found for %s\n", in snd_soc_dapm_add_route()
3095 * the widget receiving the audio signal, whilst the source is the sender
3291 dapm_mark_dirty(w, "new widget"); in snd_soc_dapm_new_widgets()
3619 const struct snd_soc_dapm_widget *widget) in snd_soc_dapm_new_control_unlocked() argument
3626 if ((w = dapm_cnew_widget(widget)) == NULL) in snd_soc_dapm_new_control_unlocked()
3668 w->name = kasprintf(GFP_KERNEL, "%s %s", prefix, widget->name); in snd_soc_dapm_new_control_unlocked()
3670 w->name = kstrdup_const(widget->name, GFP_KERNEL); in snd_soc_dapm_new_control_unlocked()
3773 * @widget: widget template
3777 * Returns a widget pointer on success or an error pointer on failure
3781 const struct snd_soc_dapm_widget *widget) in snd_soc_dapm_new_control() argument
3786 w = snd_soc_dapm_new_control_unlocked(dapm, widget); in snd_soc_dapm_new_control()
3796 * @widget: widget array
3804 const struct snd_soc_dapm_widget *widget, in snd_soc_dapm_new_controls() argument
3813 w = snd_soc_dapm_new_control_unlocked(dapm, widget); in snd_soc_dapm_new_controls()
3818 widget++; in snd_soc_dapm_new_controls()
4047 /* Can't change the config when widget is already powered */ in snd_soc_dapm_dai_link_put()
4127 dev_err(card->dev, "ASoC: Failed to create control for %s widget\n", in snd_soc_dapm_alloc_kcontrol()
4137 dev_err(card->dev, "ASoC: Failed to create control for %s widget\n", in snd_soc_dapm_alloc_kcontrol()
4199 dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name); in snd_soc_dapm_new_dai()
4204 dev_err(rtd->dev, "ASoC: Failed to create %s widget: %d\n", in snd_soc_dapm_new_dai()
4238 dev_dbg(dai->dev, "ASoC: adding %s widget\n", in snd_soc_dapm_new_dai_widgets()
4254 dev_dbg(dai->dev, "ASoC: adding %s widget\n", in snd_soc_dapm_new_dai_widgets()
4274 /* For each DAI widget... */ in snd_soc_dapm_link_dai_widgets()
4286 dev_dbg(card->dev, "dai widget %s has no DAI\n", in snd_soc_dapm_link_dai_widgets()
4483 * necessary widget power changes.
4531 * do any widget power switching.
4549 * do any widget power switching.
4577 * do any widget power switching.
4616 * do any widget power switching.
4643 * do any widget power switching.
4660 * do any widget power switching.
4691 * do any widget power switching.
4712 * do any widget power switching.