• Home
  • Raw
  • Download

Lines Matching refs:w

146 static bool dapm_dirty_widget(struct snd_soc_dapm_widget *w)  in dapm_dirty_widget()  argument
148 return !list_empty(&w->dirty); in dapm_dirty_widget()
151 static void dapm_mark_dirty(struct snd_soc_dapm_widget *w, const char *reason) in dapm_mark_dirty() argument
153 dapm_assert_locked(w->dapm); in dapm_mark_dirty()
155 if (!dapm_dirty_widget(w)) { in dapm_mark_dirty()
156 dev_vdbg(w->dapm->dev, "Marking %s dirty due to %s\n", in dapm_mark_dirty()
157 w->name, reason); in dapm_mark_dirty()
158 list_add_tail(&w->dirty, &w->dapm->card->dapm_dirty); in dapm_mark_dirty()
165 struct snd_soc_dapm_widget *w; in dapm_mark_io_dirty() local
169 list_for_each_entry(w, &card->widgets, list) { in dapm_mark_io_dirty()
170 switch (w->id) { in dapm_mark_io_dirty()
173 dapm_mark_dirty(w, "Rechecking inputs and outputs"); in dapm_mark_io_dirty()
380 struct snd_soc_dapm_widget *w; in dapm_reset() local
386 list_for_each_entry(w, &card->widgets, list) { in dapm_reset()
387 w->new_power = w->power; in dapm_reset()
388 w->power_checked = false; in dapm_reset()
389 w->inputs = -1; in dapm_reset()
390 w->outputs = -1; in dapm_reset()
512 static void dapm_set_mixer_path_status(struct snd_soc_dapm_widget *w, in dapm_set_mixer_path_status() argument
516 w->kcontrol_news[i].private_value; in dapm_set_mixer_path_status()
525 soc_dapm_read(w->dapm, reg, &val); in dapm_set_mixer_path_status()
561 struct snd_soc_dapm_widget *w; in dapm_is_shared_kcontrol() local
566 list_for_each_entry(w, &dapm->card->widgets, list) { in dapm_is_shared_kcontrol()
567 if (w == kcontrolw || w->dapm != kcontrolw->dapm) in dapm_is_shared_kcontrol()
569 for (i = 0; i < w->num_kcontrols; i++) { in dapm_is_shared_kcontrol()
570 if (&w->kcontrol_news[i] == kcontrol_new) { in dapm_is_shared_kcontrol()
571 if (w->kcontrols) in dapm_is_shared_kcontrol()
572 *kcontrol = w->kcontrols[i]; in dapm_is_shared_kcontrol()
585 static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w, in dapm_create_or_share_mixmux_kcontrol() argument
588 struct snd_soc_dapm_context *dapm = w->dapm; in dapm_create_or_share_mixmux_kcontrol()
605 shared = dapm_is_shared_kcontrol(dapm, w, &w->kcontrol_news[kci], in dapm_create_or_share_mixmux_kcontrol()
613 switch (w->id) { in dapm_create_or_share_mixmux_kcontrol()
640 w->name + prefix_len, in dapm_create_or_share_mixmux_kcontrol()
641 w->kcontrol_news[kci].name); in dapm_create_or_share_mixmux_kcontrol()
648 name = w->name + prefix_len; in dapm_create_or_share_mixmux_kcontrol()
651 name = w->kcontrol_news[kci].name; in dapm_create_or_share_mixmux_kcontrol()
654 kcontrol = snd_soc_cnew(&w->kcontrol_news[kci], NULL, name, in dapm_create_or_share_mixmux_kcontrol()
663 ret = dapm_kcontrol_data_alloc(w, kcontrol); in dapm_create_or_share_mixmux_kcontrol()
673 w->name, name, ret); in dapm_create_or_share_mixmux_kcontrol()
678 ret = dapm_kcontrol_add_widget(kcontrol, w); in dapm_create_or_share_mixmux_kcontrol()
680 w->kcontrols[kci] = kcontrol; in dapm_create_or_share_mixmux_kcontrol()
689 static int dapm_new_mixer(struct snd_soc_dapm_widget *w) in dapm_new_mixer() argument
695 for (i = 0; i < w->num_kcontrols; i++) { in dapm_new_mixer()
697 list_for_each_entry(path, &w->sources, list_sink) { in dapm_new_mixer()
699 if (path->name != (char *)w->kcontrol_news[i].name) in dapm_new_mixer()
702 if (w->kcontrols[i]) { in dapm_new_mixer()
703 dapm_kcontrol_add_path(w->kcontrols[i], path); in dapm_new_mixer()
707 ret = dapm_create_or_share_mixmux_kcontrol(w, i); in dapm_new_mixer()
711 dapm_kcontrol_add_path(w->kcontrols[i], path); in dapm_new_mixer()
719 static int dapm_new_mux(struct snd_soc_dapm_widget *w) in dapm_new_mux() argument
721 struct snd_soc_dapm_context *dapm = w->dapm; in dapm_new_mux()
725 if (w->num_kcontrols != 1) { in dapm_new_mux()
728 w->name); in dapm_new_mux()
732 if (list_empty(&w->sources)) { in dapm_new_mux()
733 dev_err(dapm->dev, "ASoC: mux %s has no paths\n", w->name); in dapm_new_mux()
737 ret = dapm_create_or_share_mixmux_kcontrol(w, 0); in dapm_new_mux()
741 list_for_each_entry(path, &w->sources, list_sink) in dapm_new_mux()
742 dapm_kcontrol_add_path(w->kcontrols[0], path); in dapm_new_mux()
748 static int dapm_new_pga(struct snd_soc_dapm_widget *w) in dapm_new_pga() argument
750 if (w->num_kcontrols) in dapm_new_pga()
751 dev_err(w->dapm->dev, in dapm_new_pga()
752 "ASoC: PGA controls not supported: '%s'\n", w->name); in dapm_new_pga()
807 struct snd_soc_dapm_widget *w) in dapm_list_add_widget() argument
819 if (wlist->widgets[i] == w) in dapm_list_add_widget()
829 dev_err(w->dapm->dev, "ASoC: can't allocate widget list for %s\n", in dapm_list_add_widget()
830 w->name); in dapm_list_add_widget()
836 dev_dbg(w->dapm->dev, "ASoC: added %s in widget list pos %d\n", in dapm_list_add_widget()
837 w->name, wlist->num_widgets); in dapm_list_add_widget()
839 wlist->widgets[wlist->num_widgets] = w; in dapm_list_add_widget()
1088 int dapm_regulator_event(struct snd_soc_dapm_widget *w, in dapm_regulator_event() argument
1093 soc_dapm_async_complete(w->dapm); in dapm_regulator_event()
1096 if (w->on_val & SND_SOC_DAPM_REGULATOR_BYPASS) { in dapm_regulator_event()
1097 ret = regulator_allow_bypass(w->regulator, false); in dapm_regulator_event()
1099 dev_warn(w->dapm->dev, in dapm_regulator_event()
1101 w->name, ret); in dapm_regulator_event()
1104 return regulator_enable(w->regulator); in dapm_regulator_event()
1106 if (w->on_val & SND_SOC_DAPM_REGULATOR_BYPASS) { in dapm_regulator_event()
1107 ret = regulator_allow_bypass(w->regulator, true); in dapm_regulator_event()
1109 dev_warn(w->dapm->dev, in dapm_regulator_event()
1111 w->name, ret); in dapm_regulator_event()
1114 return regulator_disable_deferred(w->regulator, w->shift); in dapm_regulator_event()
1122 int dapm_clock_event(struct snd_soc_dapm_widget *w, in dapm_clock_event() argument
1125 if (!w->clk) in dapm_clock_event()
1128 soc_dapm_async_complete(w->dapm); in dapm_clock_event()
1132 return clk_prepare_enable(w->clk); in dapm_clock_event()
1134 clk_disable_unprepare(w->clk); in dapm_clock_event()
1142 static int dapm_widget_power_check(struct snd_soc_dapm_widget *w) in dapm_widget_power_check() argument
1144 if (w->power_checked) in dapm_widget_power_check()
1145 return w->new_power; in dapm_widget_power_check()
1147 if (w->force) in dapm_widget_power_check()
1148 w->new_power = 1; in dapm_widget_power_check()
1150 w->new_power = w->power_check(w); in dapm_widget_power_check()
1152 w->power_checked = true; in dapm_widget_power_check()
1154 return w->new_power; in dapm_widget_power_check()
1159 static int dapm_generic_check_power(struct snd_soc_dapm_widget *w) in dapm_generic_check_power() argument
1163 DAPM_UPDATE_STAT(w, power_checks); in dapm_generic_check_power()
1165 in = is_connected_input_ep(w, NULL); in dapm_generic_check_power()
1166 dapm_clear_walk_input(w->dapm, &w->sources); in dapm_generic_check_power()
1167 out = is_connected_output_ep(w, NULL); in dapm_generic_check_power()
1168 dapm_clear_walk_output(w->dapm, &w->sinks); in dapm_generic_check_power()
1173 static int dapm_adc_check_power(struct snd_soc_dapm_widget *w) in dapm_adc_check_power() argument
1177 DAPM_UPDATE_STAT(w, power_checks); in dapm_adc_check_power()
1179 if (w->active) { in dapm_adc_check_power()
1180 in = is_connected_input_ep(w, NULL); in dapm_adc_check_power()
1181 dapm_clear_walk_input(w->dapm, &w->sources); in dapm_adc_check_power()
1184 return dapm_generic_check_power(w); in dapm_adc_check_power()
1189 static int dapm_dac_check_power(struct snd_soc_dapm_widget *w) in dapm_dac_check_power() argument
1193 DAPM_UPDATE_STAT(w, power_checks); in dapm_dac_check_power()
1195 if (w->active) { in dapm_dac_check_power()
1196 out = is_connected_output_ep(w, NULL); in dapm_dac_check_power()
1197 dapm_clear_walk_output(w->dapm, &w->sinks); in dapm_dac_check_power()
1200 return dapm_generic_check_power(w); in dapm_dac_check_power()
1205 static int dapm_supply_check_power(struct snd_soc_dapm_widget *w) in dapm_supply_check_power() argument
1209 DAPM_UPDATE_STAT(w, power_checks); in dapm_supply_check_power()
1212 list_for_each_entry(path, &w->sinks, list_source) { in dapm_supply_check_power()
1213 DAPM_UPDATE_STAT(w, neighbour_checks); in dapm_supply_check_power()
1232 static int dapm_always_on_check_power(struct snd_soc_dapm_widget *w) in dapm_always_on_check_power() argument
1269 struct snd_soc_dapm_widget *w; in dapm_seq_insert() local
1271 list_for_each_entry(w, list, power_list) in dapm_seq_insert()
1272 if (dapm_seq_compare(new_widget, w, power_up) < 0) { in dapm_seq_insert()
1273 list_add_tail(&new_widget->power_list, &w->power_list); in dapm_seq_insert()
1281 struct snd_soc_dapm_widget *w, int event) in dapm_seq_check_event() argument
1316 if (w->new_power != power) in dapm_seq_check_event()
1319 if (w->event && (w->event_flags & event)) { in dapm_seq_check_event()
1320 pop_dbg(w->dapm->dev, card->pop_time, "pop test : %s %s\n", in dapm_seq_check_event()
1321 w->name, ev_name); in dapm_seq_check_event()
1322 soc_dapm_async_complete(w->dapm); in dapm_seq_check_event()
1323 trace_snd_soc_dapm_widget_event_start(w, event); in dapm_seq_check_event()
1324 ret = w->event(w, NULL, event); in dapm_seq_check_event()
1325 trace_snd_soc_dapm_widget_event_done(w, event); in dapm_seq_check_event()
1327 dev_err(w->dapm->dev, "ASoC: %s: %s event failed: %d\n", in dapm_seq_check_event()
1328 ev_name, w->name, ret); in dapm_seq_check_event()
1337 struct snd_soc_dapm_widget *w; in dapm_seq_run_coalesced() local
1342 w = list_first_entry(pending, struct snd_soc_dapm_widget, power_list); in dapm_seq_run_coalesced()
1343 reg = w->reg; in dapm_seq_run_coalesced()
1344 dapm = w->dapm; in dapm_seq_run_coalesced()
1346 list_for_each_entry(w, pending, power_list) { in dapm_seq_run_coalesced()
1347 WARN_ON(reg != w->reg || dapm != w->dapm); in dapm_seq_run_coalesced()
1348 w->power = w->new_power; in dapm_seq_run_coalesced()
1350 mask |= w->mask << w->shift; in dapm_seq_run_coalesced()
1351 if (w->power) in dapm_seq_run_coalesced()
1352 value |= w->on_val << w->shift; in dapm_seq_run_coalesced()
1354 value |= w->off_val << w->shift; in dapm_seq_run_coalesced()
1358 w->name, reg, value, mask); in dapm_seq_run_coalesced()
1361 dapm_seq_check_event(card, w, SND_SOC_DAPM_PRE_PMU); in dapm_seq_run_coalesced()
1362 dapm_seq_check_event(card, w, SND_SOC_DAPM_PRE_PMD); in dapm_seq_run_coalesced()
1377 list_for_each_entry(w, pending, power_list) { in dapm_seq_run_coalesced()
1378 dapm_seq_check_event(card, w, SND_SOC_DAPM_POST_PMU); in dapm_seq_run_coalesced()
1379 dapm_seq_check_event(card, w, SND_SOC_DAPM_POST_PMD); in dapm_seq_run_coalesced()
1394 struct snd_soc_dapm_widget *w, *n; in dapm_seq_run() local
1409 list_for_each_entry_safe(w, n, list, power_list) { in dapm_seq_run()
1413 if (sort[w->id] != cur_sort || w->reg != cur_reg || in dapm_seq_run()
1414 w->dapm != cur_dapm || w->subseq != cur_subseq) { in dapm_seq_run()
1426 if (cur_dapm && w->dapm != cur_dapm) in dapm_seq_run()
1436 switch (w->id) { in dapm_seq_run()
1438 if (!w->event) in dapm_seq_run()
1439 list_for_each_entry_safe_continue(w, n, list, in dapm_seq_run()
1443 ret = w->event(w, in dapm_seq_run()
1446 ret = w->event(w, in dapm_seq_run()
1451 if (!w->event) in dapm_seq_run()
1452 list_for_each_entry_safe_continue(w, n, list, in dapm_seq_run()
1456 ret = w->event(w, in dapm_seq_run()
1459 ret = w->event(w, in dapm_seq_run()
1465 cur_sort = sort[w->id]; in dapm_seq_run()
1466 cur_subseq = w->subseq; in dapm_seq_run()
1467 cur_reg = w->reg; in dapm_seq_run()
1468 cur_dapm = w->dapm; in dapm_seq_run()
1469 list_move(&w->power_list, &pending); in dapm_seq_run()
1474 dev_err(w->dapm->dev, in dapm_seq_run()
1497 struct snd_soc_dapm_widget *w = NULL; in dapm_widget_update() local
1507 w = wlist->widgets[wi]; in dapm_widget_update()
1509 if (w->event && (w->event_flags & SND_SOC_DAPM_PRE_REG)) { in dapm_widget_update()
1510 ret = w->event(w, update->kcontrol, SND_SOC_DAPM_PRE_REG); in dapm_widget_update()
1512 dev_err(w->dapm->dev, "ASoC: %s DAPM pre-event failed: %d\n", in dapm_widget_update()
1513 w->name, ret); in dapm_widget_update()
1517 if (!w) in dapm_widget_update()
1520 ret = soc_dapm_update_bits(w->dapm, update->reg, update->mask, in dapm_widget_update()
1523 dev_err(w->dapm->dev, "ASoC: %s DAPM update failed: %d\n", in dapm_widget_update()
1524 w->name, ret); in dapm_widget_update()
1527 w = wlist->widgets[wi]; in dapm_widget_update()
1529 if (w->event && (w->event_flags & SND_SOC_DAPM_POST_REG)) { in dapm_widget_update()
1530 ret = w->event(w, update->kcontrol, SND_SOC_DAPM_POST_REG); in dapm_widget_update()
1532 dev_err(w->dapm->dev, "ASoC: %s DAPM post-event failed: %d\n", in dapm_widget_update()
1533 w->name, ret); in dapm_widget_update()
1625 static void dapm_widget_set_power(struct snd_soc_dapm_widget *w, bool power, in dapm_widget_set_power() argument
1631 if (w->power == power) in dapm_widget_set_power()
1634 trace_snd_soc_dapm_widget_power(w, power); in dapm_widget_set_power()
1639 list_for_each_entry(path, &w->sources, list_sink) { in dapm_widget_set_power()
1645 switch (w->id) { in dapm_widget_set_power()
1653 list_for_each_entry(path, &w->sinks, list_source) { in dapm_widget_set_power()
1663 dapm_seq_insert(w, up_list, true); in dapm_widget_set_power()
1665 dapm_seq_insert(w, down_list, false); in dapm_widget_set_power()
1668 static void dapm_power_one_widget(struct snd_soc_dapm_widget *w, in dapm_power_one_widget() argument
1674 switch (w->id) { in dapm_power_one_widget()
1676 dapm_seq_insert(w, down_list, false); in dapm_power_one_widget()
1679 dapm_seq_insert(w, up_list, true); in dapm_power_one_widget()
1683 power = dapm_widget_power_check(w); in dapm_power_one_widget()
1685 dapm_widget_set_power(w, power, up_list, down_list); in dapm_power_one_widget()
1717 struct snd_soc_dapm_widget *w; in dapm_power_widgets() local
1743 list_for_each_entry(w, &card->dapm_dirty, dirty) { in dapm_power_widgets()
1744 dapm_power_one_widget(w, &up_list, &down_list); in dapm_power_widgets()
1747 list_for_each_entry(w, &card->widgets, list) { in dapm_power_widgets()
1748 switch (w->id) { in dapm_power_widgets()
1754 list_del_init(&w->dirty); in dapm_power_widgets()
1758 if (w->new_power) { in dapm_power_widgets()
1759 d = w->dapm; in dapm_power_widgets()
1768 switch (w->id) { in dapm_power_widgets()
1810 list_for_each_entry(w, &down_list, power_list) { in dapm_power_widgets()
1811 dapm_seq_check_event(card, w, SND_SOC_DAPM_WILL_PMD); in dapm_power_widgets()
1814 list_for_each_entry(w, &up_list, power_list) { in dapm_power_widgets()
1815 dapm_seq_check_event(card, w, SND_SOC_DAPM_WILL_PMU); in dapm_power_widgets()
1856 struct snd_soc_dapm_widget *w = file->private_data; in dapm_widget_power_read_file() local
1857 struct snd_soc_card *card = w->dapm->card; in dapm_widget_power_read_file()
1869 in = is_connected_input_ep(w, NULL); in dapm_widget_power_read_file()
1870 dapm_clear_walk_input(w->dapm, &w->sources); in dapm_widget_power_read_file()
1871 out = is_connected_output_ep(w, NULL); in dapm_widget_power_read_file()
1872 dapm_clear_walk_output(w->dapm, &w->sinks); in dapm_widget_power_read_file()
1875 w->name, w->power ? "On" : "Off", in dapm_widget_power_read_file()
1876 w->force ? " (forced)" : "", in, out); in dapm_widget_power_read_file()
1878 if (w->reg >= 0) in dapm_widget_power_read_file()
1881 w->reg, w->reg, w->mask << w->shift); in dapm_widget_power_read_file()
1885 if (w->sname) in dapm_widget_power_read_file()
1887 w->sname, in dapm_widget_power_read_file()
1888 w->active ? "active" : "inactive"); in dapm_widget_power_read_file()
1890 list_for_each_entry(p, &w->sources, list_sink) { in dapm_widget_power_read_file()
1891 if (p->connected && !p->connected(w, p->source)) in dapm_widget_power_read_file()
1900 list_for_each_entry(p, &w->sinks, list_source) { in dapm_widget_power_read_file()
1901 if (p->connected && !p->connected(w, p->sink)) in dapm_widget_power_read_file()
1981 static void dapm_debugfs_add_widget(struct snd_soc_dapm_widget *w) in dapm_debugfs_add_widget() argument
1983 struct snd_soc_dapm_context *dapm = w->dapm; in dapm_debugfs_add_widget()
1986 if (!dapm->debugfs_dapm || !w->name) in dapm_debugfs_add_widget()
1989 d = debugfs_create_file(w->name, 0444, in dapm_debugfs_add_widget()
1990 dapm->debugfs_dapm, w, in dapm_debugfs_add_widget()
1993 dev_warn(w->dapm->dev, in dapm_debugfs_add_widget()
1995 w->name); in dapm_debugfs_add_widget()
2009 static inline void dapm_debugfs_add_widget(struct snd_soc_dapm_widget *w) in dapm_debugfs_add_widget() argument
2114 struct snd_soc_dapm_widget *w; in dapm_widget_show_codec() local
2118 list_for_each_entry(w, &codec->component.card->widgets, list) { in dapm_widget_show_codec()
2119 if (w->dapm != &codec->dapm) in dapm_widget_show_codec()
2123 switch (w->id) { in dapm_widget_show_codec()
2138 if (w->name) in dapm_widget_show_codec()
2140 w->name, w->power ? "On":"Off"); in dapm_widget_show_codec()
2209 struct snd_soc_dapm_widget *w, *next_w; in dapm_free_widgets() local
2212 list_for_each_entry_safe(w, next_w, &dapm->card->widgets, list) { in dapm_free_widgets()
2213 if (w->dapm != dapm) in dapm_free_widgets()
2215 list_del(&w->list); in dapm_free_widgets()
2221 list_for_each_entry_safe(p, next_p, &w->sources, list_sink) in dapm_free_widgets()
2224 list_for_each_entry_safe(p, next_p, &w->sinks, list_source) in dapm_free_widgets()
2227 kfree(w->kcontrols); in dapm_free_widgets()
2228 kfree(w->name); in dapm_free_widgets()
2229 kfree(w); in dapm_free_widgets()
2237 struct snd_soc_dapm_widget *w; in dapm_find_widget() local
2240 list_for_each_entry(w, &dapm->card->widgets, list) { in dapm_find_widget()
2241 if (!strcmp(w->name, pin)) { in dapm_find_widget()
2242 if (w->dapm == dapm) in dapm_find_widget()
2243 return w; in dapm_find_widget()
2245 fallback = w; in dapm_find_widget()
2258 struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); in snd_soc_dapm_set_pin() local
2262 if (!w) { in snd_soc_dapm_set_pin()
2267 if (w->connected != status) in snd_soc_dapm_set_pin()
2268 dapm_mark_dirty(w, "pin configuration"); in snd_soc_dapm_set_pin()
2270 w->connected = status; in snd_soc_dapm_set_pin()
2272 w->force = 0; in snd_soc_dapm_set_pin()
2430 struct snd_soc_dapm_widget *wsource = NULL, *wsink = NULL, *w; in snd_soc_dapm_add_route() local
2456 list_for_each_entry(w, &dapm->card->widgets, list) { in snd_soc_dapm_add_route()
2457 if (!wsink && !(strcmp(w->name, sink))) { in snd_soc_dapm_add_route()
2458 wtsink = w; in snd_soc_dapm_add_route()
2459 if (w->dapm == dapm) in snd_soc_dapm_add_route()
2460 wsink = w; in snd_soc_dapm_add_route()
2463 if (!wsource && !(strcmp(w->name, source))) { in snd_soc_dapm_add_route()
2464 wtsource = w; in snd_soc_dapm_add_route()
2465 if (w->dapm == dapm) in snd_soc_dapm_add_route()
2466 wsource = w; in snd_soc_dapm_add_route()
2700 struct snd_soc_dapm_widget *w; in snd_soc_dapm_new_widgets() local
2705 list_for_each_entry(w, &card->widgets, list) in snd_soc_dapm_new_widgets()
2707 if (w->new) in snd_soc_dapm_new_widgets()
2710 if (w->num_kcontrols) { in snd_soc_dapm_new_widgets()
2711 w->kcontrols = kzalloc(w->num_kcontrols * in snd_soc_dapm_new_widgets()
2714 if (!w->kcontrols) { in snd_soc_dapm_new_widgets()
2720 switch(w->id) { in snd_soc_dapm_new_widgets()
2724 dapm_new_mixer(w); in snd_soc_dapm_new_widgets()
2727 dapm_new_mux(w); in snd_soc_dapm_new_widgets()
2731 dapm_new_pga(w); in snd_soc_dapm_new_widgets()
2738 if (w->reg >= 0) { in snd_soc_dapm_new_widgets()
2739 soc_dapm_read(w->dapm, w->reg, &val); in snd_soc_dapm_new_widgets()
2740 val = val >> w->shift; in snd_soc_dapm_new_widgets()
2741 val &= w->mask; in snd_soc_dapm_new_widgets()
2742 if (val == w->on_val) in snd_soc_dapm_new_widgets()
2743 w->power = 1; in snd_soc_dapm_new_widgets()
2746 w->new = 1; in snd_soc_dapm_new_widgets()
2748 dapm_mark_dirty(w, "new widget"); in snd_soc_dapm_new_widgets()
2749 dapm_debugfs_add_widget(w); in snd_soc_dapm_new_widgets()
3045 struct snd_soc_dapm_widget *w; in snd_soc_dapm_new_control() local
3049 if ((w = dapm_cnew_widget(widget)) == NULL) in snd_soc_dapm_new_control()
3052 switch (w->id) { in snd_soc_dapm_new_control()
3054 w->regulator = devm_regulator_get(dapm->dev, w->name); in snd_soc_dapm_new_control()
3055 if (IS_ERR(w->regulator)) { in snd_soc_dapm_new_control()
3056 ret = PTR_ERR(w->regulator); in snd_soc_dapm_new_control()
3058 w->name, ret); in snd_soc_dapm_new_control()
3062 if (w->on_val & SND_SOC_DAPM_REGULATOR_BYPASS) { in snd_soc_dapm_new_control()
3063 ret = regulator_allow_bypass(w->regulator, true); in snd_soc_dapm_new_control()
3065 dev_warn(w->dapm->dev, in snd_soc_dapm_new_control()
3067 w->name, ret); in snd_soc_dapm_new_control()
3072 w->clk = devm_clk_get(dapm->dev, w->name); in snd_soc_dapm_new_control()
3073 if (IS_ERR(w->clk)) { in snd_soc_dapm_new_control()
3074 ret = PTR_ERR(w->clk); in snd_soc_dapm_new_control()
3076 w->name, ret); in snd_soc_dapm_new_control()
3089 w->name = kasprintf(GFP_KERNEL, "%s %s", prefix, widget->name); in snd_soc_dapm_new_control()
3091 w->sname = kasprintf(GFP_KERNEL, "%s %s", prefix, in snd_soc_dapm_new_control()
3094 w->name = kasprintf(GFP_KERNEL, "%s", widget->name); in snd_soc_dapm_new_control()
3096 w->sname = kasprintf(GFP_KERNEL, "%s", widget->sname); in snd_soc_dapm_new_control()
3098 if (w->name == NULL) { in snd_soc_dapm_new_control()
3099 kfree(w); in snd_soc_dapm_new_control()
3103 switch (w->id) { in snd_soc_dapm_new_control()
3107 w->power_check = dapm_generic_check_power; in snd_soc_dapm_new_control()
3110 w->power_check = dapm_generic_check_power; in snd_soc_dapm_new_control()
3113 w->power_check = dapm_adc_check_power; in snd_soc_dapm_new_control()
3116 w->power_check = dapm_dac_check_power; in snd_soc_dapm_new_control()
3132 w->power_check = dapm_generic_check_power; in snd_soc_dapm_new_control()
3138 w->power_check = dapm_supply_check_power; in snd_soc_dapm_new_control()
3141 w->power_check = dapm_always_on_check_power; in snd_soc_dapm_new_control()
3145 w->dapm = dapm; in snd_soc_dapm_new_control()
3147 w->codec = dapm->component->codec; in snd_soc_dapm_new_control()
3148 INIT_LIST_HEAD(&w->sources); in snd_soc_dapm_new_control()
3149 INIT_LIST_HEAD(&w->sinks); in snd_soc_dapm_new_control()
3150 INIT_LIST_HEAD(&w->list); in snd_soc_dapm_new_control()
3151 INIT_LIST_HEAD(&w->dirty); in snd_soc_dapm_new_control()
3152 list_add(&w->list, &dapm->card->widgets); in snd_soc_dapm_new_control()
3155 w->connected = 1; in snd_soc_dapm_new_control()
3156 return w; in snd_soc_dapm_new_control()
3173 struct snd_soc_dapm_widget *w; in snd_soc_dapm_new_controls() local
3179 w = snd_soc_dapm_new_control(dapm, widget); in snd_soc_dapm_new_controls()
3180 if (!w) { in snd_soc_dapm_new_controls()
3194 static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w, in snd_soc_dai_link_event() argument
3199 const struct snd_soc_pcm_stream *config = w->params; in snd_soc_dai_link_event()
3206 WARN_ON(list_empty(&w->sources) || list_empty(&w->sinks))) in snd_soc_dai_link_event()
3210 source_p = list_first_entry(&w->sources, struct snd_soc_dapm_path, in snd_soc_dai_link_event()
3212 sink_p = list_first_entry(&w->sinks, struct snd_soc_dapm_path, in snd_soc_dai_link_event()
3227 dev_warn(w->dapm->dev, "ASoC: Invalid format %llx specified\n", in snd_soc_dai_link_event()
3297 struct snd_soc_dapm_widget *w; in snd_soc_dapm_new_pcm() local
3318 w = snd_soc_dapm_new_control(&card->dapm, &template); in snd_soc_dapm_new_pcm()
3319 if (!w) { in snd_soc_dapm_new_pcm()
3325 w->params = params; in snd_soc_dapm_new_pcm()
3327 ret = snd_soc_dapm_add_path(&card->dapm, source, w, NULL, NULL); in snd_soc_dapm_new_pcm()
3330 return snd_soc_dapm_add_path(&card->dapm, w, sink, NULL, NULL); in snd_soc_dapm_new_pcm()
3337 struct snd_soc_dapm_widget *w; in snd_soc_dapm_new_dai_widgets() local
3352 w = snd_soc_dapm_new_control(dapm, &template); in snd_soc_dapm_new_dai_widgets()
3353 if (!w) { in snd_soc_dapm_new_dai_widgets()
3359 w->priv = dai; in snd_soc_dapm_new_dai_widgets()
3360 dai->playback_widget = w; in snd_soc_dapm_new_dai_widgets()
3371 w = snd_soc_dapm_new_control(dapm, &template); in snd_soc_dapm_new_dai_widgets()
3372 if (!w) { in snd_soc_dapm_new_dai_widgets()
3378 w->priv = dai; in snd_soc_dapm_new_dai_widgets()
3379 dai->capture_widget = w; in snd_soc_dapm_new_dai_widgets()
3387 struct snd_soc_dapm_widget *dai_w, *w; in snd_soc_dapm_link_dai_widgets() local
3404 list_for_each_entry(w, &card->widgets, list) { in snd_soc_dapm_link_dai_widgets()
3405 if (w->dapm != dai_w->dapm) in snd_soc_dapm_link_dai_widgets()
3408 switch (w->id) { in snd_soc_dapm_link_dai_widgets()
3416 if (!w->sname || !strstr(w->sname, dai_w->name)) in snd_soc_dapm_link_dai_widgets()
3421 sink = w; in snd_soc_dapm_link_dai_widgets()
3423 src = w; in snd_soc_dapm_link_dai_widgets()
3427 snd_soc_dapm_add_path(w->dapm, src, sink, NULL, NULL); in snd_soc_dapm_link_dai_widgets()
3478 struct snd_soc_dapm_widget *w; in soc_dapm_dai_stream_event() local
3481 w = dai->playback_widget; in soc_dapm_dai_stream_event()
3483 w = dai->capture_widget; in soc_dapm_dai_stream_event()
3485 if (w) { in soc_dapm_dai_stream_event()
3486 dapm_mark_dirty(w, "stream event"); in soc_dapm_dai_stream_event()
3490 w->active = 1; in soc_dapm_dai_stream_event()
3493 w->active = 0; in soc_dapm_dai_stream_event()
3619 struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); in snd_soc_dapm_force_enable_pin_unlocked() local
3621 if (!w) { in snd_soc_dapm_force_enable_pin_unlocked()
3626 dev_dbg(w->dapm->dev, "ASoC: force enable pin %s\n", pin); in snd_soc_dapm_force_enable_pin_unlocked()
3627 w->connected = 1; in snd_soc_dapm_force_enable_pin_unlocked()
3628 w->force = 1; in snd_soc_dapm_force_enable_pin_unlocked()
3629 dapm_mark_dirty(w, "force enable"); in snd_soc_dapm_force_enable_pin_unlocked()
3769 struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); in snd_soc_dapm_get_pin_status() local
3771 if (w) in snd_soc_dapm_get_pin_status()
3772 return w->connected; in snd_soc_dapm_get_pin_status()
3792 struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, false); in snd_soc_dapm_ignore_suspend() local
3794 if (!w) { in snd_soc_dapm_ignore_suspend()
3799 w->ignore_suspend = 1; in snd_soc_dapm_ignore_suspend()
3806 struct snd_soc_dapm_widget *w) in snd_soc_dapm_widget_in_card_paths() argument
3811 if ((p->source == w) || (p->sink == w)) { in snd_soc_dapm_widget_in_card_paths()
3850 struct snd_soc_dapm_widget *w; in snd_soc_dapm_auto_nc_pins() local
3854 list_for_each_entry(w, &card->widgets, list) { in snd_soc_dapm_auto_nc_pins()
3855 switch (w->id) { in snd_soc_dapm_auto_nc_pins()
3860 w->name); in snd_soc_dapm_auto_nc_pins()
3861 if (!snd_soc_dapm_widget_in_card_paths(card, w)) { in snd_soc_dapm_auto_nc_pins()
3864 snd_soc_dapm_nc_pin(w->dapm, w->name); in snd_soc_dapm_auto_nc_pins()
3891 struct snd_soc_dapm_widget *w; in soc_dapm_shutdown_dapm() local
3897 list_for_each_entry(w, &dapm->card->widgets, list) { in soc_dapm_shutdown_dapm()
3898 if (w->dapm != dapm) in soc_dapm_shutdown_dapm()
3900 if (w->power) { in soc_dapm_shutdown_dapm()
3901 dapm_seq_insert(w, &down_list, false); in soc_dapm_shutdown_dapm()
3902 w->power = 0; in soc_dapm_shutdown_dapm()