Lines Matching refs:be
97 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_show_state() local
101 "- %s\n", be->dai_link->name); in dpcm_show_state()
105 dpcm_state_string(be->dpcm[stream].state)); in dpcm_show_state()
107 if ((be->dpcm[stream].state >= SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_show_state()
108 (be->dpcm[stream].state <= SND_SOC_DPCM_STATE_STOP)) in dpcm_show_state()
179 name = kasprintf(GFP_KERNEL, "%s:%s", dpcm->be->dai_link->name, in dpcm_create_debugfs_state()
287 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_dapm_stream_event() local
289 dev_dbg(be->dev, "ASoC: BE %s event %d dir %d\n", in dpcm_dapm_stream_event()
290 be->dai_link->name, event, dir); in dpcm_dapm_stream_event()
293 (be->dpcm[dir].users >= 1)) in dpcm_dapm_stream_event()
296 snd_soc_dapm_stream_event(be, dir, event); in dpcm_dapm_stream_event()
1117 struct snd_soc_pcm_runtime *be, int stream) in dpcm_be_connect() argument
1124 if (dpcm->be == be && dpcm->fe == fe) in dpcm_be_connect()
1132 dpcm->be = be; in dpcm_be_connect()
1134 be->dpcm[stream].runtime = fe->dpcm[stream].runtime; in dpcm_be_connect()
1138 list_add(&dpcm->list_fe, &be->dpcm[stream].fe_clients); in dpcm_be_connect()
1143 stream ? "<-" : "->", be->dai_link->name); in dpcm_be_connect()
1152 struct snd_soc_pcm_runtime *be, int stream) in dpcm_be_reparent() argument
1158 if (!be->dpcm[stream].users) in dpcm_be_reparent()
1161 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_reparent()
1163 for_each_dpcm_fe(be, stream, dpcm) { in dpcm_be_reparent()
1170 stream ? "<-" : "->", dpcm->be->dai_link->name); in dpcm_be_reparent()
1187 dpcm->be->dai_link->name); in dpcm_be_disconnect()
1194 stream ? "<-" : "->", dpcm->be->dai_link->name); in dpcm_be_disconnect()
1197 dpcm_be_reparent(fe, dpcm->be, stream); in dpcm_be_disconnect()
1213 struct snd_soc_pcm_runtime *be; in dpcm_get_be() local
1220 for_each_card_rtds(card, be) { in dpcm_get_be()
1222 if (!be->dai_link->no_pcm) in dpcm_get_be()
1225 for_each_rtd_dais(be, i, dai) { in dpcm_get_be()
1232 return be; in dpcm_get_be()
1308 for_each_rtd_dais(dpcm->be, i, dai) { in dpcm_be_is_active()
1335 dpcm->be->dai_link->name, fe->dai_link->name); in dpcm_prune_paths()
1337 dpcm->be->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE; in dpcm_prune_paths()
1350 struct snd_soc_pcm_runtime *be; in dpcm_add_paths() local
1371 be = dpcm_get_be(card, widget, stream); in dpcm_add_paths()
1372 if (!be) { in dpcm_add_paths()
1383 err = dpcm_be_connect(fe, be, stream); in dpcm_add_paths()
1392 be->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE; in dpcm_add_paths()
1420 dpcm->be->dpcm[stream].runtime_update = in dpcm_clear_pending_state()
1433 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_startup_unwind() local
1435 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_startup_unwind()
1437 if (be->dpcm[stream].users == 0) in dpcm_be_dai_startup_unwind()
1438 dev_err(be->dev, "ASoC: no users %s at close - state %d\n", in dpcm_be_dai_startup_unwind()
1440 be->dpcm[stream].state); in dpcm_be_dai_startup_unwind()
1442 if (--be->dpcm[stream].users != 0) in dpcm_be_dai_startup_unwind()
1445 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) in dpcm_be_dai_startup_unwind()
1450 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_startup_unwind()
1462 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_startup() local
1464 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_startup()
1467 dev_err(be->dev, "ASoC: no backend %s stream\n", in dpcm_be_dai_startup()
1473 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_startup()
1477 if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) in dpcm_be_dai_startup()
1478 dev_err(be->dev, "ASoC: too many users %s at open %d\n", in dpcm_be_dai_startup()
1480 be->dpcm[stream].state); in dpcm_be_dai_startup()
1482 if (be->dpcm[stream].users++ != 0) in dpcm_be_dai_startup()
1485 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_NEW) && in dpcm_be_dai_startup()
1486 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) in dpcm_be_dai_startup()
1489 dev_dbg(be->dev, "ASoC: open %s BE %s\n", in dpcm_be_dai_startup()
1490 stream ? "capture" : "playback", be->dai_link->name); in dpcm_be_dai_startup()
1492 be_substream->runtime = be->dpcm[stream].runtime; in dpcm_be_dai_startup()
1495 dev_err(be->dev, "ASoC: BE open failed %d\n", err); in dpcm_be_dai_startup()
1496 be->dpcm[stream].users--; in dpcm_be_dai_startup()
1497 if (be->dpcm[stream].users < 0) in dpcm_be_dai_startup()
1498 dev_err(be->dev, "ASoC: no users %s at unwind %d\n", in dpcm_be_dai_startup()
1500 be->dpcm[stream].state); in dpcm_be_dai_startup()
1502 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_startup()
1506 be->dpcm[stream].state = SND_SOC_DPCM_STATE_OPEN; in dpcm_be_dai_startup()
1515 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_startup() local
1517 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_startup()
1519 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_startup()
1522 if (be->dpcm[stream].users == 0) in dpcm_be_dai_startup()
1523 dev_err(be->dev, "ASoC: no users %s at close %d\n", in dpcm_be_dai_startup()
1525 be->dpcm[stream].state); in dpcm_be_dai_startup()
1527 if (--be->dpcm[stream].users != 0) in dpcm_be_dai_startup()
1530 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) in dpcm_be_dai_startup()
1535 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_startup()
1572 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_runtime_merge_format() local
1576 for_each_rtd_codec_dais(be, i, dai) { in dpcm_runtime_merge_format()
1608 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_runtime_merge_chan() local
1614 for_each_rtd_cpu_dais(be, i, dai) { in dpcm_runtime_merge_chan()
1634 if (be->num_codecs == 1) { in dpcm_runtime_merge_chan()
1635 codec_stream = snd_soc_dai_get_pcm_stream(asoc_rtd_to_codec(be, 0), stream); in dpcm_runtime_merge_chan()
1663 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_runtime_merge_rate() local
1668 for_each_rtd_dais(be, i, dai) { in dpcm_runtime_merge_rate()
1759 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_apply_symmetry() local
1761 snd_soc_dpcm_get_substream(be, stream); in dpcm_apply_symmetry()
1838 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_shutdown() local
1840 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_shutdown()
1843 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_shutdown()
1846 if (be->dpcm[stream].users == 0) in dpcm_be_dai_shutdown()
1847 dev_err(be->dev, "ASoC: no users %s at close - state %d\n", in dpcm_be_dai_shutdown()
1849 be->dpcm[stream].state); in dpcm_be_dai_shutdown()
1851 if (--be->dpcm[stream].users != 0) in dpcm_be_dai_shutdown()
1854 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_shutdown()
1855 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN)) { in dpcm_be_dai_shutdown()
1857 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; in dpcm_be_dai_shutdown()
1860 dev_dbg(be->dev, "ASoC: close BE %s\n", in dpcm_be_dai_shutdown()
1861 be->dai_link->name); in dpcm_be_dai_shutdown()
1866 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_shutdown()
1902 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_hw_free() local
1904 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_free()
1907 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_free()
1911 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_hw_free()
1915 if (be->dpcm[stream].users > 1) in dpcm_be_dai_hw_free()
1918 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_free()
1919 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && in dpcm_be_dai_hw_free()
1920 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_hw_free()
1921 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED) && in dpcm_be_dai_hw_free()
1922 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_hw_free()
1923 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) in dpcm_be_dai_hw_free()
1926 dev_dbg(be->dev, "ASoC: hw_free BE %s\n", in dpcm_be_dai_hw_free()
1927 be->dai_link->name); in dpcm_be_dai_hw_free()
1931 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; in dpcm_be_dai_hw_free()
1971 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_hw_params() local
1973 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_params()
1976 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_params()
1984 ret = snd_soc_link_be_hw_params_fixup(be, &dpcm->hw_params); in dpcm_be_dai_hw_params()
1989 memcpy(&be->dpcm[stream].hw_params, &dpcm->hw_params, in dpcm_be_dai_hw_params()
1993 if (!snd_soc_dpcm_can_be_params(fe, be, stream)) in dpcm_be_dai_hw_params()
1996 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_be_dai_hw_params()
1997 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_params()
1998 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE)) in dpcm_be_dai_hw_params()
2001 dev_dbg(be->dev, "ASoC: hw_params BE %s\n", in dpcm_be_dai_hw_params()
2002 be->dai_link->name); in dpcm_be_dai_hw_params()
2006 dev_err(dpcm->be->dev, in dpcm_be_dai_hw_params()
2011 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_PARAMS; in dpcm_be_dai_hw_params()
2018 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_hw_params() local
2020 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_params()
2022 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_params()
2026 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_hw_params()
2029 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_be_dai_hw_params()
2030 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_params()
2031 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_hw_params()
2032 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) in dpcm_be_dai_hw_params()
2081 dev_dbg(dpcm->be->dev, "ASoC: trigger BE %s cmd %d\n", in dpcm_do_trigger()
2082 dpcm->be->dai_link->name, cmd); in dpcm_do_trigger()
2086 dev_err(dpcm->be->dev,"ASoC: trigger BE failed %d\n", ret); in dpcm_do_trigger()
2099 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_trigger() local
2101 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_trigger()
2104 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_trigger()
2109 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && in dpcm_be_dai_trigger()
2110 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_trigger()
2111 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2118 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
2121 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) in dpcm_be_dai_trigger()
2128 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
2131 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2138 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
2141 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) && in dpcm_be_dai_trigger()
2142 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2145 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_trigger()
2152 be->dpcm[stream].state = SND_SOC_DPCM_STATE_STOP; in dpcm_be_dai_trigger()
2155 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2158 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_trigger()
2165 be->dpcm[stream].state = SND_SOC_DPCM_STATE_SUSPEND; in dpcm_be_dai_trigger()
2168 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2171 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_trigger()
2178 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PAUSED; in dpcm_be_dai_trigger()
2330 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_prepare() local
2332 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_prepare()
2335 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_prepare()
2338 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_prepare()
2339 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_prepare()
2340 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND) && in dpcm_be_dai_prepare()
2341 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_prepare()
2344 dev_dbg(be->dev, "ASoC: prepare BE %s\n", in dpcm_be_dai_prepare()
2345 be->dai_link->name); in dpcm_be_dai_prepare()
2349 dev_err(be->dev, "ASoC: backend prepare failed %d\n", in dpcm_be_dai_prepare()
2354 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PREPARE; in dpcm_be_dai_prepare()
2521 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_run_update_startup() local
2522 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_CLOSE) in dpcm_run_update_startup()
2894 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_be_can_update() argument
2898 be->dpcm[stream].runtime_update)) in snd_soc_dpcm_be_can_update()
2906 snd_soc_dpcm_get_substream(struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_get_substream() argument
2908 return be->pcm->streams[stream].substream; in snd_soc_dpcm_get_substream()
2913 struct snd_soc_pcm_runtime *be, in snd_soc_dpcm_check_state() argument
2925 for_each_dpcm_fe(be, stream, dpcm) { in snd_soc_dpcm_check_state()
2949 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_free_stop() argument
2957 return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); in snd_soc_dpcm_can_be_free_stop()
2966 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_params() argument
2975 return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); in snd_soc_dpcm_can_be_params()