Lines Matching refs:dapm

48 #define DAPM_UPDATE_STAT(widget, val) widget->dapm->card->dapm_stats.val++;
50 static int snd_soc_dapm_add_path(struct snd_soc_dapm_context *dapm,
56 snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
114 static void dapm_assert_locked(struct snd_soc_dapm_context *dapm) in dapm_assert_locked() argument
116 if (dapm->card && dapm->card->instantiated) in dapm_assert_locked()
117 lockdep_assert_held(&dapm->card->dapm_mutex); in dapm_assert_locked()
153 dapm_assert_locked(w->dapm); in dapm_mark_dirty()
156 dev_vdbg(w->dapm->dev, "Marking %s dirty due to %s\n", in dapm_mark_dirty()
158 list_add_tail(&w->dirty, &w->dapm->card->dapm_dirty); in dapm_mark_dirty()
180 dapm_assert_locked(w->dapm); in dapm_widget_invalidate_input_paths()
219 dapm_assert_locked(w->dapm); in dapm_widget_invalidate_output_paths()
314 dev_err(widget->dapm->dev, in dapm_kcontrol_data_alloc()
345 data->widget = snd_soc_dapm_new_control(widget->dapm, in dapm_kcontrol_data_alloc()
410 snd_soc_dapm_add_path(data->widget->dapm, data->widget, in dapm_kcontrol_add_path()
472 return dapm_kcontrol_get_wlist(kcontrol)->widgets[0]->dapm; in snd_soc_dapm_kcontrol_dapm()
490 static const char *soc_dapm_prefix(struct snd_soc_dapm_context *dapm) in soc_dapm_prefix() argument
492 if (!dapm->component) in soc_dapm_prefix()
494 return dapm->component->name_prefix; in soc_dapm_prefix()
497 static int soc_dapm_read(struct snd_soc_dapm_context *dapm, int reg, in soc_dapm_read() argument
500 if (!dapm->component) in soc_dapm_read()
502 return snd_soc_component_read(dapm->component, reg, value); in soc_dapm_read()
505 static int soc_dapm_update_bits(struct snd_soc_dapm_context *dapm, in soc_dapm_update_bits() argument
508 if (!dapm->component) in soc_dapm_update_bits()
510 return snd_soc_component_update_bits(dapm->component, reg, in soc_dapm_update_bits()
514 static int soc_dapm_test_bits(struct snd_soc_dapm_context *dapm, in soc_dapm_test_bits() argument
517 if (!dapm->component) in soc_dapm_test_bits()
519 return snd_soc_component_test_bits(dapm->component, reg, mask, value); in soc_dapm_test_bits()
522 static void soc_dapm_async_complete(struct snd_soc_dapm_context *dapm) in soc_dapm_async_complete() argument
524 if (dapm->component) in soc_dapm_async_complete()
525 snd_soc_component_async_complete(dapm->component); in soc_dapm_async_complete()
537 static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_set_bias_level() argument
540 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_set_bias_level()
546 ret = card->set_bias_level(card, dapm, level); in snd_soc_dapm_set_bias_level()
550 if (dapm->set_bias_level) in snd_soc_dapm_set_bias_level()
551 ret = dapm->set_bias_level(dapm, level); in snd_soc_dapm_set_bias_level()
552 else if (!card || dapm != &card->dapm) in snd_soc_dapm_set_bias_level()
553 dapm->bias_level = level; in snd_soc_dapm_set_bias_level()
559 ret = card->set_bias_level_post(card, dapm, level); in snd_soc_dapm_set_bias_level()
567 static int dapm_connect_mux(struct snd_soc_dapm_context *dapm, in dapm_connect_mux() argument
576 soc_dapm_read(dapm, e->reg, &val); in dapm_connect_mux()
616 soc_dapm_read(p->sink->dapm, reg, &val); in dapm_set_mixer_path_status()
627 static int dapm_connect_mixer(struct snd_soc_dapm_context *dapm, in dapm_connect_mixer() argument
643 static int dapm_is_shared_kcontrol(struct snd_soc_dapm_context *dapm, in dapm_is_shared_kcontrol() argument
653 list_for_each_entry(w, &dapm->card->widgets, list) { in dapm_is_shared_kcontrol()
654 if (w == kcontrolw || w->dapm != kcontrolw->dapm) in dapm_is_shared_kcontrol()
675 struct snd_soc_dapm_context *dapm = w->dapm; in dapm_create_or_share_mixmux_kcontrol() local
676 struct snd_card *card = dapm->card->snd_card; in dapm_create_or_share_mixmux_kcontrol()
686 prefix = soc_dapm_prefix(dapm); in dapm_create_or_share_mixmux_kcontrol()
692 shared = dapm_is_shared_kcontrol(dapm, w, &w->kcontrol_news[kci], in dapm_create_or_share_mixmux_kcontrol()
758 dev_err(dapm->dev, in dapm_create_or_share_mixmux_kcontrol()
808 struct snd_soc_dapm_context *dapm = w->dapm; in dapm_new_mux() local
813 dev_err(dapm->dev, in dapm_new_mux()
820 dev_err(dapm->dev, "ASoC: mux %s has no paths\n", w->name); in dapm_new_mux()
840 dev_err(w->dapm->dev, in dapm_new_pga()
851 struct snd_soc_dapm_context *dapm = w->dapm; in dapm_new_dai_link() local
852 struct snd_card *card = dapm->card->snd_card; in dapm_new_dai_link()
864 dev_err(dapm->dev, in dapm_new_dai_link()
882 int level = snd_power_get_state(widget->dapm->card->snd_card); in snd_soc_dapm_suspend_check()
888 dev_dbg(widget->dapm->dev, "ASoC: %s ignoring suspend\n", in snd_soc_dapm_suspend_check()
920 dev_err(w->dapm->dev, "ASoC: can't allocate widget list for %s\n", in dapm_list_add_widget()
927 dev_dbg(w->dapm->dev, "ASoC: added %s in widget list pos %d\n", in dapm_list_add_widget()
974 dev_err(widget->dapm->dev, in is_connected_output_ep()
1032 dev_err(widget->dapm->dev, in is_connected_input_ep()
1100 soc_dapm_async_complete(w->dapm); in dapm_regulator_event()
1106 dev_warn(w->dapm->dev, in dapm_regulator_event()
1116 dev_warn(w->dapm->dev, in dapm_regulator_event()
1135 soc_dapm_async_complete(w->dapm); in dapm_clock_event()
1228 if (a->dapm != b->dapm) in dapm_seq_compare()
1229 return (unsigned long)a->dapm - (unsigned long)b->dapm; in dapm_seq_compare()
1290 pop_dbg(w->dapm->dev, card->pop_time, "pop test : %s %s\n", in dapm_seq_check_event()
1292 soc_dapm_async_complete(w->dapm); in dapm_seq_check_event()
1297 dev_err(w->dapm->dev, "ASoC: %s: %s event failed: %d\n", in dapm_seq_check_event()
1306 struct snd_soc_dapm_context *dapm; in dapm_seq_run_coalesced() local
1314 dapm = w->dapm; in dapm_seq_run_coalesced()
1317 WARN_ON(reg != w->reg || dapm != w->dapm); in dapm_seq_run_coalesced()
1326 pop_dbg(dapm->dev, card->pop_time, in dapm_seq_run_coalesced()
1340 pop_dbg(dapm->dev, card->pop_time, in dapm_seq_run_coalesced()
1344 soc_dapm_update_bits(dapm, reg, mask, value); in dapm_seq_run_coalesced()
1384 w->dapm != cur_dapm || w->subseq != cur_subseq) { in dapm_seq_run()
1396 if (cur_dapm && w->dapm != cur_dapm) in dapm_seq_run()
1438 cur_dapm = w->dapm; in dapm_seq_run()
1444 dev_err(w->dapm->dev, in dapm_seq_run()
1482 dev_err(w->dapm->dev, "ASoC: %s DAPM pre-event failed: %d\n", in dapm_widget_update()
1490 ret = soc_dapm_update_bits(w->dapm, update->reg, update->mask, in dapm_widget_update()
1493 dev_err(w->dapm->dev, "ASoC: %s DAPM update failed: %d\n", in dapm_widget_update()
1502 dev_err(w->dapm->dev, "ASoC: %s DAPM post-event failed: %d\n", in dapm_widget_update()
1647 static bool dapm_idle_bias_off(struct snd_soc_dapm_context *dapm) in dapm_idle_bias_off() argument
1649 if (dapm->idle_bias_off) in dapm_idle_bias_off()
1652 switch (snd_power_get_state(dapm->card->snd_card)) { in dapm_idle_bias_off()
1655 return dapm->suspend_bias_off; in dapm_idle_bias_off()
1716 d = w->dapm; in dapm_power_widgets()
1758 dapm_pre_sequence_async(&card->dapm, 0); in dapm_power_widgets()
1761 if (d != &card->dapm) in dapm_power_widgets()
1785 if (d != &card->dapm) in dapm_power_widgets()
1791 dapm_post_sequence_async(&card->dapm, 0); in dapm_power_widgets()
1814 struct snd_soc_card *card = w->dapm->card; in dapm_widget_power_read_file()
1889 struct snd_soc_dapm_context *dapm = file->private_data; in dapm_bias_read_file() local
1892 switch (dapm->bias_level) { in dapm_bias_read_file()
1906 WARN(1, "Unknown bias_level %d\n", dapm->bias_level); in dapm_bias_read_file()
1921 void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_debugfs_init() argument
1929 dapm->debugfs_dapm = debugfs_create_dir("dapm", parent); in snd_soc_dapm_debugfs_init()
1931 if (!dapm->debugfs_dapm) { in snd_soc_dapm_debugfs_init()
1932 dev_warn(dapm->dev, in snd_soc_dapm_debugfs_init()
1938 dapm->debugfs_dapm, dapm, in snd_soc_dapm_debugfs_init()
1941 dev_warn(dapm->dev, in snd_soc_dapm_debugfs_init()
1947 struct snd_soc_dapm_context *dapm = w->dapm; in dapm_debugfs_add_widget() local
1950 if (!dapm->debugfs_dapm || !w->name) in dapm_debugfs_add_widget()
1954 dapm->debugfs_dapm, w, in dapm_debugfs_add_widget()
1957 dev_warn(w->dapm->dev, in dapm_debugfs_add_widget()
1962 static void dapm_debugfs_cleanup(struct snd_soc_dapm_context *dapm) in dapm_debugfs_cleanup() argument
1964 debugfs_remove_recursive(dapm->debugfs_dapm); in dapm_debugfs_cleanup()
1968 void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_debugfs_init() argument
1977 static inline void dapm_debugfs_cleanup(struct snd_soc_dapm_context *dapm) in dapm_debugfs_cleanup() argument
2030 int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_mux_update_power() argument
2034 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_mux_update_power()
2069 int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_mixer_update_power() argument
2073 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_mixer_update_power()
2094 if (w->dapm != &codec->dapm) in dapm_widget_show_codec()
2122 switch (codec->dapm.bias_level) { in dapm_widget_show_codec()
2177 static void dapm_free_widgets(struct snd_soc_dapm_context *dapm) in dapm_free_widgets() argument
2182 list_for_each_entry_safe(w, next_w, &dapm->card->widgets, list) { in dapm_free_widgets()
2183 if (w->dapm != dapm) in dapm_free_widgets()
2204 struct snd_soc_dapm_context *dapm, const char *pin, in dapm_find_widget() argument
2210 list_for_each_entry(w, &dapm->card->widgets, list) { in dapm_find_widget()
2212 if (w->dapm == dapm) in dapm_find_widget()
2225 static int snd_soc_dapm_set_pin(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_set_pin() argument
2228 struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); in snd_soc_dapm_set_pin()
2230 dapm_assert_locked(dapm); in snd_soc_dapm_set_pin()
2233 dev_err(dapm->dev, "ASoC: DAPM unknown pin %s\n", pin); in snd_soc_dapm_set_pin()
2261 int snd_soc_dapm_sync_unlocked(struct snd_soc_dapm_context *dapm) in snd_soc_dapm_sync_unlocked() argument
2267 if (!dapm->card || !dapm->card->instantiated) in snd_soc_dapm_sync_unlocked()
2270 return dapm_power_widgets(dapm->card, SND_SOC_DAPM_STREAM_NOP); in snd_soc_dapm_sync_unlocked()
2283 int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm) in snd_soc_dapm_sync() argument
2287 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_sync()
2288 ret = snd_soc_dapm_sync_unlocked(dapm); in snd_soc_dapm_sync()
2289 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_sync()
2310 if (w->dapm->card->fully_routed) in dapm_update_widget_flags()
2325 if (w->dapm->card->fully_routed) in dapm_update_widget_flags()
2347 static int snd_soc_dapm_add_path(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_add_path() argument
2357 dev_err(dapm->dev, in snd_soc_dapm_add_path()
2364 dev_err(dapm->dev, in snd_soc_dapm_add_path()
2371 dev_err(dapm->dev, in snd_soc_dapm_add_path()
2399 ret = dapm_connect_mux(dapm, path, control); in snd_soc_dapm_add_path()
2406 ret = dapm_connect_mixer(dapm, path, control); in snd_soc_dapm_add_path()
2411 dev_err(dapm->dev, in snd_soc_dapm_add_path()
2419 list_add(&path->list, &dapm->card->paths); in snd_soc_dapm_add_path()
2429 if (dapm->card->instantiated && path->connect) in snd_soc_dapm_add_path()
2438 static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_add_route() argument
2450 prefix = soc_dapm_prefix(dapm); in snd_soc_dapm_add_route()
2467 list_for_each_entry(w, &dapm->card->widgets, list) { in snd_soc_dapm_add_route()
2470 if (w->dapm == dapm) in snd_soc_dapm_add_route()
2476 if (w->dapm == dapm) in snd_soc_dapm_add_route()
2487 dev_err(dapm->dev, "ASoC: no source widget found for %s\n", in snd_soc_dapm_add_route()
2492 dev_err(dapm->dev, "ASoC: no sink widget found for %s\n", in snd_soc_dapm_add_route()
2497 ret = snd_soc_dapm_add_path(dapm, wsource, wsink, route->control, in snd_soc_dapm_add_route()
2504 dev_warn(dapm->dev, "ASoC: no dapm match for %s --> %s --> %s\n", in snd_soc_dapm_add_route()
2509 static int snd_soc_dapm_del_route(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_del_route() argument
2521 dev_err(dapm->dev, in snd_soc_dapm_del_route()
2526 prefix = soc_dapm_prefix(dapm); in snd_soc_dapm_del_route()
2540 list_for_each_entry(p, &dapm->card->paths, list) { in snd_soc_dapm_del_route()
2564 dev_warn(dapm->dev, "ASoC: Route %s->%s does not exist\n", in snd_soc_dapm_del_route()
2584 int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_add_routes() argument
2589 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_add_routes()
2591 r = snd_soc_dapm_add_route(dapm, route); in snd_soc_dapm_add_routes()
2593 dev_err(dapm->dev, "ASoC: Failed to add route %s -> %s -> %s\n", in snd_soc_dapm_add_routes()
2601 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_add_routes()
2615 int snd_soc_dapm_del_routes(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_del_routes() argument
2620 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_del_routes()
2622 snd_soc_dapm_del_route(dapm, route); in snd_soc_dapm_del_routes()
2625 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_del_routes()
2631 static int snd_soc_dapm_weak_route(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_weak_route() argument
2634 struct snd_soc_dapm_widget *source = dapm_find_widget(dapm, in snd_soc_dapm_weak_route()
2637 struct snd_soc_dapm_widget *sink = dapm_find_widget(dapm, in snd_soc_dapm_weak_route()
2644 dev_err(dapm->dev, "ASoC: Unable to find source %s for weak route\n", in snd_soc_dapm_weak_route()
2650 dev_err(dapm->dev, "ASoC: Unable to find sink %s for weak route\n", in snd_soc_dapm_weak_route()
2656 dev_warn(dapm->dev, "ASoC: Ignoring control for weak route %s->%s\n", in snd_soc_dapm_weak_route()
2667 dev_err(dapm->dev, "ASoC: No path found for weak route %s->%s\n", in snd_soc_dapm_weak_route()
2670 dev_warn(dapm->dev, "ASoC: %d paths found for weak route %s->%s\n", in snd_soc_dapm_weak_route()
2692 int snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_weak_routes() argument
2698 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_weak_routes()
2700 err = snd_soc_dapm_weak_route(dapm, route); in snd_soc_dapm_weak_routes()
2705 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_weak_routes()
2763 soc_dapm_read(w->dapm, w->reg, &val); in snd_soc_dapm_new_widgets()
2794 struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); in snd_soc_dapm_get_volsw() local
2795 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_get_volsw()
2807 dev_warn(dapm->dev, in snd_soc_dapm_get_volsw()
2813 ret = soc_dapm_read(dapm, reg, &val); in snd_soc_dapm_get_volsw()
2841 struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); in snd_soc_dapm_put_volsw() local
2842 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_put_volsw()
2856 dev_warn(dapm->dev, in snd_soc_dapm_put_volsw()
2874 reg_change = soc_dapm_test_bits(dapm, reg, mask, val); in snd_soc_dapm_put_volsw()
2913 struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); in snd_soc_dapm_get_enum_double() local
2918 int ret = soc_dapm_read(dapm, e->reg, &reg_val); in snd_soc_dapm_get_enum_double()
2949 struct snd_soc_dapm_context *dapm = snd_soc_dapm_kcontrol_dapm(kcontrol); in snd_soc_dapm_put_enum_double() local
2950 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_put_enum_double()
2973 change = soc_dapm_test_bits(dapm, e->reg, mask, val); in snd_soc_dapm_put_enum_double()
3035 snd_soc_dapm_get_pin_status(&card->dapm, pin); in snd_soc_dapm_get_pin_switch()
3056 snd_soc_dapm_enable_pin(&card->dapm, pin); in snd_soc_dapm_put_pin_switch()
3058 snd_soc_dapm_disable_pin(&card->dapm, pin); in snd_soc_dapm_put_pin_switch()
3060 snd_soc_dapm_sync(&card->dapm); in snd_soc_dapm_put_pin_switch()
3066 snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_new_control() argument
3078 w->regulator = devm_regulator_get(dapm->dev, w->name); in snd_soc_dapm_new_control()
3081 dev_err(dapm->dev, "ASoC: Failed to request %s: %d\n", in snd_soc_dapm_new_control()
3089 dev_warn(w->dapm->dev, in snd_soc_dapm_new_control()
3096 w->clk = devm_clk_get(dapm->dev, w->name); in snd_soc_dapm_new_control()
3099 dev_err(dapm->dev, "ASoC: Failed to request %s: %d\n", in snd_soc_dapm_new_control()
3111 prefix = soc_dapm_prefix(dapm); in snd_soc_dapm_new_control()
3127 if (!dapm->card->fully_routed) in snd_soc_dapm_new_control()
3137 if (!dapm->card->fully_routed) in snd_soc_dapm_new_control()
3175 w->dapm = dapm; in snd_soc_dapm_new_control()
3180 list_add(&w->list, &dapm->card->widgets); in snd_soc_dapm_new_control()
3200 int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_new_controls() argument
3208 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_new_controls()
3210 w = snd_soc_dapm_new_control(dapm, widget); in snd_soc_dapm_new_controls()
3212 dev_err(dapm->dev, in snd_soc_dapm_new_controls()
3220 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_new_controls()
3258 dev_warn(w->dapm->dev, "ASoC: Invalid format %llx specified\n", in snd_soc_dai_link_event()
3388 dev_warn(card->dapm.dev, in snd_soc_dapm_new_pcm()
3448 w = snd_soc_dapm_new_control(&card->dapm, &template); in snd_soc_dapm_new_pcm()
3459 ret = snd_soc_dapm_add_path(&card->dapm, source, w, NULL, NULL); in snd_soc_dapm_new_pcm()
3462 return snd_soc_dapm_add_path(&card->dapm, w, sink, NULL, NULL); in snd_soc_dapm_new_pcm()
3480 int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_new_dai_widgets() argument
3486 WARN_ON(dapm->dev != dai->dev); in snd_soc_dapm_new_dai_widgets()
3499 w = snd_soc_dapm_new_control(dapm, &template); in snd_soc_dapm_new_dai_widgets()
3501 dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", in snd_soc_dapm_new_dai_widgets()
3518 w = snd_soc_dapm_new_control(dapm, &template); in snd_soc_dapm_new_dai_widgets()
3520 dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", in snd_soc_dapm_new_dai_widgets()
3552 if (w->dapm != dai_w->dapm) in snd_soc_dapm_link_dai_widgets()
3574 snd_soc_dapm_add_path(w->dapm, src, sink, NULL, NULL); in snd_soc_dapm_link_dai_widgets()
3604 snd_soc_dapm_add_path(&card->dapm, source, sink, in dapm_connect_dai_link_widgets()
3616 snd_soc_dapm_add_path(&card->dapm, source, sink, in dapm_connect_dai_link_widgets()
3725 int snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_enable_pin_unlocked() argument
3728 return snd_soc_dapm_set_pin(dapm, pin, 1); in snd_soc_dapm_enable_pin_unlocked()
3743 int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin) in snd_soc_dapm_enable_pin() argument
3747 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_enable_pin()
3749 ret = snd_soc_dapm_set_pin(dapm, pin, 1); in snd_soc_dapm_enable_pin()
3751 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_enable_pin()
3771 int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_force_enable_pin_unlocked() argument
3774 struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); in snd_soc_dapm_force_enable_pin_unlocked()
3777 dev_err(dapm->dev, "ASoC: unknown pin %s\n", pin); in snd_soc_dapm_force_enable_pin_unlocked()
3781 dev_dbg(w->dapm->dev, "ASoC: force enable pin %s\n", pin); in snd_soc_dapm_force_enable_pin_unlocked()
3810 int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_force_enable_pin() argument
3815 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_force_enable_pin()
3817 ret = snd_soc_dapm_force_enable_pin_unlocked(dapm, pin); in snd_soc_dapm_force_enable_pin()
3819 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_force_enable_pin()
3837 int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_disable_pin_unlocked() argument
3840 return snd_soc_dapm_set_pin(dapm, pin, 0); in snd_soc_dapm_disable_pin_unlocked()
3854 int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_disable_pin() argument
3859 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_disable_pin()
3861 ret = snd_soc_dapm_set_pin(dapm, pin, 0); in snd_soc_dapm_disable_pin()
3863 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_disable_pin()
3885 int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_nc_pin_unlocked() argument
3888 return snd_soc_dapm_set_pin(dapm, pin, 0); in snd_soc_dapm_nc_pin_unlocked()
3906 int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin) in snd_soc_dapm_nc_pin() argument
3910 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_nc_pin()
3912 ret = snd_soc_dapm_set_pin(dapm, pin, 0); in snd_soc_dapm_nc_pin()
3914 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_nc_pin()
3929 int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_get_pin_status() argument
3932 struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); in snd_soc_dapm_get_pin_status()
3952 int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, in snd_soc_dapm_ignore_suspend() argument
3955 struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, false); in snd_soc_dapm_ignore_suspend()
3958 dev_err(dapm->dev, "ASoC: unknown pin %s\n", pin); in snd_soc_dapm_ignore_suspend()
3974 void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm) in snd_soc_dapm_free() argument
3976 dapm_debugfs_cleanup(dapm); in snd_soc_dapm_free()
3977 dapm_free_widgets(dapm); in snd_soc_dapm_free()
3978 list_del(&dapm->list); in snd_soc_dapm_free()
3982 static void soc_dapm_shutdown_dapm(struct snd_soc_dapm_context *dapm) in soc_dapm_shutdown_dapm() argument
3984 struct snd_soc_card *card = dapm->card; in soc_dapm_shutdown_dapm()
3991 list_for_each_entry(w, &dapm->card->widgets, list) { in soc_dapm_shutdown_dapm()
3992 if (w->dapm != dapm) in soc_dapm_shutdown_dapm()
4005 if (dapm->bias_level == SND_SOC_BIAS_ON) in soc_dapm_shutdown_dapm()
4006 snd_soc_dapm_set_bias_level(dapm, in soc_dapm_shutdown_dapm()
4009 if (dapm->bias_level == SND_SOC_BIAS_PREPARE) in soc_dapm_shutdown_dapm()
4010 snd_soc_dapm_set_bias_level(dapm, in soc_dapm_shutdown_dapm()
4022 struct snd_soc_dapm_context *dapm; in snd_soc_dapm_shutdown() local
4024 list_for_each_entry(dapm, &card->dapm_list, list) { in snd_soc_dapm_shutdown()
4025 if (dapm != &card->dapm) { in snd_soc_dapm_shutdown()
4026 soc_dapm_shutdown_dapm(dapm); in snd_soc_dapm_shutdown()
4027 if (dapm->bias_level == SND_SOC_BIAS_STANDBY) in snd_soc_dapm_shutdown()
4028 snd_soc_dapm_set_bias_level(dapm, in snd_soc_dapm_shutdown()
4033 soc_dapm_shutdown_dapm(&card->dapm); in snd_soc_dapm_shutdown()
4034 if (card->dapm.bias_level == SND_SOC_BIAS_STANDBY) in snd_soc_dapm_shutdown()
4035 snd_soc_dapm_set_bias_level(&card->dapm, in snd_soc_dapm_shutdown()