Lines Matching full:be
47 /* is the current PCM operation for this BE ? */
49 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_update() argument
53 be->dpcm[stream].runtime_update)) in snd_soc_dpcm_can_be_update()
59 struct snd_soc_pcm_runtime *be, in snd_soc_dpcm_check_state() argument
69 for_each_dpcm_fe(be, stream, dpcm) { in snd_soc_dpcm_check_state()
83 /* it's safe to do this BE DAI */ in snd_soc_dpcm_check_state()
88 * We can only hw_free, stop, pause or suspend a BE DAI if any of it's FE
92 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_free_stop() argument
100 return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); in snd_soc_dpcm_can_be_free_stop()
104 * We can only change hw params a BE DAI if any of it's FE are not prepared,
108 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_params() argument
117 return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); in snd_soc_dpcm_can_be_params()
121 * We can only prepare a BE DAI if any of it's FE are not prepared,
125 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_prepared() argument
133 return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); in snd_soc_dpcm_can_be_prepared()
210 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_show_state() local
211 params = &be->dpcm[stream].hw_params; in dpcm_show_state()
214 "- %s\n", be->dai_link->name); in dpcm_show_state()
218 dpcm_state_string(be->dpcm[stream].state)); in dpcm_show_state()
220 if ((be->dpcm[stream].state >= SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_show_state()
221 (be->dpcm[stream].state <= SND_SOC_DPCM_STATE_STOP)) in dpcm_show_state()
288 name = kasprintf(GFP_KERNEL, "%s:%s", dpcm->be->dai_link->name, in dpcm_create_debugfs_state()
337 static void dpcm_set_be_update_state(struct snd_soc_pcm_runtime *be, in dpcm_set_be_update_state() argument
340 be->dpcm[stream].runtime_update = state; in dpcm_set_be_update_state()
352 * Should typically be called when a stream is opened.
354 * Must be called with the rtd->card->pcm_mutex being held
379 * @rtd: The ASoC PCM runtime that should be checked.
381 * This function checks whether the power down delay should be ignored for a
411 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_dapm_stream_event() local
413 dev_dbg(be->dev, "ASoC: BE %s event %d dir %d\n", in dpcm_dapm_stream_event()
414 be->dai_link->name, event, dir); in dpcm_dapm_stream_event()
417 (be->dpcm[dir].users >= 1)) in dpcm_dapm_stream_event()
420 snd_soc_dapm_stream_event(be, dir, event); in dpcm_dapm_stream_event()
676 * chan min/max cannot be enforced if there are multiple CODEC DAIs in snd_soc_runtime_calc_hw()
678 * channel allocation be fixed up later in snd_soc_runtime_calc_hw()
697 * have bailed out on a higher level, since there would be no CPU or in soc_pcm_init_runtime_hw()
779 * Called by ALSA when a PCM substream is closed. Private data can be
839 * then initialized and any private data can be allocated. This also calls
918 * rate, etc. This function is non atomic and can be called multiple times,
1004 /* clear the corresponding DAIs parameters when going to be inactive */ in soc_pcm_hw_clean()
1033 * Frees resources allocated by hw_params, can be called multiple times
1055 * function can also be called multiple times and can allocate buffers
1083 * set up transfer direction, it should not need to be in __soc_pcm_hw_params()
1085 * not even be supported by that CODEC. There may be cases in __soc_pcm_hw_params()
1086 * however where a CODEC needs to be set up although it is in __soc_pcm_hw_params()
1266 * the runtime->delay will be updated via snd_soc_pcm_component/dai_delay().
1277 /* should be called *after* snd_soc_pcm_component_pointer() */ in soc_pcm_pointer()
1286 /* connect a FE and BE */
1288 struct snd_soc_pcm_runtime *be, int stream) in dpcm_be_connect() argument
1298 if (dpcm->be == be) in dpcm_be_connect()
1302 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_connect()
1305 return snd_soc_ret(be->dev, -EINVAL, in dpcm_be_connect()
1307 __func__, fe->dai_link->name, be->dai_link->name); in dpcm_be_connect()
1310 dev_dbg(be->dev, "FE is nonatomic but BE is not, forcing BE as nonatomic\n"); in dpcm_be_connect()
1318 dpcm->be = be; in dpcm_be_connect()
1323 list_add(&dpcm->list_fe, &be->dpcm[stream].fe_clients); in dpcm_be_connect()
1328 stream ? "<-" : "->", be->dai_link->name); in dpcm_be_connect()
1335 /* reparent a BE onto another FE */
1337 struct snd_soc_pcm_runtime *be, int stream) in dpcm_be_reparent() argument
1342 /* reparent if BE is connected to other FEs */ in dpcm_be_reparent()
1343 if (!be->dpcm[stream].users) in dpcm_be_reparent()
1346 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_reparent()
1350 for_each_dpcm_fe(be, stream, dpcm) { in dpcm_be_reparent()
1357 stream ? "<-" : "->", dpcm->be->dai_link->name); in dpcm_be_reparent()
1365 /* disconnect a BE and FE */
1376 dev_dbg(fe->dev, "ASoC: BE %s disconnect check for %s\n", in dpcm_be_disconnect()
1378 dpcm->be->dai_link->name); in dpcm_be_disconnect()
1385 stream ? "<-" : "->", dpcm->be->dai_link->name); in dpcm_be_disconnect()
1388 dpcm_be_reparent(fe, dpcm->be, stream); in dpcm_be_disconnect()
1404 /* get BE for DAI widget and stream */
1408 struct snd_soc_pcm_runtime *be; in dpcm_get_be() local
1413 dev_dbg(card->dev, "ASoC: find BE for widget %s\n", widget->name); in dpcm_get_be()
1415 for_each_card_rtds(card, be) { in dpcm_get_be()
1417 if (!be->dai_link->no_pcm) in dpcm_get_be()
1420 if (!snd_soc_dpcm_get_substream(be, stream)) in dpcm_get_be()
1423 for_each_rtd_dais(be, i, dai) { in dpcm_get_be()
1426 dev_dbg(card->dev, "ASoC: try BE : %s\n", in dpcm_get_be()
1430 return be; in dpcm_get_be()
1434 /* Widget provided is not a BE */ in dpcm_get_be()
1508 /* is there a valid DAI widget for this BE */ in dpcm_be_is_active()
1509 for_each_rtd_dais(dpcm->be, i, dai) { in dpcm_be_is_active()
1513 * The BE is pruned only if none of the dai in dpcm_be_is_active()
1529 /* Destroy any old FE <--> BE connections */ in dpcm_prune_paths()
1534 dev_dbg(fe->dev, "ASoC: pruning %s BE %s for %s\n", in dpcm_prune_paths()
1536 dpcm->be->dai_link->name, fe->dai_link->name); in dpcm_prune_paths()
1538 dpcm_set_be_update_state(dpcm->be, stream, SND_SOC_DPCM_UPDATE_BE); in dpcm_prune_paths()
1542 dev_dbg(fe->dev, "ASoC: found %d old BE paths for pruning\n", prune); in dpcm_prune_paths()
1551 struct snd_soc_pcm_runtime *be; in dpcm_add_paths() local
1560 /* Create any new FE <--> BE connections */ in dpcm_add_paths()
1576 /* is there a valid BE rtd for this widget */ in dpcm_add_paths()
1577 be = dpcm_get_be(card, widget, stream); in dpcm_add_paths()
1578 if (!be) { in dpcm_add_paths()
1579 dev_dbg(fe->dev, "ASoC: no BE found for %s\n", in dpcm_add_paths()
1587 * already active BE on such systems and ensures the BE DAI in dpcm_add_paths()
1588 * widget is powered ON after hw_params() BE DAI callback. in dpcm_add_paths()
1591 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_NEW) && in dpcm_add_paths()
1592 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_add_paths()
1593 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_add_paths()
1594 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) in dpcm_add_paths()
1597 /* newly connected FE and BE */ in dpcm_add_paths()
1598 err = dpcm_be_connect(fe, be, stream); in dpcm_add_paths()
1607 dpcm_set_be_update_state(be, stream, SND_SOC_DPCM_UPDATE_BE); in dpcm_add_paths()
1611 dev_dbg(fe->dev, "ASoC: found %d new BE paths\n", new); in dpcm_add_paths()
1620 dpcm_set_be_update_state(dpcm->be, stream, SND_SOC_DPCM_UPDATE_NO); in dpcm_clear_pending_state()
1630 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_stop() local
1632 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_stop()
1637 /* is this op for this BE ? */ in dpcm_be_dai_stop()
1638 if (!snd_soc_dpcm_can_be_update(fe, be, stream)) in dpcm_be_dai_stop()
1641 if (be->dpcm[stream].users == 0) { in dpcm_be_dai_stop()
1642 dev_err(be->dev, "ASoC: no users %s at close - state %s\n", in dpcm_be_dai_stop()
1644 dpcm_state_string(be->dpcm[stream].state)); in dpcm_be_dai_stop()
1648 if (--be->dpcm[stream].users != 0) in dpcm_be_dai_stop()
1651 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) { in dpcm_be_dai_stop()
1655 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) { in dpcm_be_dai_stop()
1656 __soc_pcm_hw_free(be, be_substream); in dpcm_be_dai_stop()
1657 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; in dpcm_be_dai_stop()
1661 __soc_pcm_close(be, be_substream); in dpcm_be_dai_stop()
1663 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_stop()
1670 struct snd_soc_pcm_runtime *be; in dpcm_be_dai_startup() local
1674 /* only startup BE DAIs that are either sinks or sources to this FE DAI */ in dpcm_be_dai_startup()
1678 be = dpcm->be; in dpcm_be_dai_startup()
1679 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_startup()
1682 dev_err(be->dev, "ASoC: no backend %s stream\n", in dpcm_be_dai_startup()
1687 /* is this op for this BE ? */ in dpcm_be_dai_startup()
1688 if (!snd_soc_dpcm_can_be_update(fe, be, stream)) in dpcm_be_dai_startup()
1692 if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) { in dpcm_be_dai_startup()
1693 dev_err(be->dev, "ASoC: too many users %s at open %s\n", in dpcm_be_dai_startup()
1695 dpcm_state_string(be->dpcm[stream].state)); in dpcm_be_dai_startup()
1699 if (be->dpcm[stream].users++ != 0) in dpcm_be_dai_startup()
1702 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_NEW) && in dpcm_be_dai_startup()
1703 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) in dpcm_be_dai_startup()
1706 dev_dbg(be->dev, "ASoC: open %s BE %s\n", in dpcm_be_dai_startup()
1707 snd_pcm_direction_name(stream), be->dai_link->name); in dpcm_be_dai_startup()
1710 err = __soc_pcm_open(be, be_substream); in dpcm_be_dai_startup()
1712 be->dpcm[stream].users--; in dpcm_be_dai_startup()
1713 if (be->dpcm[stream].users < 0) in dpcm_be_dai_startup()
1714 dev_err(be->dev, "ASoC: no users %s at unwind %s\n", in dpcm_be_dai_startup()
1716 dpcm_state_string(be->dpcm[stream].state)); in dpcm_be_dai_startup()
1718 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_startup()
1721 be->dpcm[stream].be_start = 0; in dpcm_be_dai_startup()
1722 be->dpcm[stream].state = SND_SOC_DPCM_STATE_OPEN; in dpcm_be_dai_startup()
1781 * It returns merged BE codec format in dpcm_runtime_setup_be_format()
1786 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_runtime_setup_be_format() local
1790 for_each_rtd_codec_dais(be, i, dai) { in dpcm_runtime_setup_be_format()
1817 * It returns merged BE codec channel; in dpcm_runtime_setup_be_chan()
1822 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_runtime_setup_be_chan() local
1827 for_each_rtd_cpu_dais(be, i, dai) { in dpcm_runtime_setup_be_chan()
1841 * chan min/max cannot be enforced if there are multiple CODEC in dpcm_runtime_setup_be_chan()
1844 if (be->dai_link->num_codecs == 1) { in dpcm_runtime_setup_be_chan()
1846 snd_soc_rtd_to_codec(be, 0), stream); in dpcm_runtime_setup_be_chan()
1865 * It returns merged BE codec channel; in dpcm_runtime_setup_be_rate()
1870 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_runtime_setup_be_rate() local
1875 for_each_rtd_dais(be, i, dai) { in dpcm_runtime_setup_be_rate()
1909 /* apply symmetry for BE */ in dpcm_apply_symmetry()
1911 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_apply_symmetry() local
1913 snd_soc_dpcm_get_substream(be, stream); in dpcm_apply_symmetry()
2008 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_hw_free() local
2010 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_free()
2012 /* is this op for this BE ? */ in dpcm_be_dai_hw_free()
2013 if (!snd_soc_dpcm_can_be_update(fe, be, stream)) in dpcm_be_dai_hw_free()
2017 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_hw_free()
2020 /* do not free hw if this BE is used by other FE */ in dpcm_be_dai_hw_free()
2021 if (be->dpcm[stream].users > 1) in dpcm_be_dai_hw_free()
2024 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_free()
2025 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && in dpcm_be_dai_hw_free()
2026 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_hw_free()
2027 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED) && in dpcm_be_dai_hw_free()
2028 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_hw_free()
2029 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) in dpcm_be_dai_hw_free()
2032 dev_dbg(be->dev, "ASoC: hw_free BE %s\n", in dpcm_be_dai_hw_free()
2033 be->dai_link->name); in dpcm_be_dai_hw_free()
2035 __soc_pcm_hw_free(be, be_substream); in dpcm_be_dai_hw_free()
2037 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; in dpcm_be_dai_hw_free()
2067 struct snd_soc_pcm_runtime *be; in dpcm_be_dai_hw_params() local
2075 be = dpcm->be; in dpcm_be_dai_hw_params()
2076 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_params()
2078 /* is this op for this BE ? */ in dpcm_be_dai_hw_params()
2079 if (!snd_soc_dpcm_can_be_update(fe, be, stream)) in dpcm_be_dai_hw_params()
2087 ret = snd_soc_link_be_hw_params_fixup(be, &hw_params); in dpcm_be_dai_hw_params()
2091 /* copy the fixed-up hw params for BE dai */ in dpcm_be_dai_hw_params()
2092 memcpy(&be->dpcm[stream].hw_params, &hw_params, in dpcm_be_dai_hw_params()
2096 if (!snd_soc_dpcm_can_be_params(fe, be, stream)) in dpcm_be_dai_hw_params()
2099 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_be_dai_hw_params()
2100 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_params()
2101 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE)) in dpcm_be_dai_hw_params()
2104 dev_dbg(be->dev, "ASoC: hw_params BE %s\n", in dpcm_be_dai_hw_params()
2105 be->dai_link->name); in dpcm_be_dai_hw_params()
2111 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_PARAMS; in dpcm_be_dai_hw_params()
2117 __func__, be->dai_link->name, ret); in dpcm_be_dai_hw_params()
2121 be = dpcm->be; in dpcm_be_dai_hw_params()
2122 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_params()
2124 if (!snd_soc_dpcm_can_be_update(fe, be, stream)) in dpcm_be_dai_hw_params()
2128 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_hw_params()
2131 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_be_dai_hw_params()
2132 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_params()
2133 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_hw_params()
2134 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) in dpcm_be_dai_hw_params()
2137 __soc_pcm_hw_free(be, be_substream); in dpcm_be_dai_hw_params()
2179 struct snd_soc_pcm_runtime *be; in dpcm_be_dai_trigger() local
2188 be = dpcm->be; in dpcm_be_dai_trigger()
2189 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_trigger()
2193 /* is this op for this BE ? */ in dpcm_be_dai_trigger()
2194 if (!snd_soc_dpcm_can_be_update(fe, be, stream)) in dpcm_be_dai_trigger()
2197 dev_dbg(be->dev, "ASoC: trigger BE %s cmd %d\n", in dpcm_be_dai_trigger()
2198 be->dai_link->name, cmd); in dpcm_be_dai_trigger()
2202 if (!be->dpcm[stream].be_start && in dpcm_be_dai_trigger()
2203 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && in dpcm_be_dai_trigger()
2204 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_trigger()
2205 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2208 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2209 if (be->dpcm[stream].be_start != 1) in dpcm_be_dai_trigger()
2212 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_PAUSED) in dpcm_be_dai_trigger()
2219 be->dpcm[stream].be_start--; in dpcm_be_dai_trigger()
2223 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
2226 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) in dpcm_be_dai_trigger()
2229 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2230 if (be->dpcm[stream].be_start != 1) in dpcm_be_dai_trigger()
2235 be->dpcm[stream].be_start--; in dpcm_be_dai_trigger()
2239 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
2242 if (!be->dpcm[stream].be_start && in dpcm_be_dai_trigger()
2243 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) && in dpcm_be_dai_trigger()
2244 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2248 be->dpcm[stream].be_pause--; in dpcm_be_dai_trigger()
2250 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2251 if (be->dpcm[stream].be_start != 1) in dpcm_be_dai_trigger()
2256 be->dpcm[stream].be_start--; in dpcm_be_dai_trigger()
2260 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
2263 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) && in dpcm_be_dai_trigger()
2264 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2267 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2268 be->dpcm[stream].be_start--; in dpcm_be_dai_trigger()
2270 if (be->dpcm[stream].be_start != 0) in dpcm_be_dai_trigger()
2277 be->dpcm[stream].be_pause--; in dpcm_be_dai_trigger()
2280 if (be->dpcm[stream].be_pause != 0) in dpcm_be_dai_trigger()
2286 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2287 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2290 be->dpcm[stream].be_pause++; in dpcm_be_dai_trigger()
2295 if (be->dpcm[stream].be_pause != 0) in dpcm_be_dai_trigger()
2296 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PAUSED; in dpcm_be_dai_trigger()
2298 be->dpcm[stream].state = SND_SOC_DPCM_STATE_STOP; in dpcm_be_dai_trigger()
2302 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2305 be->dpcm[stream].be_start--; in dpcm_be_dai_trigger()
2306 if (be->dpcm[stream].be_start != 0) in dpcm_be_dai_trigger()
2311 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2315 be->dpcm[stream].state = SND_SOC_DPCM_STATE_SUSPEND; in dpcm_be_dai_trigger()
2318 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2322 be->dpcm[stream].be_pause++; in dpcm_be_dai_trigger()
2324 be->dpcm[stream].be_start--; in dpcm_be_dai_trigger()
2325 if (be->dpcm[stream].be_start != 0) in dpcm_be_dai_trigger()
2330 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2334 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PAUSED; in dpcm_be_dai_trigger()
2466 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_prepare() local
2468 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_prepare()
2470 /* is this op for this BE ? */ in dpcm_be_dai_prepare()
2471 if (!snd_soc_dpcm_can_be_update(fe, be, stream)) in dpcm_be_dai_prepare()
2474 if (!snd_soc_dpcm_can_be_prepared(fe, be, stream)) in dpcm_be_dai_prepare()
2477 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_prepare()
2478 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_prepare()
2479 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND) && in dpcm_be_dai_prepare()
2480 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_prepare()
2483 dev_dbg(be->dev, "ASoC: prepare BE %s\n", in dpcm_be_dai_prepare()
2484 be->dai_link->name); in dpcm_be_dai_prepare()
2486 ret = __soc_pcm_prepare(be, be_substream); in dpcm_be_dai_prepare()
2490 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PREPARE; in dpcm_be_dai_prepare()
2550 /* run the stream event for each BE */ in dpcm_run_update_shutdown()
2564 /* Only start the BE if the FE is ready */ in dpcm_run_update_startup()
2573 /* startup must always be called for new BEs */ in dpcm_run_update_startup()
2594 /* run the stream event for each BE */ in dpcm_run_update_startup()
2615 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_run_update_startup() local
2617 /* is this op for this BE ? */ in dpcm_run_update_startup()
2618 if (!snd_soc_dpcm_can_be_update(fe, be, stream)) in dpcm_run_update_startup()
2621 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_CLOSE || in dpcm_run_update_startup()
2622 be->dpcm[stream].state == SND_SOC_DPCM_STATE_NEW) in dpcm_run_update_startup()
2668 * Find the corresponding BE DAIs that source or sink audio to this in soc_dpcm_fe_runtime_update()
2765 /* calculate valid and active FE <-> BE dpcms */ in dpcm_fe_dai_open()
2825 * It should be checked, but it breaks compatibility. in soc_get_playback_capture()
2829 * Codec capture validation check will be fail, but system should allow capture in soc_get_playback_capture()
2990 /* get the substream for this BE */
2992 snd_soc_dpcm_get_substream(struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_get_substream() argument
2994 return be->pcm->streams[stream].substream; in snd_soc_dpcm_get_substream()