Lines Matching refs:card
48 #define DAPM_UPDATE_STAT(widget, val) widget->dapm->card->dapm_stats.val++;
130 if (dapm->card && dapm->card->instantiated) in dapm_assert_locked()
131 lockdep_assert_held(&dapm->card->dapm_mutex); in dapm_assert_locked()
172 list_add_tail(&w->dirty, &w->dapm->card->dapm_dirty); in dapm_mark_dirty()
278 void dapm_mark_endpoints_dirty(struct snd_soc_card *card) in dapm_mark_endpoints_dirty() argument
282 mutex_lock(&card->dapm_mutex); in dapm_mark_endpoints_dirty()
284 list_for_each_entry(w, &card->widgets, list) { in dapm_mark_endpoints_dirty()
294 mutex_unlock(&card->dapm_mutex); in dapm_mark_endpoints_dirty()
538 static void dapm_reset(struct snd_soc_card *card) in dapm_reset() argument
542 lockdep_assert_held(&card->dapm_mutex); in dapm_reset()
544 memset(&card->dapm_stats, 0, sizeof(card->dapm_stats)); in dapm_reset()
546 list_for_each_entry(w, &card->widgets, list) { in dapm_reset()
599 wlist = &w->dapm->card->widgets; in dapm_wcache_lookup()
663 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_set_bias_level() local
666 trace_snd_soc_bias_level_start(card, level); in snd_soc_dapm_set_bias_level()
668 if (card && card->set_bias_level) 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()
679 if (card && card->set_bias_level_post) in snd_soc_dapm_set_bias_level()
680 ret = card->set_bias_level_post(card, dapm, level); in snd_soc_dapm_set_bias_level()
682 trace_snd_soc_bias_level_done(card, level); in snd_soc_dapm_set_bias_level()
775 list_for_each_entry(w, &dapm->card->widgets, list) { in dapm_is_shared_kcontrol()
798 struct snd_card *card = dapm->card->snd_card; in dapm_create_or_share_kcontrol() local
880 ret = snd_ctl_add(card, kcontrol); in dapm_create_or_share_kcontrol()
1000 struct snd_card *card = dapm->card->snd_card; in dapm_new_dai_link() local
1010 ret = snd_ctl_add(card, kcontrol); in dapm_new_dai_link()
1030 int level = snd_power_get_state(widget->dapm->card->snd_card); in snd_soc_dapm_suspend_check()
1156 struct snd_soc_card *card = dai->component->card; in snd_soc_dapm_dai_get_connected_widgets() local
1162 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_dai_get_connected_widgets()
1168 list_for_each_entry(w, &card->widgets, list) { in snd_soc_dapm_dai_get_connected_widgets()
1186 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_dai_get_connected_widgets()
1349 static void dapm_seq_check_event(struct snd_soc_card *card, in dapm_seq_check_event() argument
1389 pop_dbg(w->dapm->dev, card->pop_time, "pop test : %s %s\n", in dapm_seq_check_event()
1402 static void dapm_seq_run_coalesced(struct snd_soc_card *card, in dapm_seq_run_coalesced() argument
1425 pop_dbg(dapm->dev, card->pop_time, in dapm_seq_run_coalesced()
1430 dapm_seq_check_event(card, w, SND_SOC_DAPM_PRE_PMU); in dapm_seq_run_coalesced()
1431 dapm_seq_check_event(card, w, SND_SOC_DAPM_PRE_PMD); in dapm_seq_run_coalesced()
1439 pop_dbg(dapm->dev, card->pop_time, in dapm_seq_run_coalesced()
1441 value, mask, reg, card->pop_time); in dapm_seq_run_coalesced()
1442 pop_wait(card->pop_time); in dapm_seq_run_coalesced()
1447 dapm_seq_check_event(card, w, SND_SOC_DAPM_POST_PMU); in dapm_seq_run_coalesced()
1448 dapm_seq_check_event(card, w, SND_SOC_DAPM_POST_PMD); in dapm_seq_run_coalesced()
1460 static void dapm_seq_run(struct snd_soc_card *card, in dapm_seq_run() argument
1485 dapm_seq_run_coalesced(card, &pending); in dapm_seq_run()
1548 dapm_seq_run_coalesced(card, &pending); in dapm_seq_run()
1557 list_for_each_entry(d, &card->dapm_list, list) { in dapm_seq_run()
1562 static void dapm_widget_update(struct snd_soc_card *card) in dapm_widget_update() argument
1564 struct snd_soc_dapm_update *update = card->update; in dapm_widget_update()
1751 switch (snd_power_get_state(dapm->card->snd_card)) { in dapm_idle_bias_off()
1771 static int dapm_power_widgets(struct snd_soc_card *card, int event) in dapm_power_widgets() argument
1780 lockdep_assert_held(&card->dapm_mutex); in dapm_power_widgets()
1782 trace_snd_soc_dapm_start(card); in dapm_power_widgets()
1784 list_for_each_entry(d, &card->dapm_list, list) { in dapm_power_widgets()
1791 dapm_reset(card); in dapm_power_widgets()
1799 list_for_each_entry(w, &card->dapm_dirty, dirty) { in dapm_power_widgets()
1803 list_for_each_entry(w, &card->widgets, list) { in dapm_power_widgets()
1847 list_for_each_entry(d, &card->dapm_list, list) in dapm_power_widgets()
1850 list_for_each_entry(d, &card->dapm_list, list) in dapm_power_widgets()
1854 trace_snd_soc_dapm_walk_done(card); in dapm_power_widgets()
1857 dapm_pre_sequence_async(&card->dapm, 0); in dapm_power_widgets()
1859 list_for_each_entry(d, &card->dapm_list, list) { in dapm_power_widgets()
1860 if (d != &card->dapm) in dapm_power_widgets()
1867 dapm_seq_check_event(card, w, SND_SOC_DAPM_WILL_PMD); in dapm_power_widgets()
1871 dapm_seq_check_event(card, w, SND_SOC_DAPM_WILL_PMU); in dapm_power_widgets()
1875 dapm_seq_run(card, &down_list, event, false); in dapm_power_widgets()
1877 dapm_widget_update(card); in dapm_power_widgets()
1880 dapm_seq_run(card, &up_list, event, true); in dapm_power_widgets()
1883 list_for_each_entry(d, &card->dapm_list, list) { 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()
1893 list_for_each_entry(d, &card->dapm_list, list) { in dapm_power_widgets()
1898 pop_dbg(card->dev, card->pop_time, in dapm_power_widgets()
1899 "DAPM sequencing finished, waiting %dms\n", card->pop_time); in dapm_power_widgets()
1900 pop_wait(card->pop_time); in dapm_power_widgets()
1902 trace_snd_soc_dapm_done(card); in dapm_power_widgets()
1913 struct snd_soc_card *card = w->dapm->card; in dapm_widget_power_read_file() local
1924 mutex_lock(&card->dapm_mutex); in dapm_widget_power_read_file()
1968 mutex_unlock(&card->dapm_mutex); in dapm_widget_power_read_file()
2099 static int soc_dapm_mux_update_power(struct snd_soc_card *card, in soc_dapm_mux_update_power() argument
2106 lockdep_assert_held(&card->dapm_mutex); in soc_dapm_mux_update_power()
2121 dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP); in soc_dapm_mux_update_power()
2130 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_mux_update_power() local
2133 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_mux_update_power()
2134 card->update = update; in snd_soc_dapm_mux_update_power()
2135 ret = soc_dapm_mux_update_power(card, kcontrol, mux, e); in snd_soc_dapm_mux_update_power()
2136 card->update = NULL; in snd_soc_dapm_mux_update_power()
2137 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_mux_update_power()
2139 soc_dpcm_runtime_update(card); in snd_soc_dapm_mux_update_power()
2145 static int soc_dapm_mixer_update_power(struct snd_soc_card *card, in soc_dapm_mixer_update_power() argument
2151 lockdep_assert_held(&card->dapm_mutex); in soc_dapm_mixer_update_power()
2160 dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP); in soc_dapm_mixer_update_power()
2169 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_mixer_update_power() local
2172 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_mixer_update_power()
2173 card->update = update; in snd_soc_dapm_mixer_update_power()
2174 ret = soc_dapm_mixer_update_power(card, kcontrol, connect); in snd_soc_dapm_mixer_update_power()
2175 card->update = NULL; in snd_soc_dapm_mixer_update_power()
2176 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_mixer_update_power()
2178 soc_dpcm_runtime_update(card); in snd_soc_dapm_mixer_update_power()
2195 if (!cmpnt->card) in dapm_widget_show_component()
2198 list_for_each_entry(w, &cmpnt->card->widgets, list) { in dapm_widget_show_component()
2253 mutex_lock(&rtd->card->dapm_mutex); in dapm_widget_show()
2261 mutex_unlock(&rtd->card->dapm_mutex); in dapm_widget_show()
2314 list_for_each_entry_safe(w, next_w, &dapm->card->widgets, list) { in dapm_free_widgets()
2329 list_for_each_entry(w, &dapm->card->widgets, list) { in dapm_find_widget()
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()
2406 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); 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()
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()
2654 list_for_each_entry(w, &dapm->card->widgets, list) { in snd_soc_dapm_add_route()
2737 list_for_each_entry(p, &dapm->card->paths, list) { in snd_soc_dapm_del_route()
2786 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_add_routes()
2798 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_add_routes()
2817 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_del_routes()
2822 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_del_routes()
2895 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_weak_routes()
2902 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_weak_routes()
2916 int snd_soc_dapm_new_widgets(struct snd_soc_card *card) in snd_soc_dapm_new_widgets() argument
2921 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_new_widgets()
2923 list_for_each_entry(w, &card->widgets, list) in snd_soc_dapm_new_widgets()
2933 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_new_widgets()
2974 dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP); in snd_soc_dapm_new_widgets()
2975 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_new_widgets()
2993 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_get_volsw() local
3009 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_get_volsw()
3016 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_get_volsw()
3040 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_put_volsw() local
3064 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_put_volsw()
3081 card->update = &update; in snd_soc_dapm_put_volsw()
3085 ret = soc_dapm_mixer_update_power(card, kcontrol, connect); in snd_soc_dapm_put_volsw()
3087 card->update = NULL; in snd_soc_dapm_put_volsw()
3090 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_put_volsw()
3093 soc_dpcm_runtime_update(card); in snd_soc_dapm_put_volsw()
3112 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_get_enum_double() local
3116 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_get_enum_double()
3120 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_get_enum_double()
3126 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_get_enum_double()
3153 struct snd_soc_card *card = dapm->card; in snd_soc_dapm_put_enum_double() local
3173 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_put_enum_double()
3186 card->update = &update; in snd_soc_dapm_put_enum_double()
3190 ret = soc_dapm_mux_update_power(card, kcontrol, item[0], e); in snd_soc_dapm_put_enum_double()
3192 card->update = NULL; in snd_soc_dapm_put_enum_double()
3195 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_put_enum_double()
3198 soc_dpcm_runtime_update(card); in snd_soc_dapm_put_enum_double()
3233 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); in snd_soc_dapm_get_pin_switch() local
3236 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_get_pin_switch()
3239 snd_soc_dapm_get_pin_status(&card->dapm, pin); in snd_soc_dapm_get_pin_switch()
3241 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_get_pin_switch()
3256 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); in snd_soc_dapm_put_pin_switch() local
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()
3275 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_new_control()
3282 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_new_control()
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()
3401 list_add_tail(&w->list, &dapm->card->widgets); in snd_soc_dapm_new_control_unlocked()
3431 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); in snd_soc_dapm_new_controls()
3443 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_new_controls()
3603 int snd_soc_dapm_new_pcm(struct snd_soc_card *card, in snd_soc_dapm_new_pcm() argument
3625 w_param_text = devm_kcalloc(card->dev, num_params, in snd_soc_dapm_new_pcm()
3630 link_name = devm_kasprintf(card->dev, GFP_KERNEL, "%s-%s", in snd_soc_dapm_new_pcm()
3639 dev_warn(card->dapm.dev, in snd_soc_dapm_new_pcm()
3643 devm_kasprintf(card->dev, GFP_KERNEL, in snd_soc_dapm_new_pcm()
3651 w_param_text[count] = devm_kmemdup(card->dev, in snd_soc_dapm_new_pcm()
3675 (unsigned long) devm_kmemdup(card->dev, in snd_soc_dapm_new_pcm()
3679 dev_err(card->dev, "ASoC: Failed to create control for %s widget\n", in snd_soc_dapm_new_pcm()
3687 devm_kmemdup(card->dev, &kcontrol_dai_link[0], in snd_soc_dapm_new_pcm()
3691 dev_err(card->dev, "ASoC: Failed to create control for %s widget\n", in snd_soc_dapm_new_pcm()
3697 dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name); in snd_soc_dapm_new_pcm()
3699 w = snd_soc_dapm_new_control_unlocked(&card->dapm, &template); in snd_soc_dapm_new_pcm()
3701 dev_err(card->dev, "ASoC: Failed to create %s widget\n", 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()
3716 devm_kfree(card->dev, w); in snd_soc_dapm_new_pcm()
3718 devm_kfree(card->dev, (void *)template.kcontrol_news); in snd_soc_dapm_new_pcm()
3720 devm_kfree(card->dev, (void *)private_value); in snd_soc_dapm_new_pcm()
3722 devm_kfree(card->dev, link_name); in snd_soc_dapm_new_pcm()
3725 devm_kfree(card->dev, (void *)w_param_text[count]); in snd_soc_dapm_new_pcm()
3726 devm_kfree(card->dev, w_param_text); in snd_soc_dapm_new_pcm()
3783 int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card) in snd_soc_dapm_link_dai_widgets() argument
3790 list_for_each_entry(dai_w, &card->widgets, list) { in snd_soc_dapm_link_dai_widgets()
3802 list_for_each_entry(w, &card->widgets, list) { in snd_soc_dapm_link_dai_widgets()
3832 static void dapm_connect_dai_link_widgets(struct snd_soc_card *card, in dapm_connect_dai_link_widgets() argument
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()
3908 void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card) in snd_soc_dapm_connect_dai_link_widgets() argument
3910 struct snd_soc_pcm_runtime *rtd = card->rtd; in snd_soc_dapm_connect_dai_link_widgets()
3914 for (i = 0; i < card->num_rtd; i++) { in snd_soc_dapm_connect_dai_link_widgets()
3915 rtd = &card->rtd[i]; in snd_soc_dapm_connect_dai_link_widgets()
3924 dapm_connect_dai_link_widgets(card, rtd); in snd_soc_dapm_connect_dai_link_widgets()
3937 dapm_power_widgets(rtd->card, event); in soc_dapm_stream_event()
3954 struct snd_soc_card *card = rtd->card; in snd_soc_dapm_stream_event() local
3956 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_stream_event()
3958 mutex_unlock(&card->dapm_mutex); in snd_soc_dapm_stream_event()
3996 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_enable_pin()
4000 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_enable_pin()
4064 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_force_enable_pin()
4068 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_force_enable_pin()
4108 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_disable_pin()
4112 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_disable_pin()
4159 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); in snd_soc_dapm_nc_pin()
4163 mutex_unlock(&dapm->card->dapm_mutex); in snd_soc_dapm_nc_pin()
4233 struct snd_soc_card *card = dapm->card; in soc_dapm_shutdown_dapm() local
4238 mutex_lock(&card->dapm_mutex); in soc_dapm_shutdown_dapm()
4240 list_for_each_entry(w, &dapm->card->widgets, list) { in soc_dapm_shutdown_dapm()
4257 dapm_seq_run(card, &down_list, 0, false); in soc_dapm_shutdown_dapm()
4263 mutex_unlock(&card->dapm_mutex); in soc_dapm_shutdown_dapm()
4269 void snd_soc_dapm_shutdown(struct snd_soc_card *card) in snd_soc_dapm_shutdown() argument
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()
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()