Lines Matching refs:widget

42 #define DAPM_UPDATE_STAT(widget, val) widget->dapm->card->dapm_stats.val++;
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 */
354 struct snd_soc_dapm_widget *widget;
359 static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget,
374 switch (widget->id) {
384 dev_warn(widget->dapm->dev,
409 data->widget =
410 snd_soc_dapm_new_control_unlocked(widget->dapm,
413 if (IS_ERR(data->widget)) {
414 ret = PTR_ERR(data->widget);
444 data->widget = snd_soc_dapm_new_control_unlocked(
445 widget->dapm, &template);
447 if (IS_ERR(data->widget)) {
448 ret = PTR_ERR(data->widget);
452 snd_soc_dapm_add_path(widget->dapm, data->widget,
453 widget, NULL, NULL);
455 data->value = soc_dapm_read(widget->dapm, e->reg) &
490 struct snd_soc_dapm_widget *widget)
508 new_wlist->widgets[n - 1] = widget;
527 if (!data->widget)
530 return data->widget->power;
561 if (data->widget) {
566 data->widget->on_val = value & data->widget->mask;
570 data->widget->on_val = value >> data->widget->shift;
573 data->widget->on_val = value;
584 * snd_soc_dapm_kcontrol_widget() - Returns the widget associated to a
747 /* connect mux widget to its interconnecting audio paths */
830 /* connect mixer widget to its interconnecting audio paths */
874 * create it. Either way, add the widget into the control's widget list
934 * front of the widget name.
969 "ASoC: failed to add widget %s dapm kcontrol %s: %d\n",
1009 if (data->widget)
1010 snd_soc_dapm_add_path(data->widget->dapm,
1011 data->widget,
1100 "ASoC: failed to add widget %s dapm kcontrol %s: %d\n",
1115 static int snd_soc_dapm_suspend_check(struct snd_soc_dapm_widget *widget)
1117 int level = snd_power_get_state(widget->dapm->card->snd_card);
1122 if (widget->ignore_suspend)
1123 dev_dbg(widget->dapm->dev, "ASoC: %s ignoring suspend\n",
1124 widget->name);
1125 return widget->ignore_suspend;
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,
1170 widget->endpoints[dir] = -1;
1172 snd_soc_dapm_widget_for_each_path(widget, rdir, path) {
1194 static __always_inline int is_connected_ep(struct snd_soc_dapm_widget *widget,
1206 if (widget->endpoints[dir] >= 0)
1207 return widget->endpoints[dir];
1209 DAPM_UPDATE_STAT(widget, path_checks);
1211 /* do we need to add this widget to the list ? */
1213 list_add_tail(&widget->work_list, list);
1215 if (custom_stop_condition && custom_stop_condition(widget, dir)) {
1220 if ((widget->is_ep & SND_SOC_DAPM_DIR_TO_EP(dir)) && widget->connected) {
1221 widget->endpoints[dir] = snd_soc_dapm_suspend_check(widget);
1222 return widget->endpoints[dir];
1225 snd_soc_dapm_widget_for_each_path(widget, rdir, path) {
1226 DAPM_UPDATE_STAT(widget, neighbour_checks);
1234 trace_snd_soc_dapm_path(widget, dir, path);
1243 widget->endpoints[dir] = con;
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,
1262 return is_connected_ep(widget, list, SND_SOC_DAPM_DIR_OUT,
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,
1280 return is_connected_ep(widget, list, SND_SOC_DAPM_DIR_IN,
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
1728 "ASoC: Failed to apply widget power: %d\n", ret);
1946 * Scan each dapm widget for complete audio path.
2283 /* test and update the power status of a mux widget */
2293 /* find dapm widget path assoc with kcontrol */
2329 /* test and update the power status of a mixer or switch widget */
2339 /* find dapm widget path assoc with kcontrol */
2458 /* show dapm widget status in sys fs */
2496 * snd_soc_dapm_free_widget - Free specified widget
2497 * @w: widget to free
2499 * Removes widget from all paths and frees memory occupied by it.
2512 * remove source and sink paths associated to this widget.
2738 int snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s)
2740 struct snd_soc_component *component = snd_soc_dapm_to_component(widget->dapm);
2741 const char *wname = widget->name;
2751 * dapm_update_widget_flags() - Re-compute widget sink and source flags
2752 * @w: The widget for which to update the flags
2757 * This function must be called whenever a path is added or removed to a widget.
2866 "Connecting non-supply widget to supply widget is not supported (%s -> %s)\n",
2988 * find src and dest widgets over all widgets but favor a widget from
3002 "ASoC: sink widget %s overwritten\n",
3016 "ASoC: source widget %s overwritten\n",
3020 /* use widget from another DAPM context if not found from this */
3118 * the widget receiving the audio signal, whilst the source is the sender
3309 dapm_mark_dirty(w, "new widget");
3635 const struct snd_soc_dapm_widget *widget)
3641 w = dapm_cnew_widget(widget, soc_dapm_prefix(dapm));
3647 w->regulator = devm_regulator_get(dapm->dev, widget->name);
3672 w->clk = devm_clk_get(dapm->dev, widget->name);
3778 * @widget: widget template
3782 * Returns a widget pointer on success or an error pointer on failure
3786 const struct snd_soc_dapm_widget *widget)
3791 w = snd_soc_dapm_new_control_unlocked(dapm, widget);
3801 * @widget: widget array
3809 const struct snd_soc_dapm_widget *widget,
3817 struct snd_soc_dapm_widget *w = snd_soc_dapm_new_control_unlocked(dapm, widget);
3822 widget++;
4049 /* Can't change the config when widget is already powered */
4129 dev_err(card->dev, "ASoC: Failed to create control for %s widget\n",
4139 dev_err(card->dev, "ASoC: Failed to create control for %s widget\n",
4200 dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name);
4219 dev_err(rtd->dev, "ASoC: Failed to create %s-%s widget: %d\n",
4247 dev_dbg(dai->dev, "ASoC: adding %s widget\n",
4263 dev_dbg(dai->dev, "ASoC: adding %s widget\n",
4284 /* For each DAI widget... */
4296 dev_dbg(card->dev, "dai widget %s has no DAI\n",
4486 * necessary widget power changes.
4534 * do any widget power switching.
4552 * do any widget power switching.
4580 * do any widget power switching.
4619 * do any widget power switching.
4646 * do any widget power switching.
4663 * do any widget power switching.
4694 * do any widget power switching.
4715 * do any widget power switching.