Lines Matching full:widget
43 #define DAPM_UPDATE_STAT(widget, val) widget->dapm->card->dapm_stats.val++; argument
60 const struct snd_soc_dapm_widget *widget);
64 const struct snd_soc_dapm_widget *widget);
239 * @w: The widget for which to invalidate the cached number of input paths
241 * Resets the cached number of inputs for the specified widget and all widgets
242 * that can be reached via outcoming paths from the widget.
244 * This function must be called if the number of output paths for a widget might
245 * have changed. E.g. if the source state of a widget changes or a path is added
246 * or activated with the widget as the sink.
256 * @w: The widget for which to invalidate the cached number of output paths
258 * Resets the cached number of outputs for the specified widget and all widgets
259 * that can be reached via incoming paths from the widget.
261 * This function must be called if the number of output paths for a widget might
262 * have changed. E.g. if the sink state of a widget changes or a path is added
263 * or activated with the widget as the source.
321 /* create a new dapm widget */
352 struct snd_soc_dapm_widget *widget; member
357 static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget, in dapm_kcontrol_data_alloc() argument
372 switch (widget->id) { in dapm_kcontrol_data_alloc()
382 dev_warn(widget->dapm->dev, in dapm_kcontrol_data_alloc()
407 data->widget = in dapm_kcontrol_data_alloc()
408 snd_soc_dapm_new_control_unlocked(widget->dapm, in dapm_kcontrol_data_alloc()
411 if (IS_ERR(data->widget)) { in dapm_kcontrol_data_alloc()
412 ret = PTR_ERR(data->widget); in dapm_kcontrol_data_alloc()
442 data->widget = snd_soc_dapm_new_control_unlocked( in dapm_kcontrol_data_alloc()
443 widget->dapm, &template); in dapm_kcontrol_data_alloc()
445 if (IS_ERR(data->widget)) { in dapm_kcontrol_data_alloc()
446 ret = PTR_ERR(data->widget); in dapm_kcontrol_data_alloc()
450 snd_soc_dapm_add_path(widget->dapm, data->widget, in dapm_kcontrol_data_alloc()
451 widget, NULL, NULL); in dapm_kcontrol_data_alloc()
453 data->value = soc_dapm_read(widget->dapm, e->reg) & in dapm_kcontrol_data_alloc()
488 struct snd_soc_dapm_widget *widget) in dapm_kcontrol_add_widget() argument
506 new_wlist->widgets[n - 1] = widget; in dapm_kcontrol_add_widget()
525 if (!data->widget) in dapm_kcontrol_is_powered()
528 return data->widget->power; in dapm_kcontrol_is_powered()
559 if (data->widget) { in dapm_kcontrol_set_value()
564 data->widget->on_val = value & data->widget->mask; in dapm_kcontrol_set_value()
568 data->widget->on_val = value >> data->widget->shift; in dapm_kcontrol_set_value()
571 data->widget->on_val = value; in dapm_kcontrol_set_value()
582 * snd_soc_dapm_kcontrol_widget() - Returns the widget associated to a
745 /* connect mux widget to its interconnecting audio paths */
828 /* connect mixer widget to its interconnecting audio paths */
872 * create it. Either way, add the widget into the control's widget list
932 * front of the widget name. in dapm_create_or_share_kcontrol()
967 "ASoC: failed to add widget %s dapm kcontrol %s: %d\n", in dapm_create_or_share_kcontrol()
1007 if (data->widget) in dapm_new_mixer()
1008 snd_soc_dapm_add_path(data->widget->dapm, in dapm_new_mixer()
1009 data->widget, in dapm_new_mixer()
1098 "ASoC: failed to add widget %s dapm kcontrol %s: %d\n", in dapm_new_dai_link()
1113 static int snd_soc_dapm_suspend_check(struct snd_soc_dapm_widget *widget) in snd_soc_dapm_suspend_check() argument
1115 int level = snd_power_get_state(widget->dapm->card->snd_card); in snd_soc_dapm_suspend_check()
1120 if (widget->ignore_suspend) in snd_soc_dapm_suspend_check()
1121 dev_dbg(widget->dapm->dev, "ASoC: %s ignoring suspend\n", in snd_soc_dapm_suspend_check()
1122 widget->name); in snd_soc_dapm_suspend_check()
1123 return widget->ignore_suspend; in snd_soc_dapm_suspend_check()
1161 * widget and all widgets that can be reached via incoming or outcoming paths
1162 * from the widget.
1164 static void invalidate_paths_ep(struct snd_soc_dapm_widget *widget, in invalidate_paths_ep() argument
1170 widget->endpoints[dir] = -1; in invalidate_paths_ep()
1172 snd_soc_dapm_widget_for_each_path(widget, rdir, path) { in invalidate_paths_ep()
1194 static __always_inline int is_connected_ep(struct snd_soc_dapm_widget *widget, in is_connected_ep() argument
1206 if (widget->endpoints[dir] >= 0) in is_connected_ep()
1207 return widget->endpoints[dir]; in is_connected_ep()
1209 DAPM_UPDATE_STAT(widget, path_checks); in is_connected_ep()
1211 /* do we need to add this widget to the list ? */ in is_connected_ep()
1213 list_add_tail(&widget->work_list, list); in is_connected_ep()
1215 if (custom_stop_condition && custom_stop_condition(widget, dir)) { in is_connected_ep()
1220 if ((widget->is_ep & SND_SOC_DAPM_DIR_TO_EP(dir)) && widget->connected) { in is_connected_ep()
1221 widget->endpoints[dir] = snd_soc_dapm_suspend_check(widget); in is_connected_ep()
1222 return widget->endpoints[dir]; in is_connected_ep()
1225 snd_soc_dapm_widget_for_each_path(widget, rdir, path) { in is_connected_ep()
1226 DAPM_UPDATE_STAT(widget, neighbour_checks); in is_connected_ep()
1234 trace_snd_soc_dapm_path(widget, dir, path); in is_connected_ep()
1243 widget->endpoints[dir] = con; in is_connected_ep()
1250 * output widget. Returns number of complete paths.
1253 * This function takes the dapm widget currently being examined and the walk
1255 * in the graph onwards should not be added to the widget list.
1257 static int is_connected_output_ep(struct snd_soc_dapm_widget *widget, in is_connected_output_ep() argument
1262 return is_connected_ep(widget, list, SND_SOC_DAPM_DIR_OUT, in is_connected_output_ep()
1268 * input widget. Returns number of complete paths.
1271 * This function takes the dapm widget currently being examined and the walk
1275 static int is_connected_input_ep(struct snd_soc_dapm_widget *widget, in is_connected_input_ep() argument
1280 return is_connected_ep(widget, list, SND_SOC_DAPM_DIR_IN, in is_connected_input_ep()
1289 * @custom_stop_condition: (optional) a function meant to stop the widget graph
1297 * This function takes the dapm widget currently being examined and the walk
1347 * Handler for regulator supply widget.
1381 * Handler for pinctrl widget.
1406 * Handler for clock supply widget.
1442 /* Generic check to see if a widget should be powered. */
1517 /* Insert a widget in order into a DAPM power sequence. */
1621 /* Any widget will do, they should all be updating the in dapm_seq_run_coalesced()
1728 "ASoC: Failed to apply widget power: %d\n", ret); in dapm_seq_run()
1945 * Scan each dapm widget for complete audio path.
2184 ret += scnprintf(buf + ret, PAGE_SIZE - ret, " widget-type %s\n", in dapm_widget_power_read_file()
2333 /* test and update the power status of a mux widget */
2345 /* find dapm widget path assoc with kcontrol */ in soc_dapm_mux_update_power()
2379 /* test and update the power status of a mixer or switch widget */
2390 /* find dapm widget path assoc with kcontrol */ in soc_dapm_mixer_update_power()
2507 /* show dapm widget status in sys fs */
2545 * snd_soc_dapm_free_widget - Free specified widget
2546 * @w: widget to free
2548 * Removes widget from all paths and frees memory occupied by it.
2561 * remove source and sink paths associated to this widget. in snd_soc_dapm_free_widget()
2785 int snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s) in snd_soc_dapm_widget_name_cmp() argument
2787 struct snd_soc_component *component = widget->dapm->component; in snd_soc_dapm_widget_name_cmp()
2788 const char *wname = widget->name; in snd_soc_dapm_widget_name_cmp()
2798 * dapm_update_widget_flags() - Re-compute widget sink and source flags
2799 * @w: The widget for which to update the flags
2804 * This function must be called whenever a path is added or removed to a widget.
2913 "Connecting non-supply widget to supply widget is not supported (%s -> %s)\n", in snd_soc_dapm_add_path()
3035 * find src and dest widgets over all widgets but favor a widget from in snd_soc_dapm_add_route()
3049 "ASoC: sink widget %s overwritten\n", in snd_soc_dapm_add_route()
3063 "ASoC: source widget %s overwritten\n", in snd_soc_dapm_add_route()
3067 /* use widget from another DAPM context if not found from this */ in snd_soc_dapm_add_route()
3165 * the widget receiving the audio signal, whilst the source is the sender
3356 dapm_mark_dirty(w, "new widget"); in snd_soc_dapm_new_widgets()
3677 const struct snd_soc_dapm_widget *widget) in snd_soc_dapm_new_control_unlocked() argument
3683 w = dapm_cnew_widget(widget, soc_dapm_prefix(dapm)); in snd_soc_dapm_new_control_unlocked()
3689 w->regulator = devm_regulator_get(dapm->dev, widget->name); in snd_soc_dapm_new_control_unlocked()
3714 w->clk = devm_clk_get(dapm->dev, widget->name); in snd_soc_dapm_new_control_unlocked()
3820 * @widget: widget template
3824 * Returns a widget pointer on success or an error pointer on failure
3828 const struct snd_soc_dapm_widget *widget) in snd_soc_dapm_new_control() argument
3833 w = snd_soc_dapm_new_control_unlocked(dapm, widget); in snd_soc_dapm_new_control()
3843 * @widget: widget array
3851 const struct snd_soc_dapm_widget *widget, in snd_soc_dapm_new_controls() argument
3859 struct snd_soc_dapm_widget *w = snd_soc_dapm_new_control_unlocked(dapm, widget); in snd_soc_dapm_new_controls()
3864 widget++; in snd_soc_dapm_new_controls()
4096 /* Can't change the config when widget is already powered */ in snd_soc_dapm_dai_link_put()
4176 dev_err(card->dev, "ASoC: Failed to create control for %s widget\n", in snd_soc_dapm_alloc_kcontrol()
4186 dev_err(card->dev, "ASoC: Failed to create control for %s widget\n", in snd_soc_dapm_alloc_kcontrol()
4247 dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name); in snd_soc_dapm_new_dai()
4266 dev_err(rtd->dev, "ASoC: Failed to create %s-%s widget: %d\n", in snd_soc_dapm_new_dai()
4294 dev_dbg(dai->dev, "ASoC: adding %s widget\n", in snd_soc_dapm_new_dai_widgets()
4310 dev_dbg(dai->dev, "ASoC: adding %s widget\n", in snd_soc_dapm_new_dai_widgets()
4331 /* For each DAI widget... */ in snd_soc_dapm_link_dai_widgets()
4343 dev_dbg(card->dev, "dai widget %s has no DAI\n", in snd_soc_dapm_link_dai_widgets()
4533 * necessary widget power changes.
4581 * do any widget power switching.
4599 * do any widget power switching.
4627 * do any widget power switching.
4666 * do any widget power switching.
4693 * do any widget power switching.
4710 * do any widget power switching.
4741 * do any widget power switching.
4762 * do any widget power switching.