Lines Matching refs:be

179 		struct snd_soc_pcm_runtime *be = dpcm->be;  in dpcm_dapm_stream_event()  local
181 dev_dbg(be->dev, "ASoC: BE %s event %d dir %d\n", in dpcm_dapm_stream_event()
182 be->dai_link->name, event, dir); in dpcm_dapm_stream_event()
184 snd_soc_dapm_stream_event(be, dir, event); in dpcm_dapm_stream_event()
1121 struct snd_soc_pcm_runtime *be, int stream) in dpcm_be_connect() argument
1127 if (dpcm->be == be && dpcm->fe == fe) in dpcm_be_connect()
1135 dpcm->be = be; in dpcm_be_connect()
1137 be->dpcm[stream].runtime = fe->dpcm[stream].runtime; in dpcm_be_connect()
1140 list_add(&dpcm->list_fe, &be->dpcm[stream].fe_clients); in dpcm_be_connect()
1144 stream ? "<-" : "->", be->dai_link->name); in dpcm_be_connect()
1148 dpcm->debugfs_state = debugfs_create_u32(be->dai_link->name, 0644, in dpcm_be_connect()
1156 struct snd_soc_pcm_runtime *be, int stream) in dpcm_be_reparent() argument
1162 if (!be->dpcm[stream].users) in dpcm_be_reparent()
1165 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_reparent()
1167 list_for_each_entry(dpcm, &be->dpcm[stream].fe_clients, list_fe) { in dpcm_be_reparent()
1174 stream ? "<-" : "->", dpcm->be->dai_link->name); in dpcm_be_reparent()
1190 dpcm->be->dai_link->name); in dpcm_be_disconnect()
1197 stream ? "<-" : "->", dpcm->be->dai_link->name); in dpcm_be_disconnect()
1200 dpcm_be_reparent(fe, dpcm->be, stream); in dpcm_be_disconnect()
1215 struct snd_soc_pcm_runtime *be; in dpcm_get_be() local
1220 be = &card->rtd[i]; in dpcm_get_be()
1222 if (!be->dai_link->no_pcm) in dpcm_get_be()
1225 if (be->cpu_dai->playback_widget == widget) in dpcm_get_be()
1226 return be; in dpcm_get_be()
1228 for (j = 0; j < be->num_codecs; j++) { in dpcm_get_be()
1229 struct snd_soc_dai *dai = be->codec_dais[j]; in dpcm_get_be()
1231 return be; in dpcm_get_be()
1237 be = &card->rtd[i]; in dpcm_get_be()
1239 if (!be->dai_link->no_pcm) in dpcm_get_be()
1242 if (be->cpu_dai->capture_widget == widget) in dpcm_get_be()
1243 return be; in dpcm_get_be()
1245 for (j = 0; j < be->num_codecs; j++) { in dpcm_get_be()
1246 struct snd_soc_dai *dai = be->codec_dais[j]; in dpcm_get_be()
1248 return be; in dpcm_get_be()
1308 widget = dai_get_widget(dpcm->be->cpu_dai, stream); in dpcm_prune_paths()
1315 for (i = 0; i < dpcm->be->num_codecs; i++) { in dpcm_prune_paths()
1316 struct snd_soc_dai *dai = dpcm->be->codec_dais[i]; in dpcm_prune_paths()
1326 dpcm->be->dai_link->name, fe->dai_link->name); in dpcm_prune_paths()
1328 dpcm->be->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE; in dpcm_prune_paths()
1341 struct snd_soc_pcm_runtime *be; in dpcm_add_paths() local
1361 be = dpcm_get_be(card, list->widgets[i], stream); in dpcm_add_paths()
1362 if (!be) { in dpcm_add_paths()
1369 if (!be->dai_link->no_pcm) in dpcm_add_paths()
1377 err = dpcm_be_connect(fe, be, stream); in dpcm_add_paths()
1386 be->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE; in dpcm_add_paths()
1412 dpcm->be->dpcm[stream].runtime_update = in dpcm_clear_pending_state()
1424 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_startup_unwind() local
1426 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_startup_unwind()
1428 if (be->dpcm[stream].users == 0) in dpcm_be_dai_startup_unwind()
1429 dev_err(be->dev, "ASoC: no users %s at close - state %d\n", in dpcm_be_dai_startup_unwind()
1431 be->dpcm[stream].state); in dpcm_be_dai_startup_unwind()
1433 if (--be->dpcm[stream].users != 0) in dpcm_be_dai_startup_unwind()
1436 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) in dpcm_be_dai_startup_unwind()
1441 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_startup_unwind()
1453 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_startup() local
1455 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_startup()
1458 dev_err(be->dev, "ASoC: no backend %s stream\n", in dpcm_be_dai_startup()
1464 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_startup()
1468 if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) in dpcm_be_dai_startup()
1469 dev_err(be->dev, "ASoC: too many users %s at open %d\n", in dpcm_be_dai_startup()
1471 be->dpcm[stream].state); in dpcm_be_dai_startup()
1473 if (be->dpcm[stream].users++ != 0) in dpcm_be_dai_startup()
1476 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_NEW) && in dpcm_be_dai_startup()
1477 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) in dpcm_be_dai_startup()
1480 dev_dbg(be->dev, "ASoC: open %s BE %s\n", in dpcm_be_dai_startup()
1481 stream ? "capture" : "playback", be->dai_link->name); in dpcm_be_dai_startup()
1483 be_substream->runtime = be->dpcm[stream].runtime; in dpcm_be_dai_startup()
1486 dev_err(be->dev, "ASoC: BE open failed %d\n", err); in dpcm_be_dai_startup()
1487 be->dpcm[stream].users--; in dpcm_be_dai_startup()
1488 if (be->dpcm[stream].users < 0) in dpcm_be_dai_startup()
1489 dev_err(be->dev, "ASoC: no users %s at unwind %d\n", in dpcm_be_dai_startup()
1491 be->dpcm[stream].state); in dpcm_be_dai_startup()
1493 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_startup()
1497 be->dpcm[stream].state = SND_SOC_DPCM_STATE_OPEN; in dpcm_be_dai_startup()
1506 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_startup() local
1508 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_startup()
1510 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_startup()
1513 if (be->dpcm[stream].users == 0) in dpcm_be_dai_startup()
1514 dev_err(be->dev, "ASoC: no users %s at close %d\n", in dpcm_be_dai_startup()
1516 be->dpcm[stream].state); in dpcm_be_dai_startup()
1518 if (--be->dpcm[stream].users != 0) in dpcm_be_dai_startup()
1521 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) in dpcm_be_dai_startup()
1526 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_startup()
1563 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_runtime_base_format() local
1568 for (i = 0; i < be->num_codecs; i++) { in dpcm_runtime_base_format()
1569 codec_dai_drv = be->codec_dais[i]->driver; in dpcm_runtime_base_format()
1664 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_shutdown() local
1666 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_shutdown()
1669 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_shutdown()
1672 if (be->dpcm[stream].users == 0) in dpcm_be_dai_shutdown()
1673 dev_err(be->dev, "ASoC: no users %s at close - state %d\n", in dpcm_be_dai_shutdown()
1675 be->dpcm[stream].state); in dpcm_be_dai_shutdown()
1677 if (--be->dpcm[stream].users != 0) in dpcm_be_dai_shutdown()
1680 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_shutdown()
1681 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN)) in dpcm_be_dai_shutdown()
1684 dev_dbg(be->dev, "ASoC: close BE %s\n", in dpcm_be_dai_shutdown()
1690 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_shutdown()
1726 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_hw_free() local
1728 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_free()
1731 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_free()
1735 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_hw_free()
1739 if (be->dpcm[stream].users > 1) in dpcm_be_dai_hw_free()
1742 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_free()
1743 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && in dpcm_be_dai_hw_free()
1744 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_hw_free()
1745 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED) && in dpcm_be_dai_hw_free()
1746 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_hw_free()
1747 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) in dpcm_be_dai_hw_free()
1750 dev_dbg(be->dev, "ASoC: hw_free BE %s\n", in dpcm_be_dai_hw_free()
1755 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; in dpcm_be_dai_hw_free()
1795 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_hw_params() local
1797 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_params()
1800 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_params()
1804 if (!snd_soc_dpcm_can_be_params(fe, be, stream)) in dpcm_be_dai_hw_params()
1807 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_be_dai_hw_params()
1808 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_params()
1809 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE)) in dpcm_be_dai_hw_params()
1812 dev_dbg(be->dev, "ASoC: hw_params BE %s\n", in dpcm_be_dai_hw_params()
1820 if (be->dai_link->be_hw_params_fixup) { in dpcm_be_dai_hw_params()
1821 ret = be->dai_link->be_hw_params_fixup(be, in dpcm_be_dai_hw_params()
1824 dev_err(be->dev, in dpcm_be_dai_hw_params()
1833 dev_err(dpcm->be->dev, in dpcm_be_dai_hw_params()
1838 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_PARAMS; in dpcm_be_dai_hw_params()
1845 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_hw_params() local
1847 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_params()
1849 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_params()
1853 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_hw_params()
1856 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_be_dai_hw_params()
1857 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_params()
1858 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_hw_params()
1859 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) in dpcm_be_dai_hw_params()
1908 dev_dbg(dpcm->be->dev, "ASoC: trigger BE %s cmd %d\n", in dpcm_do_trigger()
1913 dev_err(dpcm->be->dev,"ASoC: trigger BE failed %d\n", ret); in dpcm_do_trigger()
1926 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_trigger() local
1928 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_trigger()
1931 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_trigger()
1936 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && in dpcm_be_dai_trigger()
1937 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) in dpcm_be_dai_trigger()
1944 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
1947 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) in dpcm_be_dai_trigger()
1954 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
1957 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
1964 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
1967 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
1970 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_trigger()
1977 be->dpcm[stream].state = SND_SOC_DPCM_STATE_STOP; in dpcm_be_dai_trigger()
1980 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
1983 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_trigger()
1990 be->dpcm[stream].state = SND_SOC_DPCM_STATE_SUSPEND; in dpcm_be_dai_trigger()
1993 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
1996 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_trigger()
2003 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PAUSED; in dpcm_be_dai_trigger()
2110 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_prepare() local
2112 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_prepare()
2115 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_prepare()
2118 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_prepare()
2119 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) in dpcm_be_dai_prepare()
2122 dev_dbg(be->dev, "ASoC: prepare BE %s\n", in dpcm_be_dai_prepare()
2127 dev_err(be->dev, "ASoC: backend prepare failed %d\n", in dpcm_be_dai_prepare()
2132 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PREPARE; in dpcm_be_dai_prepare()
2308 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_run_update_startup() local
2309 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_run_update_startup()
2450 struct snd_soc_pcm_runtime *be = dpcm->be; in soc_dpcm_be_digital_mute() local
2453 if (be->dai_link->ignore_suspend) in soc_dpcm_be_digital_mute()
2456 for (i = 0; i < be->num_codecs; i++) { in soc_dpcm_be_digital_mute()
2457 struct snd_soc_dai *dai = be->codec_dais[i]; in soc_dpcm_be_digital_mute()
2460 dev_dbg(be->dev, "ASoC: BE digital mute %s\n", in soc_dpcm_be_digital_mute()
2461 be->dai_link->name); in soc_dpcm_be_digital_mute()
2674 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_be_can_update() argument
2678 be->dpcm[stream].runtime_update)) in snd_soc_dpcm_be_can_update()
2686 snd_soc_dpcm_get_substream(struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_get_substream() argument
2688 return be->pcm->streams[stream].substream; in snd_soc_dpcm_get_substream()
2694 snd_soc_dpcm_be_get_state(struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_be_get_state() argument
2696 return be->dpcm[stream].state; in snd_soc_dpcm_be_get_state()
2701 void snd_soc_dpcm_be_set_state(struct snd_soc_pcm_runtime *be, in snd_soc_dpcm_be_set_state() argument
2704 be->dpcm[stream].state = state; in snd_soc_dpcm_be_set_state()
2713 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_free_stop() argument
2718 list_for_each_entry(dpcm, &be->dpcm[stream].fe_clients, list_fe) { in snd_soc_dpcm_can_be_free_stop()
2740 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_params() argument
2745 list_for_each_entry(dpcm, &be->dpcm[stream].fe_clients, list_fe) { in snd_soc_dpcm_can_be_params()
2835 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_show_state() local
2839 "- %s\n", be->dai_link->name); in dpcm_show_state()
2843 dpcm_state_string(be->dpcm[stream].state)); in dpcm_show_state()
2845 if ((be->dpcm[stream].state >= SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_show_state()
2846 (be->dpcm[stream].state <= SND_SOC_DPCM_STATE_STOP)) in dpcm_show_state()