Lines Matching refs:card
48 #define DAPM_UPDATE_STAT(widget, val) widget->dapm->card->dapm_stats.val++;
116 if (dapm->card && dapm->card->instantiated) in dapm_assert_locked()
117 lockdep_assert_held(&dapm->card->dapm_mutex); in dapm_assert_locked()
158 list_add_tail(&w->dirty, &w->dapm->card->dapm_dirty); in dapm_mark_dirty()
272 void dapm_mark_endpoints_dirty(struct snd_soc_card *card) in dapm_mark_endpoints_dirty() argument
276 mutex_lock(&card->dapm_mutex); in dapm_mark_endpoints_dirty()
278 list_for_each_entry(w, &card->widgets, list) { in dapm_mark_endpoints_dirty()
288 mutex_unlock(&card->dapm_mutex); in dapm_mark_endpoints_dirty()
476 static void dapm_reset(struct snd_soc_card *card) in dapm_reset() argument
480 lockdep_assert_held(&card->dapm_mutex); in dapm_reset()
482 memset(&card->dapm_stats, 0, sizeof(card->dapm_stats)); in dapm_reset()
484 list_for_each_entry(w, &card->widgets, list) { in dapm_reset()
540 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_set_bias_level() local
543 trace_snd_soc_bias_level_start(card, level); in snd_soc_dapm_set_bias_level()
545 if (card && card->set_bias_level) in snd_soc_dapm_set_bias_level()
546 ret = card->set_bias_level(card, dapm, level); in snd_soc_dapm_set_bias_level()
552 else if (!card || dapm != &card->dapm) in snd_soc_dapm_set_bias_level()
558 if (card && card->set_bias_level_post) in snd_soc_dapm_set_bias_level()
559 ret = card->set_bias_level_post(card, dapm, level); in snd_soc_dapm_set_bias_level()
561 trace_snd_soc_bias_level_done(card, level); in snd_soc_dapm_set_bias_level()
653 list_for_each_entry(w, &dapm->card->widgets, list) { in dapm_is_shared_kcontrol()
676 struct snd_card *card = dapm->card->snd_card; in dapm_create_or_share_mixmux_kcontrol() local
756 ret = snd_ctl_add(card, kcontrol); in dapm_create_or_share_mixmux_kcontrol()
852 struct snd_card *card = dapm->card->snd_card; in dapm_new_dai_link() local
862 ret = snd_ctl_add(card, kcontrol); in dapm_new_dai_link()
882 int level = snd_power_get_state(widget->dapm->card->snd_card); in snd_soc_dapm_suspend_check()
1066 struct snd_soc_card *card = dai->component->card; in snd_soc_dapm_dai_get_connected_widgets() local
1070 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_dai_get_connected_widgets()
1076 list_for_each_entry(w, &card->widgets, list) { in snd_soc_dapm_dai_get_connected_widgets()
1087 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_dai_get_connected_widgets()
1250 static void dapm_seq_check_event(struct snd_soc_card *card, in dapm_seq_check_event() argument
1290 pop_dbg(w->dapm->dev, card->pop_time, "pop test : %s %s\n", in dapm_seq_check_event()
1303 static void dapm_seq_run_coalesced(struct snd_soc_card *card, in dapm_seq_run_coalesced() argument
1326 pop_dbg(dapm->dev, card->pop_time, in dapm_seq_run_coalesced()
1331 dapm_seq_check_event(card, w, SND_SOC_DAPM_PRE_PMU); in dapm_seq_run_coalesced()
1332 dapm_seq_check_event(card, w, SND_SOC_DAPM_PRE_PMD); in dapm_seq_run_coalesced()
1340 pop_dbg(dapm->dev, card->pop_time, in dapm_seq_run_coalesced()
1342 value, mask, reg, card->pop_time); in dapm_seq_run_coalesced()
1343 pop_wait(card->pop_time); in dapm_seq_run_coalesced()
1348 dapm_seq_check_event(card, w, SND_SOC_DAPM_POST_PMU); in dapm_seq_run_coalesced()
1349 dapm_seq_check_event(card, w, SND_SOC_DAPM_POST_PMD); in dapm_seq_run_coalesced()
1361 static void dapm_seq_run(struct snd_soc_card *card, in dapm_seq_run() argument
1386 dapm_seq_run_coalesced(card, &pending); in dapm_seq_run()
1449 dapm_seq_run_coalesced(card, &pending); in dapm_seq_run()
1458 list_for_each_entry(d, &card->dapm_list, list) { in dapm_seq_run()
1463 static void dapm_widget_update(struct snd_soc_card *card) in dapm_widget_update() argument
1465 struct snd_soc_dapm_update *update = card->update; in dapm_widget_update()
1652 switch (snd_power_get_state(dapm->card->snd_card)) { in dapm_idle_bias_off()
1672 static int dapm_power_widgets(struct snd_soc_card *card, int event) in dapm_power_widgets() argument
1681 lockdep_assert_held(&card->dapm_mutex); in dapm_power_widgets()
1683 trace_snd_soc_dapm_start(card); in dapm_power_widgets()
1685 list_for_each_entry(d, &card->dapm_list, list) { in dapm_power_widgets()
1692 dapm_reset(card); in dapm_power_widgets()
1700 list_for_each_entry(w, &card->dapm_dirty, dirty) { in dapm_power_widgets()
1704 list_for_each_entry(w, &card->widgets, list) { in dapm_power_widgets()
1748 list_for_each_entry(d, &card->dapm_list, list) in dapm_power_widgets()
1751 list_for_each_entry(d, &card->dapm_list, list) in dapm_power_widgets()
1755 trace_snd_soc_dapm_walk_done(card); in dapm_power_widgets()
1758 dapm_pre_sequence_async(&card->dapm, 0); in dapm_power_widgets()
1760 list_for_each_entry(d, &card->dapm_list, list) { in dapm_power_widgets()
1761 if (d != &card->dapm) in dapm_power_widgets()
1768 dapm_seq_check_event(card, w, SND_SOC_DAPM_WILL_PMD); in dapm_power_widgets()
1772 dapm_seq_check_event(card, w, SND_SOC_DAPM_WILL_PMU); in dapm_power_widgets()
1776 dapm_seq_run(card, &down_list, event, false); in dapm_power_widgets()
1778 dapm_widget_update(card); in dapm_power_widgets()
1781 dapm_seq_run(card, &up_list, event, true); in dapm_power_widgets()
1784 list_for_each_entry(d, &card->dapm_list, list) { 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()
1794 list_for_each_entry(d, &card->dapm_list, list) { in dapm_power_widgets()
1799 pop_dbg(card->dev, card->pop_time, in dapm_power_widgets()
1800 "DAPM sequencing finished, waiting %dms\n", card->pop_time); in dapm_power_widgets()
1801 pop_wait(card->pop_time); in dapm_power_widgets()
1803 trace_snd_soc_dapm_done(card); in dapm_power_widgets()
1814 struct snd_soc_card *card = w->dapm->card; in dapm_widget_power_read_file() local
1824 mutex_lock(&card->dapm_mutex); in dapm_widget_power_read_file()
1872 mutex_unlock(&card->dapm_mutex); in dapm_widget_power_read_file()
2003 static int soc_dapm_mux_update_power(struct snd_soc_card *card, in soc_dapm_mux_update_power() argument
2010 lockdep_assert_held(&card->dapm_mutex); in soc_dapm_mux_update_power()
2025 dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP); in soc_dapm_mux_update_power()
2034 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_mux_update_power() local
2037 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_mux_update_power()
2038 card->update = update; in snd_soc_dapm_mux_update_power()
2039 ret = soc_dapm_mux_update_power(card, kcontrol, mux, e); in snd_soc_dapm_mux_update_power()
2040 card->update = NULL; in snd_soc_dapm_mux_update_power()
2041 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_mux_update_power()
2043 soc_dpcm_runtime_update(card); in snd_soc_dapm_mux_update_power()
2049 static int soc_dapm_mixer_update_power(struct snd_soc_card *card, in soc_dapm_mixer_update_power() argument
2055 lockdep_assert_held(&card->dapm_mutex); in soc_dapm_mixer_update_power()
2064 dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP); in soc_dapm_mixer_update_power()
2073 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_mixer_update_power() local
2076 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_mixer_update_power()
2077 card->update = update; in snd_soc_dapm_mixer_update_power()
2078 ret = soc_dapm_mixer_update_power(card, kcontrol, connect); in snd_soc_dapm_mixer_update_power()
2079 card->update = NULL; in snd_soc_dapm_mixer_update_power()
2080 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_mixer_update_power()
2082 soc_dpcm_runtime_update(card); in snd_soc_dapm_mixer_update_power()
2093 list_for_each_entry(w, &codec->component.card->widgets, list) { in dapm_widget_show_codec()
2148 mutex_lock(&rtd->card->dapm_mutex); in dapm_widget_show()
2155 mutex_unlock(&rtd->card->dapm_mutex); in dapm_widget_show()
2182 list_for_each_entry_safe(w, next_w, &dapm->card->widgets, list) { in dapm_free_widgets()
2210 list_for_each_entry(w, &dapm->card->widgets, list) { in dapm_find_widget()
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()
2287 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); 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()
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()
2467 list_for_each_entry(w, &dapm->card->widgets, list) { in snd_soc_dapm_add_route()
2540 list_for_each_entry(p, &dapm->card->paths, list) { in snd_soc_dapm_del_route()
2589 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_add_routes()
2601 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_add_routes()
2620 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_del_routes()
2625 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_del_routes()
2698 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_weak_routes()
2705 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_weak_routes()
2719 int snd_soc_dapm_new_widgets(struct snd_soc_card *card) in snd_soc_dapm_new_widgets() argument
2724 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_new_widgets()
2726 list_for_each_entry(w, &card->widgets, list) in snd_soc_dapm_new_widgets()
2736 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_new_widgets()
2776 dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP); in snd_soc_dapm_new_widgets()
2777 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_new_widgets()
2795 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_get_volsw() local
2811 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_get_volsw()
2818 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_get_volsw()
2842 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_put_volsw() local
2866 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_put_volsw()
2883 card->update = &update; in snd_soc_dapm_put_volsw()
2887 ret = soc_dapm_mixer_update_power(card, kcontrol, connect); in snd_soc_dapm_put_volsw()
2889 card->update = NULL; in snd_soc_dapm_put_volsw()
2892 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_put_volsw()
2895 soc_dpcm_runtime_update(card); in snd_soc_dapm_put_volsw()
2950 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_put_enum_double() local
2970 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_put_enum_double()
2983 card->update = &update; in snd_soc_dapm_put_enum_double()
2986 ret = soc_dapm_mux_update_power(card, kcontrol, item[0], e); in snd_soc_dapm_put_enum_double()
2988 card->update = NULL; in snd_soc_dapm_put_enum_double()
2991 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_put_enum_double()
2994 soc_dpcm_runtime_update(card); in snd_soc_dapm_put_enum_double()
3029 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); in snd_soc_dapm_get_pin_switch() local
3032 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_get_pin_switch()
3035 snd_soc_dapm_get_pin_status(&card->dapm, pin); in snd_soc_dapm_get_pin_switch()
3037 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_get_pin_switch()
3052 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); in snd_soc_dapm_put_pin_switch() local
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()
3127 if (!dapm->card->fully_routed) in snd_soc_dapm_new_control()
3137 if (!dapm->card->fully_routed) in snd_soc_dapm_new_control()
3180 list_add(&w->list, &dapm->card->widgets); in snd_soc_dapm_new_control()
3208 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_new_controls()
3220 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_new_controls()
3352 int snd_soc_dapm_new_pcm(struct snd_soc_card *card, in snd_soc_dapm_new_pcm() argument
3374 w_param_text = devm_kcalloc(card->dev, num_params, in snd_soc_dapm_new_pcm()
3379 link_name = devm_kasprintf(card->dev, GFP_KERNEL, "%s-%s", in snd_soc_dapm_new_pcm()
3388 dev_warn(card->dapm.dev, in snd_soc_dapm_new_pcm()
3392 devm_kasprintf(card->dev, GFP_KERNEL, in snd_soc_dapm_new_pcm()
3400 w_param_text[count] = devm_kmemdup(card->dev, in snd_soc_dapm_new_pcm()
3424 (unsigned long) devm_kmemdup(card->dev, in snd_soc_dapm_new_pcm()
3428 dev_err(card->dev, "ASoC: Failed to create control for %s widget\n", in snd_soc_dapm_new_pcm()
3436 devm_kmemdup(card->dev, &kcontrol_dai_link[0], in snd_soc_dapm_new_pcm()
3440 dev_err(card->dev, "ASoC: Failed to create control for %s widget\n", in snd_soc_dapm_new_pcm()
3446 dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name); in snd_soc_dapm_new_pcm()
3448 w = snd_soc_dapm_new_control(&card->dapm, &template); in snd_soc_dapm_new_pcm()
3450 dev_err(card->dev, "ASoC: Failed to create %s widget\n", 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()
3465 devm_kfree(card->dev, w); in snd_soc_dapm_new_pcm()
3467 devm_kfree(card->dev, (void *)template.kcontrol_news); in snd_soc_dapm_new_pcm()
3469 devm_kfree(card->dev, (void *)private_value); in snd_soc_dapm_new_pcm()
3471 devm_kfree(card->dev, link_name); in snd_soc_dapm_new_pcm()
3474 devm_kfree(card->dev, (void *)w_param_text[count]); in snd_soc_dapm_new_pcm()
3475 devm_kfree(card->dev, w_param_text); in snd_soc_dapm_new_pcm()
3532 int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card) in snd_soc_dapm_link_dai_widgets() argument
3539 list_for_each_entry(dai_w, &card->widgets, list) { in snd_soc_dapm_link_dai_widgets()
3551 list_for_each_entry(w, &card->widgets, list) { in snd_soc_dapm_link_dai_widgets()
3581 static void dapm_connect_dai_link_widgets(struct snd_soc_card *card, in dapm_connect_dai_link_widgets() argument
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()
3659 void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card) in snd_soc_dapm_connect_dai_link_widgets() argument
3661 struct snd_soc_pcm_runtime *rtd = card->rtd; in snd_soc_dapm_connect_dai_link_widgets()
3665 for (i = 0; i < card->num_rtd; i++) { in snd_soc_dapm_connect_dai_link_widgets()
3666 rtd = &card->rtd[i]; in snd_soc_dapm_connect_dai_link_widgets()
3675 dapm_connect_dai_link_widgets(card, rtd); in snd_soc_dapm_connect_dai_link_widgets()
3688 dapm_power_widgets(rtd->card, event); in soc_dapm_stream_event()
3705 struct snd_soc_card *card = rtd->card; in snd_soc_dapm_stream_event() local
3707 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_stream_event()
3709 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_stream_event()
3747 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_enable_pin()
3751 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_enable_pin()
3815 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_force_enable_pin()
3819 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_force_enable_pin()
3859 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_disable_pin()
3863 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_disable_pin()
3910 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_nc_pin()
3914 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_nc_pin()
3984 struct snd_soc_card *card = dapm->card; in soc_dapm_shutdown_dapm() local
3989 mutex_lock(&card->dapm_mutex); in soc_dapm_shutdown_dapm()
3991 list_for_each_entry(w, &dapm->card->widgets, list) { in soc_dapm_shutdown_dapm()
4008 dapm_seq_run(card, &down_list, 0, false); in soc_dapm_shutdown_dapm()
4014 mutex_unlock(&card->dapm_mutex); in soc_dapm_shutdown_dapm()
4020 void snd_soc_dapm_shutdown(struct snd_soc_card *card) in snd_soc_dapm_shutdown() argument
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()
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()