Lines Matching defs:card

42 #define DAPM_UPDATE_STAT(widget, val) widget->dapm->card->dapm_stats.val++;
152 if (dapm->card && dapm->card->instantiated)
153 lockdep_assert_held(&dapm->card->dapm_mutex);
195 list_add_tail(&w->dirty, &w->dapm->card->dapm_dirty);
301 void dapm_mark_endpoints_dirty(struct snd_soc_card *card)
305 mutex_lock(&card->dapm_mutex);
307 for_each_card_widgets(card, w) {
317 mutex_unlock(&card->dapm_mutex);
603 static void dapm_reset(struct snd_soc_card *card)
607 lockdep_assert_held(&card->dapm_mutex);
609 memset(&card->dapm_stats, 0, sizeof(card->dapm_stats));
611 for_each_card_widgets(card, w) {
663 wlist = &w->dapm->card->widgets;
727 struct snd_soc_card *card = dapm->card;
730 trace_snd_soc_bias_level_start(card, level);
732 ret = snd_soc_card_set_bias_level(card, dapm, level);
736 if (!card || dapm != &card->dapm)
742 ret = snd_soc_card_set_bias_level_post(card, dapm, level);
744 trace_snd_soc_bias_level_done(card, level);
858 for_each_card_widgets(dapm->card, w) {
881 struct snd_card *card = dapm->card->snd_card;
965 ret = snd_ctl_add(card, kcontrol);
1085 struct snd_card *card = dapm->card->snd_card;
1096 ret = snd_ctl_add(card, kcontrol);
1111 * the ALSA card - when we are suspending the ALSA state for the card
1116 int level = snd_power_get_state(widget->dapm->card->snd_card);
1307 struct snd_soc_card *card = dai->component->card;
1313 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
1335 mutex_unlock(&card->dapm_mutex);
1532 static void dapm_seq_check_event(struct snd_soc_card *card,
1572 pop_dbg(w->dapm->dev, card->pop_time, "pop test : %s %s\n",
1585 static void dapm_seq_run_coalesced(struct snd_soc_card *card,
1608 pop_dbg(dapm->dev, card->pop_time,
1613 dapm_seq_check_event(card, w, SND_SOC_DAPM_PRE_PMU);
1614 dapm_seq_check_event(card, w, SND_SOC_DAPM_PRE_PMD);
1622 pop_dbg(dapm->dev, card->pop_time,
1624 value, mask, reg, card->pop_time);
1625 pop_wait(card->pop_time);
1630 dapm_seq_check_event(card, w, SND_SOC_DAPM_POST_PMU);
1631 dapm_seq_check_event(card, w, SND_SOC_DAPM_POST_PMD);
1643 static void dapm_seq_run(struct snd_soc_card *card,
1668 dapm_seq_run_coalesced(card, &pending);
1729 dapm_seq_run_coalesced(card, &pending);
1739 for_each_card_dapms(card, d)
1743 static void dapm_widget_update(struct snd_soc_card *card)
1745 struct snd_soc_dapm_update *update = card->update;
1937 switch (snd_power_get_state(dapm->card->snd_card)) {
1957 static int dapm_power_widgets(struct snd_soc_card *card, int event)
1967 lockdep_assert_held(&card->dapm_mutex);
1969 trace_snd_soc_dapm_start(card);
1971 for_each_card_dapms(card, d) {
1978 dapm_reset(card);
1986 list_for_each_entry(w, &card->dapm_dirty, dirty) {
1990 for_each_card_widgets(card, w) {
2031 /* Force all contexts in the card to the same bias state if
2035 for_each_card_dapms(card, d)
2038 for_each_card_dapms(card, d)
2042 trace_snd_soc_dapm_walk_done(card);
2044 /* Run card bias changes at first */
2045 dapm_pre_sequence_async(&card->dapm, 0);
2047 for_each_card_dapms(card, d) {
2048 if (d != &card->dapm && d->bias_level != d->target_bias_level)
2055 dapm_seq_check_event(card, w, SND_SOC_DAPM_WILL_PMD);
2059 dapm_seq_check_event(card, w, SND_SOC_DAPM_WILL_PMU);
2063 dapm_seq_run(card, &down_list, event, false);
2065 dapm_widget_update(card);
2068 dapm_seq_run(card, &up_list, event, true);
2071 for_each_card_dapms(card, d) {
2072 if (d != &card->dapm && d->bias_level != d->target_bias_level)
2077 /* Run card bias changes at last */
2078 dapm_post_sequence_async(&card->dapm, 0);
2081 for_each_card_dapms(card, d) {
2090 pop_dbg(card->dev, card->pop_time,
2091 "DAPM sequencing finished, waiting %dms\n", card->pop_time);
2092 pop_wait(card->pop_time);
2094 trace_snd_soc_dapm_done(card);
2105 struct snd_soc_card *card = w->dapm->card;
2116 mutex_lock(&card->dapm_mutex);
2160 mutex_unlock(&card->dapm_mutex);
2274 static int soc_dapm_mux_update_power(struct snd_soc_card *card,
2281 lockdep_assert_held(&card->dapm_mutex);
2296 dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP);
2305 struct snd_soc_card *card = dapm->card;
2308 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
2309 card->update = update;
2310 ret = soc_dapm_mux_update_power(card, kcontrol, mux, e);
2311 card->update = NULL;
2312 mutex_unlock(&card->dapm_mutex);
2314 snd_soc_dpcm_runtime_update(card);
2320 static int soc_dapm_mixer_update_power(struct snd_soc_card *card,
2327 lockdep_assert_held(&card->dapm_mutex);
2361 dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP);
2370 struct snd_soc_card *card = dapm->card;
2373 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
2374 card->update = update;
2375 ret = soc_dapm_mixer_update_power(card, kcontrol, connect, -1);
2376 card->update = NULL;
2377 mutex_unlock(&card->dapm_mutex);
2379 snd_soc_dpcm_runtime_update(card);
2392 /* card won't be set for the dummy component, as a spot fix
2396 if (!cmpnt->card)
2399 for_each_card_widgets(cmpnt->card, w) {
2457 mutex_lock(&rtd->card->dapm_mutex);
2465 mutex_unlock(&rtd->card->dapm_mutex);
2520 for_each_card_widgets_safe(dapm->card, w, next_w) {
2546 for_each_card_widgets(dapm->card, w) {
2620 * silly DAPM runs during card startup.
2622 if (!dapm->card || !dapm->card->instantiated)
2625 return dapm_power_widgets(dapm->card, SND_SOC_DAPM_STREAM_NOP);
2642 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
2644 mutex_unlock(&dapm->card->dapm_mutex);
2713 mutex_lock_nested(&rtd->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
2715 mutex_unlock(&rtd->card->dapm_mutex);
2738 /* On a fully routed card an input is never a source */
2739 if (w->dapm->card->fully_routed)
2753 /* On a fully routed card a output is never a sink */
2754 if (w->dapm->card->fully_routed)
2909 list_add(&path->list, &dapm->card->paths);
2918 if (dapm->card->instantiated && path->connect)
2964 for_each_card_widgets(dapm->card, w) {
3057 list_for_each_entry(p, &dapm->card->paths, list) {
3106 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
3118 mutex_unlock(&dapm->card->dapm_mutex);
3137 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
3142 mutex_unlock(&dapm->card->dapm_mutex);
3215 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
3222 mutex_unlock(&dapm->card->dapm_mutex);
3230 * @card: card to be checked for new dapm widgets
3236 int snd_soc_dapm_new_widgets(struct snd_soc_card *card)
3241 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
3243 for_each_card_widgets(card, w)
3253 mutex_unlock(&card->dapm_mutex);
3295 dapm_power_widgets(card, SND_SOC_DAPM_STREAM_NOP);
3296 mutex_unlock(&card->dapm_mutex);
3314 struct snd_soc_card *card = dapm->card;
3325 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
3342 mutex_unlock(&card->dapm_mutex);
3373 struct snd_soc_card *card = dapm->card;
3400 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
3433 card->update = &update;
3436 ret = soc_dapm_mixer_update_power(card, kcontrol, connect,
3439 card->update = NULL;
3442 mutex_unlock(&card->dapm_mutex);
3445 snd_soc_dpcm_runtime_update(card);
3464 struct snd_soc_card *card = dapm->card;
3468 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
3474 mutex_unlock(&card->dapm_mutex);
3501 struct snd_soc_card *card = dapm->card;
3521 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
3534 card->update = &update;
3537 ret = soc_dapm_mux_update_power(card, kcontrol, item[0], e);
3539 card->update = NULL;
3542 mutex_unlock(&card->dapm_mutex);
3545 snd_soc_dpcm_runtime_update(card);
3580 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
3583 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
3586 snd_soc_dapm_get_pin_status(&card->dapm, pin);
3588 mutex_unlock(&card->dapm_mutex);
3603 struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
3607 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
3608 ret = __snd_soc_dapm_set_pin(&card->dapm, pin,
3610 mutex_unlock(&card->dapm_mutex);
3612 snd_soc_dapm_sync(&card->dapm);
3683 if (!dapm->card->fully_routed)
3693 if (!dapm->card->fully_routed)
3749 list_add_tail(&w->list, &dapm->card->widgets);
3785 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
3787 mutex_unlock(&dapm->card->dapm_mutex);
3811 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT);
3820 mutex_unlock(&dapm->card->dapm_mutex);
4064 snd_soc_dapm_free_kcontrol(struct snd_soc_card *card,
4071 devm_kfree(card->dev, (void *)*private_value);
4077 devm_kfree(card->dev, (void *)w_param_text[count]);
4078 devm_kfree(card->dev, w_param_text);
4082 snd_soc_dapm_alloc_kcontrol(struct snd_soc_card *card,
4102 dev_warn(card->dapm.dev,
4106 devm_kasprintf(card->dev, GFP_KERNEL,
4110 w_param_text[count] = devm_kmemdup(card->dev,
4124 (unsigned long) devm_kmemdup(card->dev,
4128 dev_err(card->dev, "ASoC: Failed to create control for %s widget\n",
4134 kcontrol_news = devm_kmemdup(card->dev, &kcontrol_dai_link[0],
4138 dev_err(card->dev, "ASoC: Failed to create control for %s widget\n",
4145 snd_soc_dapm_free_kcontrol(card, private_value, num_params, w_param_text);
4150 snd_soc_dapm_new_dai(struct snd_soc_card *card,
4162 link_name = devm_kasprintf(card->dev, GFP_KERNEL, "%s-%s",
4178 w_param_text = devm_kcalloc(card->dev,
4188 snd_soc_dapm_alloc_kcontrol(card,
4200 dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name);
4202 w = snd_soc_dapm_new_control_unlocked(&card->dapm, &template);
4215 devm_kfree(card->dev, (void *)template.kcontrol_news);
4216 snd_soc_dapm_free_kcontrol(card, &private_value,
4219 devm_kfree(card->dev, link_name);
4269 int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card)
4276 for_each_card_widgets(card, dai_w) {
4287 dev_dbg(card->dev, "dai widget %s has no DAI\n",
4295 for_each_card_widgets(card, w) {
4344 static void dapm_connect_dai_pair(struct snd_soc_card *card,
4368 dai = snd_soc_dapm_new_dai(card, substream, "playback");
4374 dapm_connect_dai_routes(&card->dapm, cpu_dai, playback_cpu,
4386 dai = snd_soc_dapm_new_dai(card, substream, "capture");
4392 dapm_connect_dai_routes(&card->dapm, codec_dai, codec,
4435 void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card)
4442 for_each_card_rtds(card, rtd) {
4452 dapm_connect_dai_pair(card, rtd, codec_dai,
4456 dapm_connect_dai_pair(card, rtd, codec_dai,
4459 dev_err(card->dev,
4474 dapm_power_widgets(rtd->card, event);
4491 struct snd_soc_card *card = rtd->card;
4493 mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
4495 mutex_unlock(&card->dapm_mutex);
4556 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
4560 mutex_unlock(&dapm->card->dapm_mutex);
4624 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
4628 mutex_unlock(&dapm->card->dapm_mutex);
4668 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
4672 mutex_unlock(&dapm->card->dapm_mutex);
4719 mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME);
4723 mutex_unlock(&dapm->card->dapm_mutex);
4792 struct snd_soc_card *card,
4795 dapm->card = card;
4804 dapm->dev = card->dev;
4809 list_add(&dapm->list, &card->dapm_list);
4815 struct snd_soc_card *card = dapm->card;
4820 mutex_lock(&card->dapm_mutex);
4822 for_each_card_widgets(dapm->card, w) {
4839 dapm_seq_run(card, &down_list, 0, false);
4845 mutex_unlock(&card->dapm_mutex);
4851 void snd_soc_dapm_shutdown(struct snd_soc_card *card)
4855 for_each_card_dapms(card, dapm) {
4856 if (dapm != &card->dapm) {
4864 soc_dapm_shutdown_dapm(&card->dapm);
4865 if (card->dapm.bias_level == SND_SOC_BIAS_STANDBY)
4866 snd_soc_dapm_set_bias_level(&card->dapm,