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()
1112 struct snd_soc_pcm_runtime *be, int stream) in dpcm_be_connect() argument
1119 if (dpcm->be == be && dpcm->fe == fe) in dpcm_be_connect()
1127 dpcm->be = be; in dpcm_be_connect()
1129 be->dpcm[stream].runtime = fe->dpcm[stream].runtime; in dpcm_be_connect()
1133 list_add(&dpcm->list_fe, &be->dpcm[stream].fe_clients); in dpcm_be_connect()
1138 stream ? "<-" : "->", be->dai_link->name); in dpcm_be_connect()
1147 struct snd_soc_pcm_runtime *be, int stream) in dpcm_be_reparent() argument
1153 if (!be->dpcm[stream].users) in dpcm_be_reparent()
1156 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_reparent()
1160 for_each_dpcm_fe(be, stream, dpcm) { in dpcm_be_reparent()
1167 stream ? "<-" : "->", dpcm->be->dai_link->name); in dpcm_be_reparent()
1184 dpcm->be->dai_link->name); in dpcm_be_disconnect()
1191 stream ? "<-" : "->", dpcm->be->dai_link->name); in dpcm_be_disconnect()
1194 dpcm_be_reparent(fe, dpcm->be, stream); in dpcm_be_disconnect()
1210 struct snd_soc_pcm_runtime *be; in dpcm_get_be() local
1217 for_each_card_rtds(card, be) { in dpcm_get_be()
1219 if (!be->dai_link->no_pcm) in dpcm_get_be()
1222 for_each_rtd_dais(be, i, dai) { in dpcm_get_be()
1229 return be; in dpcm_get_be()
1305 for_each_rtd_dais(dpcm->be, i, dai) { in dpcm_be_is_active()
1332 dpcm->be->dai_link->name, fe->dai_link->name); in dpcm_prune_paths()
1334 dpcm->be->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE; in dpcm_prune_paths()
1347 struct snd_soc_pcm_runtime *be; in dpcm_add_paths() local
1368 be = dpcm_get_be(card, widget, stream); in dpcm_add_paths()
1369 if (!be) { in dpcm_add_paths()
1380 err = dpcm_be_connect(fe, be, stream); in dpcm_add_paths()
1389 be->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE; in dpcm_add_paths()
1417 dpcm->be->dpcm[stream].runtime_update = in dpcm_clear_pending_state()
1430 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_startup_unwind() local
1432 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_startup_unwind()
1434 if (be->dpcm[stream].users == 0) in dpcm_be_dai_startup_unwind()
1435 dev_err(be->dev, "ASoC: no users %s at close - state %d\n", in dpcm_be_dai_startup_unwind()
1437 be->dpcm[stream].state); in dpcm_be_dai_startup_unwind()
1439 if (--be->dpcm[stream].users != 0) in dpcm_be_dai_startup_unwind()
1442 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) in dpcm_be_dai_startup_unwind()
1447 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_startup_unwind()
1459 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_startup() local
1461 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_startup()
1464 dev_err(be->dev, "ASoC: no backend %s stream\n", in dpcm_be_dai_startup()
1470 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_startup()
1474 if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) in dpcm_be_dai_startup()
1475 dev_err(be->dev, "ASoC: too many users %s at open %d\n", in dpcm_be_dai_startup()
1477 be->dpcm[stream].state); in dpcm_be_dai_startup()
1479 if (be->dpcm[stream].users++ != 0) in dpcm_be_dai_startup()
1482 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_NEW) && in dpcm_be_dai_startup()
1483 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) in dpcm_be_dai_startup()
1486 dev_dbg(be->dev, "ASoC: open %s BE %s\n", in dpcm_be_dai_startup()
1487 stream ? "capture" : "playback", be->dai_link->name); in dpcm_be_dai_startup()
1489 be_substream->runtime = be->dpcm[stream].runtime; in dpcm_be_dai_startup()
1492 dev_err(be->dev, "ASoC: BE open failed %d\n", err); in dpcm_be_dai_startup()
1493 be->dpcm[stream].users--; in dpcm_be_dai_startup()
1494 if (be->dpcm[stream].users < 0) in dpcm_be_dai_startup()
1495 dev_err(be->dev, "ASoC: no users %s at unwind %d\n", in dpcm_be_dai_startup()
1497 be->dpcm[stream].state); in dpcm_be_dai_startup()
1499 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_startup()
1503 be->dpcm[stream].state = SND_SOC_DPCM_STATE_OPEN; in dpcm_be_dai_startup()
1512 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_startup() local
1514 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_startup()
1516 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_startup()
1519 if (be->dpcm[stream].users == 0) in dpcm_be_dai_startup()
1520 dev_err(be->dev, "ASoC: no users %s at close %d\n", in dpcm_be_dai_startup()
1522 be->dpcm[stream].state); in dpcm_be_dai_startup()
1524 if (--be->dpcm[stream].users != 0) in dpcm_be_dai_startup()
1527 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) in dpcm_be_dai_startup()
1532 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_startup()
1569 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_runtime_merge_format() local
1573 for_each_rtd_codec_dais(be, i, dai) { in dpcm_runtime_merge_format()
1605 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_runtime_merge_chan() local
1611 for_each_rtd_cpu_dais(be, i, dai) { in dpcm_runtime_merge_chan()
1631 if (be->num_codecs == 1) { in dpcm_runtime_merge_chan()
1632 codec_stream = snd_soc_dai_get_pcm_stream(asoc_rtd_to_codec(be, 0), stream); in dpcm_runtime_merge_chan()
1660 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_runtime_merge_rate() local
1665 for_each_rtd_dais(be, i, dai) { in dpcm_runtime_merge_rate()
1756 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_apply_symmetry() local
1758 snd_soc_dpcm_get_substream(be, stream); in dpcm_apply_symmetry()
1835 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_shutdown() local
1837 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_shutdown()
1840 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_shutdown()
1843 if (be->dpcm[stream].users == 0) in dpcm_be_dai_shutdown()
1844 dev_err(be->dev, "ASoC: no users %s at close - state %d\n", in dpcm_be_dai_shutdown()
1846 be->dpcm[stream].state); in dpcm_be_dai_shutdown()
1848 if (--be->dpcm[stream].users != 0) in dpcm_be_dai_shutdown()
1851 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_shutdown()
1852 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN)) { in dpcm_be_dai_shutdown()
1854 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; in dpcm_be_dai_shutdown()
1857 dev_dbg(be->dev, "ASoC: close BE %s\n", in dpcm_be_dai_shutdown()
1858 be->dai_link->name); in dpcm_be_dai_shutdown()
1863 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_shutdown()
1899 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_hw_free() local
1901 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_free()
1904 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_free()
1908 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_hw_free()
1912 if (be->dpcm[stream].users > 1) in dpcm_be_dai_hw_free()
1915 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_free()
1916 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && in dpcm_be_dai_hw_free()
1917 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_hw_free()
1918 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED) && in dpcm_be_dai_hw_free()
1919 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_hw_free()
1920 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) in dpcm_be_dai_hw_free()
1923 dev_dbg(be->dev, "ASoC: hw_free BE %s\n", in dpcm_be_dai_hw_free()
1924 be->dai_link->name); in dpcm_be_dai_hw_free()
1928 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; in dpcm_be_dai_hw_free()
1968 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_hw_params() local
1970 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_params()
1973 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_params()
1981 ret = snd_soc_link_be_hw_params_fixup(be, &dpcm->hw_params); in dpcm_be_dai_hw_params()
1986 memcpy(&be->dpcm[stream].hw_params, &dpcm->hw_params, in dpcm_be_dai_hw_params()
1990 if (!snd_soc_dpcm_can_be_params(fe, be, stream)) in dpcm_be_dai_hw_params()
1993 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_be_dai_hw_params()
1994 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_params()
1995 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE)) in dpcm_be_dai_hw_params()
1998 dev_dbg(be->dev, "ASoC: hw_params BE %s\n", in dpcm_be_dai_hw_params()
1999 be->dai_link->name); in dpcm_be_dai_hw_params()
2003 dev_err(dpcm->be->dev, in dpcm_be_dai_hw_params()
2008 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_PARAMS; in dpcm_be_dai_hw_params()
2015 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_hw_params() local
2017 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_params()
2019 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_params()
2023 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_hw_params()
2026 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_be_dai_hw_params()
2027 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_params()
2028 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_hw_params()
2029 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) in dpcm_be_dai_hw_params()
2078 dev_dbg(dpcm->be->dev, "ASoC: trigger BE %s cmd %d\n", in dpcm_do_trigger()
2079 dpcm->be->dai_link->name, cmd); in dpcm_do_trigger()
2083 dev_err(dpcm->be->dev,"ASoC: trigger BE failed %d\n", ret); in dpcm_do_trigger()
2096 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_trigger() local
2098 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_trigger()
2101 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_trigger()
2106 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && in dpcm_be_dai_trigger()
2107 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_trigger()
2108 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2115 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
2118 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) in dpcm_be_dai_trigger()
2125 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
2128 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2135 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
2138 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) && in dpcm_be_dai_trigger()
2139 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2142 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_trigger()
2149 be->dpcm[stream].state = SND_SOC_DPCM_STATE_STOP; in dpcm_be_dai_trigger()
2152 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2155 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_trigger()
2162 be->dpcm[stream].state = SND_SOC_DPCM_STATE_SUSPEND; in dpcm_be_dai_trigger()
2165 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2168 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_trigger()
2175 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PAUSED; in dpcm_be_dai_trigger()
2327 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_prepare() local
2329 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_prepare()
2332 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_prepare()
2335 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_prepare()
2336 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_prepare()
2337 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND) && in dpcm_be_dai_prepare()
2338 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_prepare()
2341 dev_dbg(be->dev, "ASoC: prepare BE %s\n", in dpcm_be_dai_prepare()
2342 be->dai_link->name); in dpcm_be_dai_prepare()
2346 dev_err(be->dev, "ASoC: backend prepare failed %d\n", in dpcm_be_dai_prepare()
2351 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PREPARE; in dpcm_be_dai_prepare()
2518 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_run_update_startup() local
2519 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_CLOSE) in dpcm_run_update_startup()
2891 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_be_can_update() argument
2895 be->dpcm[stream].runtime_update)) in snd_soc_dpcm_be_can_update()
2903 snd_soc_dpcm_get_substream(struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_get_substream() argument
2905 return be->pcm->streams[stream].substream; in snd_soc_dpcm_get_substream()
2910 struct snd_soc_pcm_runtime *be, in snd_soc_dpcm_check_state() argument
2922 for_each_dpcm_fe(be, stream, dpcm) { in snd_soc_dpcm_check_state()
2946 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_free_stop() argument
2954 return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); in snd_soc_dpcm_can_be_free_stop()
2963 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_params() argument
2972 return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); in snd_soc_dpcm_can_be_params()