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.
322 /* create a new dapm widget */
353 struct snd_soc_dapm_widget *widget; member
358 static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget, in dapm_kcontrol_data_alloc() argument
373 switch (widget->id) { in dapm_kcontrol_data_alloc()
383 dev_warn(widget->dapm->dev, in dapm_kcontrol_data_alloc()
408 data->widget = in dapm_kcontrol_data_alloc()
409 snd_soc_dapm_new_control_unlocked(widget->dapm, in dapm_kcontrol_data_alloc()
412 if (IS_ERR(data->widget)) { in dapm_kcontrol_data_alloc()
413 ret = PTR_ERR(data->widget); in dapm_kcontrol_data_alloc()
443 data->widget = snd_soc_dapm_new_control_unlocked( in dapm_kcontrol_data_alloc()
444 widget->dapm, &template); in dapm_kcontrol_data_alloc()
446 if (IS_ERR(data->widget)) { in dapm_kcontrol_data_alloc()
447 ret = PTR_ERR(data->widget); in dapm_kcontrol_data_alloc()
451 snd_soc_dapm_add_path(widget->dapm, data->widget, in dapm_kcontrol_data_alloc()
452 widget, NULL, NULL); in dapm_kcontrol_data_alloc()
454 data->value = soc_dapm_read(widget->dapm, e->reg) & in dapm_kcontrol_data_alloc()
489 struct snd_soc_dapm_widget *widget) in dapm_kcontrol_add_widget() argument
507 new_wlist->widgets[n - 1] = widget; in dapm_kcontrol_add_widget()
526 if (!data->widget) in dapm_kcontrol_is_powered()
529 return data->widget->power; in dapm_kcontrol_is_powered()
560 if (data->widget) { in dapm_kcontrol_set_value()
565 data->widget->on_val = value & data->widget->mask; in dapm_kcontrol_set_value()
569 data->widget->on_val = value >> data->widget->shift; in dapm_kcontrol_set_value()
572 data->widget->on_val = value; in dapm_kcontrol_set_value()
583 * snd_soc_dapm_kcontrol_widget() - Returns the widget associated to a
746 /* connect mux widget to its interconnecting audio paths */
829 /* connect mixer widget to its interconnecting audio paths */
873 * 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()
1162 * widget and all widgets that can be reached via incoming or outcoming paths
1163 * from the widget.
1165 static void invalidate_paths_ep(struct snd_soc_dapm_widget *widget, in invalidate_paths_ep() argument
1171 widget->endpoints[dir] = -1; in invalidate_paths_ep()
1173 snd_soc_dapm_widget_for_each_path(widget, rdir, path) { in invalidate_paths_ep()
1195 static __always_inline int is_connected_ep(struct snd_soc_dapm_widget *widget, in is_connected_ep() argument
1207 if (widget->endpoints[dir] >= 0) in is_connected_ep()
1208 return widget->endpoints[dir]; in is_connected_ep()
1210 DAPM_UPDATE_STAT(widget, path_checks); in is_connected_ep()
1212 /* do we need to add this widget to the list ? */ in is_connected_ep()
1214 list_add_tail(&widget->work_list, list); in is_connected_ep()
1216 if (custom_stop_condition && custom_stop_condition(widget, dir)) { in is_connected_ep()
1221 if ((widget->is_ep & SND_SOC_DAPM_DIR_TO_EP(dir)) && widget->connected) { in is_connected_ep()
1222 widget->endpoints[dir] = snd_soc_dapm_suspend_check(widget); in is_connected_ep()
1223 return widget->endpoints[dir]; in is_connected_ep()
1226 snd_soc_dapm_widget_for_each_path(widget, rdir, path) { in is_connected_ep()
1227 DAPM_UPDATE_STAT(widget, neighbour_checks); in is_connected_ep()
1235 trace_snd_soc_dapm_path(widget, dir, path); in is_connected_ep()
1244 widget->endpoints[dir] = con; in is_connected_ep()
1251 * output widget. Returns number of complete paths.
1254 * This function takes the dapm widget currently being examined and the walk
1256 * in the graph onwards should not be added to the widget list.
1258 static int is_connected_output_ep(struct snd_soc_dapm_widget *widget, in is_connected_output_ep() argument
1263 return is_connected_ep(widget, list, SND_SOC_DAPM_DIR_OUT, in is_connected_output_ep()
1269 * input widget. Returns number of complete paths.
1272 * This function takes the dapm widget currently being examined and the walk
1276 static int is_connected_input_ep(struct snd_soc_dapm_widget *widget, in is_connected_input_ep() argument
1281 return is_connected_ep(widget, list, SND_SOC_DAPM_DIR_IN, in is_connected_input_ep()
1290 * @custom_stop_condition: (optional) a function meant to stop the widget graph
1298 * This function takes the dapm widget currently being examined and the walk
1348 * Handler for regulator supply widget.
1382 * Handler for pinctrl widget.
1407 * Handler for clock supply widget.
1443 /* Generic check to see if a widget should be powered. */
1518 /* Insert a widget in order into a DAPM power sequence. */
1622 /* Any widget will do, they should all be updating the in dapm_seq_run_coalesced()
1729 "ASoC: Failed to apply widget power: %d\n", ret); in dapm_seq_run()
1947 * Scan each dapm widget for complete audio path.
2185 ret += scnprintf(buf + ret, PAGE_SIZE - ret, " widget-type %s\n", in dapm_widget_power_read_file()
2334 /* test and update the power status of a mux widget */
2344 /* find dapm widget path assoc with kcontrol */ in soc_dapm_mux_update_power()
2380 /* 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()
2509 /* show dapm widget status in sys fs */
2547 * snd_soc_dapm_free_widget - Free specified widget
2548 * @w: widget to free
2550 * Removes widget from all paths and frees memory occupied by it.
2563 * remove source and sink paths associated to this widget. in snd_soc_dapm_free_widget()
2788 int snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s) in snd_soc_dapm_widget_name_cmp() argument
2790 struct snd_soc_component *component = widget->dapm->component; in snd_soc_dapm_widget_name_cmp()
2791 const char *wname = widget->name; in snd_soc_dapm_widget_name_cmp()
2801 * dapm_update_widget_flags() - Re-compute widget sink and source flags
2802 * @w: The widget for which to update the flags
2807 * This function must be called whenever a path is added or removed to a widget.
2916 "Connecting non-supply widget to supply widget is not supported (%s -> %s)\n", in snd_soc_dapm_add_path()
3038 * find src and dest widgets over all widgets but favor a widget from in snd_soc_dapm_add_route()
3052 "ASoC: sink widget %s overwritten\n", in snd_soc_dapm_add_route()
3066 "ASoC: source widget %s overwritten\n", in snd_soc_dapm_add_route()
3070 /* use widget from another DAPM context if not found from this */ in snd_soc_dapm_add_route()
3168 * the widget receiving the audio signal, whilst the source is the sender
3359 dapm_mark_dirty(w, "new widget"); in snd_soc_dapm_new_widgets()
3685 const struct snd_soc_dapm_widget *widget) in snd_soc_dapm_new_control_unlocked() argument
3691 w = dapm_cnew_widget(widget, soc_dapm_prefix(dapm)); in snd_soc_dapm_new_control_unlocked()
3697 w->regulator = devm_regulator_get(dapm->dev, widget->name); in snd_soc_dapm_new_control_unlocked()
3722 w->clk = devm_clk_get(dapm->dev, widget->name); in snd_soc_dapm_new_control_unlocked()
3828 * @widget: widget template
3832 * Returns a widget pointer on success or an error pointer on failure
3836 const struct snd_soc_dapm_widget *widget) in snd_soc_dapm_new_control() argument
3841 w = snd_soc_dapm_new_control_unlocked(dapm, widget); in snd_soc_dapm_new_control()
3851 * @widget: widget array
3859 const struct snd_soc_dapm_widget *widget, in snd_soc_dapm_new_controls() argument
3867 struct snd_soc_dapm_widget *w = snd_soc_dapm_new_control_unlocked(dapm, widget); in snd_soc_dapm_new_controls()
3872 widget++; in snd_soc_dapm_new_controls()
4104 /* Can't change the config when widget is already powered */ in snd_soc_dapm_dai_link_put()
4184 dev_err(card->dev, "ASoC: Failed to create control for %s widget\n", in snd_soc_dapm_alloc_kcontrol()
4194 dev_err(card->dev, "ASoC: Failed to create control for %s widget\n", in snd_soc_dapm_alloc_kcontrol()
4255 dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name); in snd_soc_dapm_new_dai()
4274 dev_err(rtd->dev, "ASoC: Failed to create %s-%s widget: %d\n", in snd_soc_dapm_new_dai()
4302 dev_dbg(dai->dev, "ASoC: adding %s widget\n", in snd_soc_dapm_new_dai_widgets()
4318 dev_dbg(dai->dev, "ASoC: adding %s widget\n", in snd_soc_dapm_new_dai_widgets()
4339 /* For each DAI widget... */ in snd_soc_dapm_link_dai_widgets()
4351 dev_dbg(card->dev, "dai widget %s has no DAI\n", in snd_soc_dapm_link_dai_widgets()
4541 * necessary widget power changes.
4589 * do any widget power switching.
4607 * do any widget power switching.
4635 * do any widget power switching.
4674 * do any widget power switching.
4701 * do any widget power switching.
4718 * do any widget power switching.
4749 * do any widget power switching.
4770 * do any widget power switching.