Lines Matching refs:dapm

48 #define DAPM_UPDATE_STAT(widget, val) widget->dapm->card->dapm_stats.val++;
57 static int snd_soc_dapm_add_path(struct snd_soc_dapm_context *dapm,
64 snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
68 snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
128 static void dapm_assert_locked(struct snd_soc_dapm_context *dapm) in dapm_assert_locked() argument
130 if (dapm->card && dapm->card->instantiated) in dapm_assert_locked()
131 lockdep_assert_held(&dapm->card->dapm_mutex); in dapm_assert_locked()
167 dapm_assert_locked(w->dapm); in dapm_mark_dirty()
170 dev_vdbg(w->dapm->dev, "Marking %s dirty due to %s\n", in dapm_mark_dirty()
172 list_add_tail(&w->dirty, &w->dapm->card->dapm_dirty); in dapm_mark_dirty()
191 dapm_assert_locked(w->dapm); in dapm_widget_invalidate_paths()
358 snd_soc_dapm_new_control_unlocked(widget->dapm, in dapm_kcontrol_data_alloc()
393 widget->dapm, &template); in dapm_kcontrol_data_alloc()
400 snd_soc_dapm_add_path(widget->dapm, data->widget, in dapm_kcontrol_data_alloc()
534 return dapm_kcontrol_get_wlist(kcontrol)->widgets[0]->dapm; in snd_soc_dapm_kcontrol_dapm()
552 static const char *soc_dapm_prefix(struct snd_soc_dapm_context *dapm) in soc_dapm_prefix() argument
554 if (!dapm->component) in soc_dapm_prefix()
556 return dapm->component->name_prefix; in soc_dapm_prefix()
559 static int soc_dapm_read(struct snd_soc_dapm_context *dapm, int reg, in soc_dapm_read() argument
562 if (!dapm->component) in soc_dapm_read()
564 return snd_soc_component_read(dapm->component, reg, value); in soc_dapm_read()
567 static int soc_dapm_update_bits(struct snd_soc_dapm_context *dapm, in soc_dapm_update_bits() argument
570 if (!dapm->component) in soc_dapm_update_bits()
572 return snd_soc_component_update_bits(dapm->component, reg, in soc_dapm_update_bits()
576 static int soc_dapm_test_bits(struct snd_soc_dapm_context *dapm, in soc_dapm_test_bits() argument
579 if (!dapm->component) in soc_dapm_test_bits()
581 return snd_soc_component_test_bits(dapm->component, reg, mask, value); in soc_dapm_test_bits()
584 static void soc_dapm_async_complete(struct snd_soc_dapm_context *dapm) in soc_dapm_async_complete() argument
586 if (dapm->component) in soc_dapm_async_complete()
587 snd_soc_component_async_complete(dapm->component); in soc_dapm_async_complete()
599 wlist = &w->dapm->card->widgets; in dapm_wcache_lookup()
636 int snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_force_bias_level() argument
641 if (dapm->set_bias_level) in snd_soc_dapm_force_bias_level()
642 ret = dapm->set_bias_level(dapm, level); in snd_soc_dapm_force_bias_level()
645 dapm->bias_level = level; in snd_soc_dapm_force_bias_level()
660 static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_set_bias_level() argument
663 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_set_bias_level()
669 ret = card->set_bias_level(card, dapm, level); in snd_soc_dapm_set_bias_level()
673 if (!card || dapm != &card->dapm) in snd_soc_dapm_set_bias_level()
674 ret = snd_soc_dapm_force_bias_level(dapm, level); in snd_soc_dapm_set_bias_level()
680 ret = card->set_bias_level_post(card, dapm, level); in snd_soc_dapm_set_bias_level()
688 static int dapm_connect_mux(struct snd_soc_dapm_context *dapm, in dapm_connect_mux() argument
698 soc_dapm_read(dapm, e->reg, &val); in dapm_connect_mux()
738 soc_dapm_read(p->sink->dapm, reg, &val); in dapm_set_mixer_path_status()
749 static int dapm_connect_mixer(struct snd_soc_dapm_context *dapm, in dapm_connect_mixer() argument
765 static int dapm_is_shared_kcontrol(struct snd_soc_dapm_context *dapm, in dapm_is_shared_kcontrol() argument
775 list_for_each_entry(w, &dapm->card->widgets, list) { in dapm_is_shared_kcontrol()
776 if (w == kcontrolw || w->dapm != kcontrolw->dapm) in dapm_is_shared_kcontrol()
797 struct snd_soc_dapm_context *dapm = w->dapm; in dapm_create_or_share_kcontrol() local
798 struct snd_card *card = dapm->card->snd_card; in dapm_create_or_share_kcontrol()
808 prefix = soc_dapm_prefix(dapm); in dapm_create_or_share_kcontrol()
814 shared = dapm_is_shared_kcontrol(dapm, w, &w->kcontrol_news[kci], in dapm_create_or_share_kcontrol()
882 dev_err(dapm->dev, in dapm_create_or_share_kcontrol()
924 snd_soc_dapm_add_path(data->widget->dapm, in dapm_new_mixer()
937 struct snd_soc_dapm_context *dapm = w->dapm; in dapm_new_mux() local
957 dev_err(dapm->dev, in dapm_new_mux()
964 dev_err(dapm->dev, "ASoC: %s %s has no paths\n", type, w->name); in dapm_new_mux()
999 struct snd_soc_dapm_context *dapm = w->dapm; in dapm_new_dai_link() local
1000 struct snd_card *card = dapm->card->snd_card; in dapm_new_dai_link()
1012 dev_err(dapm->dev, in dapm_new_dai_link()
1030 int level = snd_power_get_state(widget->dapm->card->snd_card); in snd_soc_dapm_suspend_check()
1036 dev_dbg(widget->dapm->dev, "ASoC: %s ignoring suspend\n", in snd_soc_dapm_suspend_check()
1199 soc_dapm_async_complete(w->dapm); in dapm_regulator_event()
1205 dev_warn(w->dapm->dev, in dapm_regulator_event()
1215 dev_warn(w->dapm->dev, in dapm_regulator_event()
1234 soc_dapm_async_complete(w->dapm); in dapm_clock_event()
1327 if (a->dapm != b->dapm) in dapm_seq_compare()
1328 return (unsigned long)a->dapm - (unsigned long)b->dapm; in dapm_seq_compare()
1389 pop_dbg(w->dapm->dev, card->pop_time, "pop test : %s %s\n", in dapm_seq_check_event()
1391 soc_dapm_async_complete(w->dapm); in dapm_seq_check_event()
1396 dev_err(w->dapm->dev, "ASoC: %s: %s event failed: %d\n", in dapm_seq_check_event()
1405 struct snd_soc_dapm_context *dapm; in dapm_seq_run_coalesced() local
1413 dapm = w->dapm; in dapm_seq_run_coalesced()
1416 WARN_ON(reg != w->reg || dapm != w->dapm); in dapm_seq_run_coalesced()
1425 pop_dbg(dapm->dev, card->pop_time, in dapm_seq_run_coalesced()
1439 pop_dbg(dapm->dev, card->pop_time, in dapm_seq_run_coalesced()
1443 soc_dapm_update_bits(dapm, reg, mask, value); in dapm_seq_run_coalesced()
1483 w->dapm != cur_dapm || w->subseq != cur_subseq) { in dapm_seq_run()
1495 if (cur_dapm && w->dapm != cur_dapm) in dapm_seq_run()
1537 cur_dapm = w->dapm; in dapm_seq_run()
1543 dev_err(w->dapm->dev, in dapm_seq_run()
1581 dev_err(w->dapm->dev, "ASoC: %s DAPM pre-event failed: %d\n", in dapm_widget_update()
1589 ret = soc_dapm_update_bits(w->dapm, update->reg, update->mask, in dapm_widget_update()
1592 dev_err(w->dapm->dev, "ASoC: %s DAPM update failed: %d\n", in dapm_widget_update()
1601 dev_err(w->dapm->dev, "ASoC: %s DAPM post-event failed: %d\n", in dapm_widget_update()
1746 static bool dapm_idle_bias_off(struct snd_soc_dapm_context *dapm) in dapm_idle_bias_off() argument
1748 if (dapm->idle_bias_off) in dapm_idle_bias_off()
1751 switch (snd_power_get_state(dapm->card->snd_card)) { in dapm_idle_bias_off()
1754 return dapm->suspend_bias_off; in dapm_idle_bias_off()
1815 d = w->dapm; in dapm_power_widgets()
1857 dapm_pre_sequence_async(&card->dapm, 0); in dapm_power_widgets()
1860 if (d != &card->dapm) in dapm_power_widgets()
1884 if (d != &card->dapm) in dapm_power_widgets()
1890 dapm_post_sequence_async(&card->dapm, 0); in dapm_power_widgets()
1913 struct snd_soc_card *card = w->dapm->card; in dapm_widget_power_read_file()
1985 struct snd_soc_dapm_context *dapm = file->private_data; in dapm_bias_read_file() local
1988 switch (dapm->bias_level) { in dapm_bias_read_file()
2002 WARN(1, "Unknown bias_level %d\n", dapm->bias_level); in dapm_bias_read_file()
2017 void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_debugfs_init() argument
2025 dapm->debugfs_dapm = debugfs_create_dir("dapm", parent); in snd_soc_dapm_debugfs_init()
2027 if (!dapm->debugfs_dapm) { in snd_soc_dapm_debugfs_init()
2028 dev_warn(dapm->dev, in snd_soc_dapm_debugfs_init()
2034 dapm->debugfs_dapm, dapm, in snd_soc_dapm_debugfs_init()
2037 dev_warn(dapm->dev, in snd_soc_dapm_debugfs_init()
2043 struct snd_soc_dapm_context *dapm = w->dapm; in dapm_debugfs_add_widget() local
2046 if (!dapm->debugfs_dapm || !w->name) in dapm_debugfs_add_widget()
2050 dapm->debugfs_dapm, w, in dapm_debugfs_add_widget()
2053 dev_warn(w->dapm->dev, in dapm_debugfs_add_widget()
2058 static void dapm_debugfs_cleanup(struct snd_soc_dapm_context *dapm) in dapm_debugfs_cleanup() argument
2060 debugfs_remove_recursive(dapm->debugfs_dapm); in dapm_debugfs_cleanup()
2064 void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_debugfs_init() argument
2073 static inline void dapm_debugfs_cleanup(struct snd_soc_dapm_context *dapm) in dapm_debugfs_cleanup() argument
2126 int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_mux_update_power() argument
2130 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_mux_update_power()
2165 int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_mixer_update_power() argument
2169 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_mixer_update_power()
2186 struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(cmpnt); in dapm_widget_show_component() local
2199 if (w->dapm != dapm) in dapm_widget_show_component()
2227 switch (snd_soc_dapm_get_bias_level(dapm)) { in dapm_widget_show_component()
2303 void snd_soc_dapm_reset_cache(struct snd_soc_dapm_context *dapm) in snd_soc_dapm_reset_cache() argument
2305 dapm->path_sink_cache.widget = NULL; in snd_soc_dapm_reset_cache()
2306 dapm->path_source_cache.widget = NULL; in snd_soc_dapm_reset_cache()
2310 static void dapm_free_widgets(struct snd_soc_dapm_context *dapm) in dapm_free_widgets() argument
2314 list_for_each_entry_safe(w, next_w, &dapm->card->widgets, list) { in dapm_free_widgets()
2315 if (w->dapm != dapm) in dapm_free_widgets()
2319 snd_soc_dapm_reset_cache(dapm); in dapm_free_widgets()
2323 struct snd_soc_dapm_context *dapm, const char *pin, in dapm_find_widget() argument
2329 list_for_each_entry(w, &dapm->card->widgets, list) { in dapm_find_widget()
2331 if (w->dapm == dapm) in dapm_find_widget()
2344 static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_set_pin() argument
2347 struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); in snd_soc_dapm_set_pin()
2349 dapm_assert_locked(dapm); in snd_soc_dapm_set_pin()
2352 dev_err(dapm->dev, "ASoC: DAPM unknown pin %s\n", pin); in snd_soc_dapm_set_pin()
2380 int snd_soc_dapm_sync_unlocked(struct snd_soc_dapm_context *dapm) in snd_soc_dapm_sync_unlocked() argument
2386 if (!dapm->card || !dapm->card->instantiated) in snd_soc_dapm_sync_unlocked()
2389 return dapm_power_widgets(dapm->card, SND_SOC_DAPM_STREAM_NOP); in snd_soc_dapm_sync_unlocked()
2402 int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm) in snd_soc_dapm_sync() argument
2406 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_sync()
2407 ret = snd_soc_dapm_sync_unlocked(dapm); in snd_soc_dapm_sync()
2408 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_sync()
2431 if (w->dapm->card->fully_routed) in dapm_update_widget_flags()
2446 if (w->dapm->card->fully_routed) in dapm_update_widget_flags()
2473 static int snd_soc_dapm_check_dynamic_path(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_check_dynamic_path() argument
2503 dev_err(dapm->dev, in snd_soc_dapm_check_dynamic_path()
2508 dev_err(dapm->dev, in snd_soc_dapm_check_dynamic_path()
2517 static int snd_soc_dapm_add_path(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_add_path() argument
2529 dev_err(dapm->dev, in snd_soc_dapm_add_path()
2536 dev_err(dapm->dev, in snd_soc_dapm_add_path()
2543 dev_err(dapm->dev, in snd_soc_dapm_add_path()
2549 ret = snd_soc_dapm_check_dynamic_path(dapm, wsource, wsink, control); in snd_soc_dapm_add_path()
2575 ret = dapm_connect_mux(dapm, path, control, wsource); in snd_soc_dapm_add_path()
2585 ret = dapm_connect_mux(dapm, path, control, wsink); in snd_soc_dapm_add_path()
2592 ret = dapm_connect_mixer(dapm, path, control); in snd_soc_dapm_add_path()
2601 list_add(&path->list, &dapm->card->paths); in snd_soc_dapm_add_path()
2610 if (dapm->card->instantiated && path->connect) in snd_soc_dapm_add_path()
2619 static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_add_route() argument
2631 prefix = soc_dapm_prefix(dapm); in snd_soc_dapm_add_route()
2644 wsource = dapm_wcache_lookup(&dapm->path_source_cache, source); in snd_soc_dapm_add_route()
2645 wsink = dapm_wcache_lookup(&dapm->path_sink_cache, sink); in snd_soc_dapm_add_route()
2654 list_for_each_entry(w, &dapm->card->widgets, list) { in snd_soc_dapm_add_route()
2657 if (w->dapm == dapm) { in snd_soc_dapm_add_route()
2666 if (w->dapm == dapm) { in snd_soc_dapm_add_route()
2680 dev_err(dapm->dev, "ASoC: no source widget found for %s\n", in snd_soc_dapm_add_route()
2685 dev_err(dapm->dev, "ASoC: no sink widget found for %s\n", in snd_soc_dapm_add_route()
2691 dapm_wcache_update(&dapm->path_sink_cache, wsink); in snd_soc_dapm_add_route()
2692 dapm_wcache_update(&dapm->path_source_cache, wsource); in snd_soc_dapm_add_route()
2694 ret = snd_soc_dapm_add_path(dapm, wsource, wsink, route->control, in snd_soc_dapm_add_route()
2701 dev_warn(dapm->dev, "ASoC: no dapm match for %s --> %s --> %s\n", in snd_soc_dapm_add_route()
2706 static int snd_soc_dapm_del_route(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_del_route() argument
2718 dev_err(dapm->dev, in snd_soc_dapm_del_route()
2723 prefix = soc_dapm_prefix(dapm); in snd_soc_dapm_del_route()
2737 list_for_each_entry(p, &dapm->card->paths, list) { in snd_soc_dapm_del_route()
2761 dev_warn(dapm->dev, "ASoC: Route %s->%s does not exist\n", in snd_soc_dapm_del_route()
2781 int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_add_routes() argument
2786 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_add_routes()
2788 r = snd_soc_dapm_add_route(dapm, route); in snd_soc_dapm_add_routes()
2790 dev_err(dapm->dev, "ASoC: Failed to add route %s -> %s -> %s\n", in snd_soc_dapm_add_routes()
2798 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_add_routes()
2812 int snd_soc_dapm_del_routes(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_del_routes() argument
2817 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_del_routes()
2819 snd_soc_dapm_del_route(dapm, route); in snd_soc_dapm_del_routes()
2822 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_del_routes()
2828 static int snd_soc_dapm_weak_route(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_weak_route() argument
2831 struct snd_soc_dapm_widget *source = dapm_find_widget(dapm, in snd_soc_dapm_weak_route()
2834 struct snd_soc_dapm_widget *sink = dapm_find_widget(dapm, in snd_soc_dapm_weak_route()
2841 dev_err(dapm->dev, "ASoC: Unable to find source %s for weak route\n", in snd_soc_dapm_weak_route()
2847 dev_err(dapm->dev, "ASoC: Unable to find sink %s for weak route\n", in snd_soc_dapm_weak_route()
2853 dev_warn(dapm->dev, "ASoC: Ignoring control for weak route %s->%s\n", in snd_soc_dapm_weak_route()
2864 dev_err(dapm->dev, "ASoC: No path found for weak route %s->%s\n", in snd_soc_dapm_weak_route()
2867 dev_warn(dapm->dev, "ASoC: %d paths found for weak route %s->%s\n", in snd_soc_dapm_weak_route()
2889 int snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_weak_routes() argument
2895 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_weak_routes()
2897 err = snd_soc_dapm_weak_route(dapm, route); in snd_soc_dapm_weak_routes()
2902 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_weak_routes()
2961 soc_dapm_read(w->dapm, w->reg, &val); in snd_soc_dapm_new_widgets()
2992 struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); in snd_soc_dapm_get_volsw() local
2993 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_get_volsw()
3005 dev_warn(dapm->dev, in snd_soc_dapm_get_volsw()
3011 ret = soc_dapm_read(dapm, reg, &val); in snd_soc_dapm_get_volsw()
3039 struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); in snd_soc_dapm_put_volsw() local
3040 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_put_volsw()
3054 dev_warn(dapm->dev, in snd_soc_dapm_put_volsw()
3072 reg_change = soc_dapm_test_bits(dapm, reg, mask, val); in snd_soc_dapm_put_volsw()
3111 struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); in snd_soc_dapm_get_enum_double() local
3112 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_get_enum_double()
3118 int ret = soc_dapm_read(dapm, e->reg, &reg_val); in snd_soc_dapm_get_enum_double()
3152 struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); in snd_soc_dapm_put_enum_double() local
3153 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_put_enum_double()
3178 reg_change = soc_dapm_test_bits(dapm, e->reg, mask, val); in snd_soc_dapm_put_enum_double()
3239 snd_soc_dapm_get_pin_status(&card->dapm, pin); in snd_soc_dapm_get_pin_switch()
3260 snd_soc_dapm_enable_pin(&card->dapm, pin); in snd_soc_dapm_put_pin_switch()
3262 snd_soc_dapm_disable_pin(&card->dapm, pin); in snd_soc_dapm_put_pin_switch()
3264 snd_soc_dapm_sync(&card->dapm); in snd_soc_dapm_put_pin_switch()
3270 snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_new_control() argument
3275 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_new_control()
3276 w = snd_soc_dapm_new_control_unlocked(dapm, widget); in snd_soc_dapm_new_control()
3278 dev_err(dapm->dev, in snd_soc_dapm_new_control()
3282 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_new_control()
3287 snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_new_control_unlocked() argument
3300 w->regulator = devm_regulator_get(dapm->dev, w->name); in snd_soc_dapm_new_control_unlocked()
3303 dev_err(dapm->dev, "ASoC: Failed to request %s: %d\n", in snd_soc_dapm_new_control_unlocked()
3311 dev_warn(w->dapm->dev, in snd_soc_dapm_new_control_unlocked()
3318 w->clk = devm_clk_get(dapm->dev, w->name); in snd_soc_dapm_new_control_unlocked()
3321 dev_err(dapm->dev, "ASoC: Failed to request %s: %d\n", in snd_soc_dapm_new_control_unlocked()
3333 prefix = soc_dapm_prefix(dapm); in snd_soc_dapm_new_control_unlocked()
3349 if (!dapm->card->fully_routed) in snd_soc_dapm_new_control_unlocked()
3359 if (!dapm->card->fully_routed) in snd_soc_dapm_new_control_unlocked()
3398 w->dapm = dapm; in snd_soc_dapm_new_control_unlocked()
3401 list_add_tail(&w->list, &dapm->card->widgets); in snd_soc_dapm_new_control_unlocked()
3423 int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_new_controls() argument
3431 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_new_controls()
3433 w = snd_soc_dapm_new_control_unlocked(dapm, widget); in snd_soc_dapm_new_controls()
3435 dev_err(dapm->dev, in snd_soc_dapm_new_controls()
3443 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_new_controls()
3479 dev_warn(w->dapm->dev, "ASoC: Invalid format %llx specified\n", in snd_soc_dai_link_event()
3639 dev_warn(card->dapm.dev, in snd_soc_dapm_new_pcm()
3699 w = snd_soc_dapm_new_control_unlocked(&card->dapm, &template); in snd_soc_dapm_new_pcm()
3710 ret = snd_soc_dapm_add_path(&card->dapm, source, w, NULL, NULL); in snd_soc_dapm_new_pcm()
3713 return snd_soc_dapm_add_path(&card->dapm, w, sink, NULL, NULL); in snd_soc_dapm_new_pcm()
3731 int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_new_dai_widgets() argument
3737 WARN_ON(dapm->dev != dai->dev); in snd_soc_dapm_new_dai_widgets()
3750 w = snd_soc_dapm_new_control_unlocked(dapm, &template); in snd_soc_dapm_new_dai_widgets()
3752 dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", in snd_soc_dapm_new_dai_widgets()
3769 w = snd_soc_dapm_new_control_unlocked(dapm, &template); in snd_soc_dapm_new_dai_widgets()
3771 dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", in snd_soc_dapm_new_dai_widgets()
3803 if (w->dapm != dai_w->dapm) in snd_soc_dapm_link_dai_widgets()
3825 snd_soc_dapm_add_path(w->dapm, src, sink, NULL, NULL); in snd_soc_dapm_link_dai_widgets()
3850 snd_soc_dapm_add_path(&card->dapm, source, sink, in dapm_connect_dai_link_widgets()
3862 snd_soc_dapm_add_path(&card->dapm, source, sink, in dapm_connect_dai_link_widgets()
3974 int snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_enable_pin_unlocked() argument
3977 return snd_soc_dapm_set_pin(dapm, pin, 1); in snd_soc_dapm_enable_pin_unlocked()
3992 int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin) in snd_soc_dapm_enable_pin() argument
3996 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_enable_pin()
3998 ret = snd_soc_dapm_set_pin(dapm, pin, 1); in snd_soc_dapm_enable_pin()
4000 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_enable_pin()
4020 int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_force_enable_pin_unlocked() argument
4023 struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); in snd_soc_dapm_force_enable_pin_unlocked()
4026 dev_err(dapm->dev, "ASoC: unknown pin %s\n", pin); in snd_soc_dapm_force_enable_pin_unlocked()
4030 dev_dbg(w->dapm->dev, "ASoC: force enable pin %s\n", pin); in snd_soc_dapm_force_enable_pin_unlocked()
4059 int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_force_enable_pin() argument
4064 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_force_enable_pin()
4066 ret = snd_soc_dapm_force_enable_pin_unlocked(dapm, pin); in snd_soc_dapm_force_enable_pin()
4068 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_force_enable_pin()
4086 int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_disable_pin_unlocked() argument
4089 return snd_soc_dapm_set_pin(dapm, pin, 0); in snd_soc_dapm_disable_pin_unlocked()
4103 int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_disable_pin() argument
4108 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_disable_pin()
4110 ret = snd_soc_dapm_set_pin(dapm, pin, 0); in snd_soc_dapm_disable_pin()
4112 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_disable_pin()
4134 int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_nc_pin_unlocked() argument
4137 return snd_soc_dapm_set_pin(dapm, pin, 0); in snd_soc_dapm_nc_pin_unlocked()
4155 int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin) in snd_soc_dapm_nc_pin() argument
4159 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_nc_pin()
4161 ret = snd_soc_dapm_set_pin(dapm, pin, 0); in snd_soc_dapm_nc_pin()
4163 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_nc_pin()
4178 int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_get_pin_status() argument
4181 struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); in snd_soc_dapm_get_pin_status()
4201 int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_ignore_suspend() argument
4204 struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, false); in snd_soc_dapm_ignore_suspend()
4207 dev_err(dapm->dev, "ASoC: unknown pin %s\n", pin); in snd_soc_dapm_ignore_suspend()
4223 void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm) in snd_soc_dapm_free() argument
4225 dapm_debugfs_cleanup(dapm); in snd_soc_dapm_free()
4226 dapm_free_widgets(dapm); in snd_soc_dapm_free()
4227 list_del(&dapm->list); in snd_soc_dapm_free()
4231 static void soc_dapm_shutdown_dapm(struct snd_soc_dapm_context *dapm) in soc_dapm_shutdown_dapm() argument
4233 struct snd_soc_card *card = dapm->card; in soc_dapm_shutdown_dapm()
4240 list_for_each_entry(w, &dapm->card->widgets, list) { in soc_dapm_shutdown_dapm()
4241 if (w->dapm != dapm) in soc_dapm_shutdown_dapm()
4254 if (dapm->bias_level == SND_SOC_BIAS_ON) in soc_dapm_shutdown_dapm()
4255 snd_soc_dapm_set_bias_level(dapm, in soc_dapm_shutdown_dapm()
4258 if (dapm->bias_level == SND_SOC_BIAS_PREPARE) in soc_dapm_shutdown_dapm()
4259 snd_soc_dapm_set_bias_level(dapm, in soc_dapm_shutdown_dapm()
4271 struct snd_soc_dapm_context *dapm; in snd_soc_dapm_shutdown() local
4273 list_for_each_entry(dapm, &card->dapm_list, list) { in snd_soc_dapm_shutdown()
4274 if (dapm != &card->dapm) { in snd_soc_dapm_shutdown()
4275 soc_dapm_shutdown_dapm(dapm); in snd_soc_dapm_shutdown()
4276 if (dapm->bias_level == SND_SOC_BIAS_STANDBY) in snd_soc_dapm_shutdown()
4277 snd_soc_dapm_set_bias_level(dapm, in snd_soc_dapm_shutdown()
4282 soc_dapm_shutdown_dapm(&card->dapm); in snd_soc_dapm_shutdown()
4283 if (card->dapm.bias_level == SND_SOC_BIAS_STANDBY) in snd_soc_dapm_shutdown()
4284 snd_soc_dapm_set_bias_level(&card->dapm, in snd_soc_dapm_shutdown()