Lines Matching refs:be
144 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_show_state() local
148 "- %s\n", be->dai_link->name); in dpcm_show_state()
152 dpcm_state_string(be->dpcm[stream].state)); in dpcm_show_state()
154 if ((be->dpcm[stream].state >= SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_show_state()
155 (be->dpcm[stream].state <= SND_SOC_DPCM_STATE_STOP)) in dpcm_show_state()
224 name = kasprintf(GFP_KERNEL, "%s:%s", dpcm->be->dai_link->name, in dpcm_create_debugfs_state()
273 static void dpcm_set_be_update_state(struct snd_soc_pcm_runtime *be, in dpcm_set_be_update_state() argument
276 be->dpcm[stream].runtime_update = state; in dpcm_set_be_update_state()
355 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_dapm_stream_event() local
357 dev_dbg(be->dev, "ASoC: BE %s event %d dir %d\n", in dpcm_dapm_stream_event()
358 be->dai_link->name, event, dir); in dpcm_dapm_stream_event()
361 (be->dpcm[dir].users >= 1)) in dpcm_dapm_stream_event()
364 snd_soc_dapm_stream_event(be, dir, event); in dpcm_dapm_stream_event()
1176 struct snd_soc_pcm_runtime *be, int stream) in dpcm_be_connect() argument
1186 if (dpcm->be == be && dpcm->fe == fe) in dpcm_be_connect()
1191 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_connect()
1194 dev_err(be->dev, "%s: FE is atomic but BE is nonatomic, invalid configuration\n", in dpcm_be_connect()
1199 dev_dbg(be->dev, "FE is nonatomic but BE is not, forcing BE as nonatomic\n"); in dpcm_be_connect()
1207 dpcm->be = be; in dpcm_be_connect()
1209 be->dpcm[stream].runtime = fe->dpcm[stream].runtime; in dpcm_be_connect()
1213 list_add(&dpcm->list_fe, &be->dpcm[stream].fe_clients); in dpcm_be_connect()
1218 stream ? "<-" : "->", be->dai_link->name); in dpcm_be_connect()
1227 struct snd_soc_pcm_runtime *be, int stream) in dpcm_be_reparent() argument
1233 if (!be->dpcm[stream].users) in dpcm_be_reparent()
1236 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_reparent()
1240 for_each_dpcm_fe(be, stream, dpcm) { in dpcm_be_reparent()
1247 stream ? "<-" : "->", dpcm->be->dai_link->name); in dpcm_be_reparent()
1267 dpcm->be->dai_link->name); in dpcm_be_disconnect()
1274 stream ? "<-" : "->", dpcm->be->dai_link->name); in dpcm_be_disconnect()
1277 dpcm_be_reparent(fe, dpcm->be, stream); in dpcm_be_disconnect()
1297 struct snd_soc_pcm_runtime *be; in dpcm_get_be() local
1304 for_each_card_rtds(card, be) { in dpcm_get_be()
1306 if (!be->dai_link->no_pcm) in dpcm_get_be()
1309 if (!snd_soc_dpcm_get_substream(be, stream)) in dpcm_get_be()
1312 for_each_rtd_dais(be, i, dai) { in dpcm_get_be()
1319 return be; in dpcm_get_be()
1399 for_each_rtd_dais(dpcm->be, i, dai) { in dpcm_be_is_active()
1426 dpcm->be->dai_link->name, fe->dai_link->name); in dpcm_prune_paths()
1428 dpcm_set_be_update_state(dpcm->be, stream, SND_SOC_DPCM_UPDATE_BE); in dpcm_prune_paths()
1441 struct snd_soc_pcm_runtime *be; in dpcm_add_paths() local
1466 be = dpcm_get_be(card, widget, stream); in dpcm_add_paths()
1467 if (!be) { in dpcm_add_paths()
1479 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_NEW) && in dpcm_add_paths()
1480 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) in dpcm_add_paths()
1484 err = dpcm_be_connect(fe, be, stream); in dpcm_add_paths()
1493 dpcm_set_be_update_state(be, stream, SND_SOC_DPCM_UPDATE_BE); in dpcm_add_paths()
1519 dpcm_set_be_update_state(dpcm->be, stream, SND_SOC_DPCM_UPDATE_NO); in dpcm_clear_pending_state()
1529 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_stop() local
1531 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_stop()
1537 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_stop()
1540 if (be->dpcm[stream].users == 0) { in dpcm_be_dai_stop()
1541 dev_err(be->dev, "ASoC: no users %s at close - state %d\n", in dpcm_be_dai_stop()
1543 be->dpcm[stream].state); in dpcm_be_dai_stop()
1547 if (--be->dpcm[stream].users != 0) in dpcm_be_dai_stop()
1550 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) { in dpcm_be_dai_stop()
1554 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) { in dpcm_be_dai_stop()
1555 __soc_pcm_hw_free(be, be_substream); in dpcm_be_dai_stop()
1556 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; in dpcm_be_dai_stop()
1560 __soc_pcm_close(be, be_substream); in dpcm_be_dai_stop()
1562 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_stop()
1568 struct snd_soc_pcm_runtime *be; in dpcm_be_dai_startup() local
1576 be = dpcm->be; in dpcm_be_dai_startup()
1577 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_startup()
1580 dev_err(be->dev, "ASoC: no backend %s stream\n", in dpcm_be_dai_startup()
1586 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_startup()
1590 if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) { in dpcm_be_dai_startup()
1591 dev_err(be->dev, "ASoC: too many users %s at open %d\n", in dpcm_be_dai_startup()
1593 be->dpcm[stream].state); in dpcm_be_dai_startup()
1597 if (be->dpcm[stream].users++ != 0) in dpcm_be_dai_startup()
1600 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_NEW) && in dpcm_be_dai_startup()
1601 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) in dpcm_be_dai_startup()
1604 dev_dbg(be->dev, "ASoC: open %s BE %s\n", in dpcm_be_dai_startup()
1605 stream ? "capture" : "playback", be->dai_link->name); in dpcm_be_dai_startup()
1607 be_substream->runtime = be->dpcm[stream].runtime; in dpcm_be_dai_startup()
1608 err = __soc_pcm_open(be, be_substream); in dpcm_be_dai_startup()
1610 be->dpcm[stream].users--; in dpcm_be_dai_startup()
1611 if (be->dpcm[stream].users < 0) in dpcm_be_dai_startup()
1612 dev_err(be->dev, "ASoC: no users %s at unwind %d\n", in dpcm_be_dai_startup()
1614 be->dpcm[stream].state); in dpcm_be_dai_startup()
1616 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_startup()
1619 be->dpcm[stream].be_start = 0; in dpcm_be_dai_startup()
1620 be->dpcm[stream].state = SND_SOC_DPCM_STATE_OPEN; in dpcm_be_dai_startup()
1684 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_runtime_setup_be_format() local
1688 for_each_rtd_codec_dais(be, i, dai) { in dpcm_runtime_setup_be_format()
1720 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_runtime_setup_be_chan() local
1725 for_each_rtd_cpu_dais(be, i, dai) { in dpcm_runtime_setup_be_chan()
1742 if (be->dai_link->num_codecs == 1) { in dpcm_runtime_setup_be_chan()
1744 asoc_rtd_to_codec(be, 0), stream); in dpcm_runtime_setup_be_chan()
1768 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_runtime_setup_be_rate() local
1773 for_each_rtd_dais(be, i, dai) { in dpcm_runtime_setup_be_rate()
1809 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_apply_symmetry() local
1811 snd_soc_dpcm_get_substream(be, stream); in dpcm_apply_symmetry()
1906 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_hw_free() local
1908 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_free()
1911 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_free()
1915 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_hw_free()
1919 if (be->dpcm[stream].users > 1) in dpcm_be_dai_hw_free()
1922 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_free()
1923 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && in dpcm_be_dai_hw_free()
1924 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_hw_free()
1925 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED) && in dpcm_be_dai_hw_free()
1926 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_hw_free()
1927 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) in dpcm_be_dai_hw_free()
1930 dev_dbg(be->dev, "ASoC: hw_free BE %s\n", in dpcm_be_dai_hw_free()
1931 be->dai_link->name); in dpcm_be_dai_hw_free()
1933 __soc_pcm_hw_free(be, be_substream); in dpcm_be_dai_hw_free()
1935 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; in dpcm_be_dai_hw_free()
1965 struct snd_soc_pcm_runtime *be; in dpcm_be_dai_hw_params() local
1971 be = dpcm->be; in dpcm_be_dai_hw_params()
1972 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_params()
1975 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_params()
1983 ret = snd_soc_link_be_hw_params_fixup(be, &dpcm->hw_params); in dpcm_be_dai_hw_params()
1988 memcpy(&be->dpcm[stream].hw_params, &dpcm->hw_params, in dpcm_be_dai_hw_params()
1992 if (!snd_soc_dpcm_can_be_params(fe, be, stream)) in dpcm_be_dai_hw_params()
1995 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_be_dai_hw_params()
1996 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_params()
1997 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE)) in dpcm_be_dai_hw_params()
2000 dev_dbg(be->dev, "ASoC: hw_params BE %s\n", in dpcm_be_dai_hw_params()
2001 be->dai_link->name); in dpcm_be_dai_hw_params()
2003 ret = __soc_pcm_hw_params(be, be_substream, &dpcm->hw_params); in dpcm_be_dai_hw_params()
2007 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_PARAMS; in dpcm_be_dai_hw_params()
2013 __func__, be->dai_link->name, ret); in dpcm_be_dai_hw_params()
2017 be = dpcm->be; in dpcm_be_dai_hw_params()
2018 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_params()
2020 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_params()
2024 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_hw_params()
2027 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_be_dai_hw_params()
2028 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_params()
2029 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_hw_params()
2030 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) in dpcm_be_dai_hw_params()
2033 __soc_pcm_hw_free(be, be_substream); in dpcm_be_dai_hw_params()
2075 struct snd_soc_pcm_runtime *be; in dpcm_be_dai_trigger() local
2084 be = dpcm->be; in dpcm_be_dai_trigger()
2085 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_trigger()
2087 snd_soc_dpcm_stream_lock_irqsave_nested(be, stream, flags); in dpcm_be_dai_trigger()
2090 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_trigger()
2093 dev_dbg(be->dev, "ASoC: trigger BE %s cmd %d\n", in dpcm_be_dai_trigger()
2094 be->dai_link->name, cmd); in dpcm_be_dai_trigger()
2098 if (!be->dpcm[stream].be_start && in dpcm_be_dai_trigger()
2099 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && in dpcm_be_dai_trigger()
2100 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_trigger()
2101 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2104 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2105 if (be->dpcm[stream].be_start != 1) in dpcm_be_dai_trigger()
2108 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_PAUSED) in dpcm_be_dai_trigger()
2115 be->dpcm[stream].be_start--; in dpcm_be_dai_trigger()
2119 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
2122 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) in dpcm_be_dai_trigger()
2125 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2126 if (be->dpcm[stream].be_start != 1) in dpcm_be_dai_trigger()
2131 be->dpcm[stream].be_start--; 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].be_start && in dpcm_be_dai_trigger()
2139 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) && in dpcm_be_dai_trigger()
2140 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2144 be->dpcm[stream].be_pause--; in dpcm_be_dai_trigger()
2146 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2147 if (be->dpcm[stream].be_start != 1) in dpcm_be_dai_trigger()
2152 be->dpcm[stream].be_start--; in dpcm_be_dai_trigger()
2156 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
2159 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) && in dpcm_be_dai_trigger()
2160 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2163 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2164 be->dpcm[stream].be_start--; in dpcm_be_dai_trigger()
2166 if (be->dpcm[stream].be_start != 0) in dpcm_be_dai_trigger()
2173 be->dpcm[stream].be_pause--; in dpcm_be_dai_trigger()
2176 if (be->dpcm[stream].be_pause != 0) in dpcm_be_dai_trigger()
2182 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2183 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2186 be->dpcm[stream].be_pause++; in dpcm_be_dai_trigger()
2191 if (be->dpcm[stream].be_pause != 0) in dpcm_be_dai_trigger()
2192 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PAUSED; in dpcm_be_dai_trigger()
2194 be->dpcm[stream].state = SND_SOC_DPCM_STATE_STOP; in dpcm_be_dai_trigger()
2198 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2201 be->dpcm[stream].be_start--; in dpcm_be_dai_trigger()
2202 if (be->dpcm[stream].be_start != 0) in dpcm_be_dai_trigger()
2207 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2211 be->dpcm[stream].state = SND_SOC_DPCM_STATE_SUSPEND; in dpcm_be_dai_trigger()
2214 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2218 be->dpcm[stream].be_pause++; in dpcm_be_dai_trigger()
2220 be->dpcm[stream].be_start--; in dpcm_be_dai_trigger()
2221 if (be->dpcm[stream].be_start != 0) in dpcm_be_dai_trigger()
2226 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2230 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PAUSED; in dpcm_be_dai_trigger()
2234 snd_soc_dpcm_stream_unlock_irqrestore(be, stream, flags); in dpcm_be_dai_trigger()
2385 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_prepare() local
2387 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_prepare()
2390 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_prepare()
2393 if (!snd_soc_dpcm_can_be_prepared(fe, be, stream)) in dpcm_be_dai_prepare()
2396 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_prepare()
2397 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_prepare()
2398 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND) && in dpcm_be_dai_prepare()
2399 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_prepare()
2402 dev_dbg(be->dev, "ASoC: prepare BE %s\n", in dpcm_be_dai_prepare()
2403 be->dai_link->name); in dpcm_be_dai_prepare()
2405 ret = __soc_pcm_prepare(be, be_substream); in dpcm_be_dai_prepare()
2409 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PREPARE; in dpcm_be_dai_prepare()
2561 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_run_update_startup() local
2564 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_run_update_startup()
2567 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_CLOSE || in dpcm_run_update_startup()
2568 be->dpcm[stream].state == SND_SOC_DPCM_STATE_NEW) in dpcm_run_update_startup()
2955 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_be_can_update() argument
2959 be->dpcm[stream].runtime_update)) in snd_soc_dpcm_be_can_update()
2967 snd_soc_dpcm_get_substream(struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_get_substream() argument
2969 return be->pcm->streams[stream].substream; in snd_soc_dpcm_get_substream()
2974 struct snd_soc_pcm_runtime *be, in snd_soc_dpcm_check_state() argument
2984 for_each_dpcm_fe(be, stream, dpcm) { in snd_soc_dpcm_check_state()
3007 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_free_stop() argument
3015 return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); in snd_soc_dpcm_can_be_free_stop()
3024 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_params() argument
3033 return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); in snd_soc_dpcm_can_be_params()
3042 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_prepared() argument
3050 return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); in snd_soc_dpcm_can_be_prepared()