Lines Matching full:be
37 /* Negative values might be errors */ in _soc_pcm_ret()
143 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_show_state() local
144 params = &be->dpcm[stream].hw_params; in dpcm_show_state()
147 "- %s\n", be->dai_link->name); in dpcm_show_state()
151 dpcm_state_string(be->dpcm[stream].state)); in dpcm_show_state()
153 if ((be->dpcm[stream].state >= SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_show_state()
154 (be->dpcm[stream].state <= SND_SOC_DPCM_STATE_STOP)) in dpcm_show_state()
223 name = kasprintf(GFP_KERNEL, "%s:%s", dpcm->be->dai_link->name, in dpcm_create_debugfs_state()
272 static void dpcm_set_be_update_state(struct snd_soc_pcm_runtime *be, in dpcm_set_be_update_state() argument
275 be->dpcm[stream].runtime_update = state; in dpcm_set_be_update_state()
287 * Should typically be called when a stream is opened.
289 * Must be called with the rtd->card->pcm_mutex being held
306 * @rtd: The ASoC PCM runtime that should be checked.
308 * This function checks whether the power down delay should be ignored for a
354 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_dapm_stream_event() local
356 dev_dbg(be->dev, "ASoC: BE %s event %d dir %d\n", in dpcm_dapm_stream_event()
357 be->dai_link->name, event, dir); in dpcm_dapm_stream_event()
360 (be->dpcm[dir].users >= 1)) in dpcm_dapm_stream_event()
363 snd_soc_dapm_stream_event(be, dir, event); in dpcm_dapm_stream_event()
622 * chan min/max cannot be enforced if there are multiple CODEC DAIs in snd_soc_runtime_calc_hw()
624 * channel allocation be fixed up later in snd_soc_runtime_calc_hw()
643 * have bailed out on a higher level, since there would be no CPU or in soc_pcm_init_runtime_hw()
725 * Called by ALSA when a PCM substream is closed. Private data can be
786 * then initialized and any private data can be allocated. This also calls
865 * rate, etc. This function is non atomic and can be called multiple times,
951 /* clear the corresponding DAIs parameters when going to be inactive */ in soc_pcm_hw_clean()
980 * Frees resources allocated by hw_params, can be called multiple times
1002 * function can also be called multiple times and can allocate buffers
1030 * set up transfer direction, it should not need to be in __soc_pcm_hw_params()
1032 * not even be supported by that CODEC. There may be cases in __soc_pcm_hw_params()
1033 * however where a CODEC needs to be set up although it is in __soc_pcm_hw_params()
1214 * the runtime->delay will be updated via snd_soc_pcm_component/dai_delay().
1225 /* should be called *after* snd_soc_pcm_component_pointer() */ in soc_pcm_pointer()
1234 /* connect a FE and BE */
1236 struct snd_soc_pcm_runtime *be, int stream) in dpcm_be_connect() argument
1246 if (dpcm->be == be && dpcm->fe == fe) in dpcm_be_connect()
1251 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_connect()
1254 dev_err(be->dev, "%s: FE is atomic but BE is nonatomic, invalid configuration\n", in dpcm_be_connect()
1259 dev_dbg(be->dev, "FE is nonatomic but BE is not, forcing BE as nonatomic\n"); in dpcm_be_connect()
1267 dpcm->be = be; in dpcm_be_connect()
1272 list_add(&dpcm->list_fe, &be->dpcm[stream].fe_clients); in dpcm_be_connect()
1277 stream ? "<-" : "->", be->dai_link->name); in dpcm_be_connect()
1284 /* reparent a BE onto another FE */
1286 struct snd_soc_pcm_runtime *be, int stream) in dpcm_be_reparent() argument
1291 /* reparent if BE is connected to other FEs */ in dpcm_be_reparent()
1292 if (!be->dpcm[stream].users) in dpcm_be_reparent()
1295 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_reparent()
1299 for_each_dpcm_fe(be, stream, dpcm) { in dpcm_be_reparent()
1306 stream ? "<-" : "->", dpcm->be->dai_link->name); in dpcm_be_reparent()
1314 /* disconnect a BE and FE */
1324 dev_dbg(fe->dev, "ASoC: BE %s disconnect check for %s\n", in dpcm_be_disconnect()
1326 dpcm->be->dai_link->name); in dpcm_be_disconnect()
1333 stream ? "<-" : "->", dpcm->be->dai_link->name); in dpcm_be_disconnect()
1336 dpcm_be_reparent(fe, dpcm->be, stream); in dpcm_be_disconnect()
1352 /* get BE for DAI widget and stream */
1356 struct snd_soc_pcm_runtime *be; in dpcm_get_be() local
1361 dev_dbg(card->dev, "ASoC: find BE for widget %s\n", widget->name); in dpcm_get_be()
1363 for_each_card_rtds(card, be) { in dpcm_get_be()
1365 if (!be->dai_link->no_pcm) in dpcm_get_be()
1368 if (!snd_soc_dpcm_get_substream(be, stream)) in dpcm_get_be()
1371 for_each_rtd_dais(be, i, dai) { in dpcm_get_be()
1374 dev_dbg(card->dev, "ASoC: try BE : %s\n", in dpcm_get_be()
1378 return be; in dpcm_get_be()
1382 /* Widget provided is not a BE */ in dpcm_get_be()
1458 /* is there a valid DAI widget for this BE */ in dpcm_be_is_active()
1459 for_each_rtd_dais(dpcm->be, i, dai) { in dpcm_be_is_active()
1463 * The BE is pruned only if none of the dai in dpcm_be_is_active()
1479 /* Destroy any old FE <--> BE connections */ in dpcm_prune_paths()
1484 dev_dbg(fe->dev, "ASoC: pruning %s BE %s for %s\n", in dpcm_prune_paths()
1486 dpcm->be->dai_link->name, fe->dai_link->name); in dpcm_prune_paths()
1488 dpcm_set_be_update_state(dpcm->be, stream, SND_SOC_DPCM_UPDATE_BE); in dpcm_prune_paths()
1492 dev_dbg(fe->dev, "ASoC: found %d old BE paths for pruning\n", prune); in dpcm_prune_paths()
1501 struct snd_soc_pcm_runtime *be; in dpcm_add_paths() local
1510 /* Create any new FE <--> BE connections */ in dpcm_add_paths()
1526 /* is there a valid BE rtd for this widget */ in dpcm_add_paths()
1527 be = dpcm_get_be(card, widget, stream); in dpcm_add_paths()
1528 if (!be) { in dpcm_add_paths()
1529 dev_dbg(fe->dev, "ASoC: no BE found for %s\n", in dpcm_add_paths()
1537 * already active BE on such systems and ensures the BE DAI in dpcm_add_paths()
1538 * widget is powered ON after hw_params() BE DAI callback. in dpcm_add_paths()
1541 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_NEW) && in dpcm_add_paths()
1542 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_add_paths()
1543 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_add_paths()
1544 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) in dpcm_add_paths()
1547 /* newly connected FE and BE */ in dpcm_add_paths()
1548 err = dpcm_be_connect(fe, be, stream); in dpcm_add_paths()
1557 dpcm_set_be_update_state(be, stream, SND_SOC_DPCM_UPDATE_BE); in dpcm_add_paths()
1561 dev_dbg(fe->dev, "ASoC: found %d new BE paths\n", new); in dpcm_add_paths()
1566 * Find the corresponding BE DAIs that source or sink audio to this
1583 dpcm_set_be_update_state(dpcm->be, stream, SND_SOC_DPCM_UPDATE_NO); in dpcm_clear_pending_state()
1593 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_stop() local
1595 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_stop()
1600 /* is this op for this BE ? */ in dpcm_be_dai_stop()
1601 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_stop()
1604 if (be->dpcm[stream].users == 0) { in dpcm_be_dai_stop()
1605 dev_err(be->dev, "ASoC: no users %s at close - state %d\n", in dpcm_be_dai_stop()
1607 be->dpcm[stream].state); in dpcm_be_dai_stop()
1611 if (--be->dpcm[stream].users != 0) in dpcm_be_dai_stop()
1614 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) { in dpcm_be_dai_stop()
1618 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) { in dpcm_be_dai_stop()
1619 __soc_pcm_hw_free(be, be_substream); in dpcm_be_dai_stop()
1620 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; in dpcm_be_dai_stop()
1624 __soc_pcm_close(be, be_substream); in dpcm_be_dai_stop()
1626 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_stop()
1633 struct snd_soc_pcm_runtime *be; in dpcm_be_dai_startup() local
1637 /* only startup BE DAIs that are either sinks or sources to this FE DAI */ in dpcm_be_dai_startup()
1641 be = dpcm->be; in dpcm_be_dai_startup()
1642 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_startup()
1645 dev_err(be->dev, "ASoC: no backend %s stream\n", in dpcm_be_dai_startup()
1650 /* is this op for this BE ? */ in dpcm_be_dai_startup()
1651 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_startup()
1655 if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) { in dpcm_be_dai_startup()
1656 dev_err(be->dev, "ASoC: too many users %s at open %d\n", in dpcm_be_dai_startup()
1658 be->dpcm[stream].state); in dpcm_be_dai_startup()
1662 if (be->dpcm[stream].users++ != 0) in dpcm_be_dai_startup()
1665 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_NEW) && in dpcm_be_dai_startup()
1666 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) in dpcm_be_dai_startup()
1669 dev_dbg(be->dev, "ASoC: open %s BE %s\n", in dpcm_be_dai_startup()
1670 stream ? "capture" : "playback", be->dai_link->name); in dpcm_be_dai_startup()
1673 err = __soc_pcm_open(be, be_substream); in dpcm_be_dai_startup()
1675 be->dpcm[stream].users--; in dpcm_be_dai_startup()
1676 if (be->dpcm[stream].users < 0) in dpcm_be_dai_startup()
1677 dev_err(be->dev, "ASoC: no users %s at unwind %d\n", in dpcm_be_dai_startup()
1679 be->dpcm[stream].state); in dpcm_be_dai_startup()
1681 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_startup()
1684 be->dpcm[stream].be_start = 0; in dpcm_be_dai_startup()
1685 be->dpcm[stream].state = SND_SOC_DPCM_STATE_OPEN; in dpcm_be_dai_startup()
1744 * It returns merged BE codec format in dpcm_runtime_setup_be_format()
1749 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_runtime_setup_be_format() local
1753 for_each_rtd_codec_dais(be, i, dai) { in dpcm_runtime_setup_be_format()
1780 * It returns merged BE codec channel; in dpcm_runtime_setup_be_chan()
1785 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_runtime_setup_be_chan() local
1790 for_each_rtd_cpu_dais(be, i, dai) { in dpcm_runtime_setup_be_chan()
1804 * chan min/max cannot be enforced if there are multiple CODEC in dpcm_runtime_setup_be_chan()
1807 if (be->dai_link->num_codecs == 1) { in dpcm_runtime_setup_be_chan()
1809 asoc_rtd_to_codec(be, 0), stream); in dpcm_runtime_setup_be_chan()
1828 * It returns merged BE codec channel; in dpcm_runtime_setup_be_rate()
1833 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_runtime_setup_be_rate() local
1838 for_each_rtd_dais(be, i, dai) { in dpcm_runtime_setup_be_rate()
1872 /* apply symmetry for BE */ in dpcm_apply_symmetry()
1874 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_apply_symmetry() local
1876 snd_soc_dpcm_get_substream(be, stream); in dpcm_apply_symmetry()
1971 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_hw_free() local
1973 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_free()
1975 /* is this op for this BE ? */ in dpcm_be_dai_hw_free()
1976 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_free()
1980 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_hw_free()
1983 /* do not free hw if this BE is used by other FE */ in dpcm_be_dai_hw_free()
1984 if (be->dpcm[stream].users > 1) in dpcm_be_dai_hw_free()
1987 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_free()
1988 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && in dpcm_be_dai_hw_free()
1989 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_hw_free()
1990 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED) && in dpcm_be_dai_hw_free()
1991 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_hw_free()
1992 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) in dpcm_be_dai_hw_free()
1995 dev_dbg(be->dev, "ASoC: hw_free BE %s\n", in dpcm_be_dai_hw_free()
1996 be->dai_link->name); in dpcm_be_dai_hw_free()
1998 __soc_pcm_hw_free(be, be_substream); in dpcm_be_dai_hw_free()
2000 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; in dpcm_be_dai_hw_free()
2030 struct snd_soc_pcm_runtime *be; in dpcm_be_dai_hw_params() local
2038 be = dpcm->be; in dpcm_be_dai_hw_params()
2039 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_params()
2041 /* is this op for this BE ? */ in dpcm_be_dai_hw_params()
2042 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_params()
2050 ret = snd_soc_link_be_hw_params_fixup(be, &hw_params); in dpcm_be_dai_hw_params()
2054 /* copy the fixed-up hw params for BE dai */ in dpcm_be_dai_hw_params()
2055 memcpy(&be->dpcm[stream].hw_params, &hw_params, in dpcm_be_dai_hw_params()
2059 if (!snd_soc_dpcm_can_be_params(fe, be, stream)) in dpcm_be_dai_hw_params()
2062 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_be_dai_hw_params()
2063 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_params()
2064 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE)) in dpcm_be_dai_hw_params()
2067 dev_dbg(be->dev, "ASoC: hw_params BE %s\n", in dpcm_be_dai_hw_params()
2068 be->dai_link->name); in dpcm_be_dai_hw_params()
2070 ret = __soc_pcm_hw_params(be, be_substream, &hw_params); in dpcm_be_dai_hw_params()
2074 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_PARAMS; in dpcm_be_dai_hw_params()
2080 __func__, be->dai_link->name, ret); in dpcm_be_dai_hw_params()
2084 be = dpcm->be; in dpcm_be_dai_hw_params()
2085 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_params()
2087 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_params()
2091 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_hw_params()
2094 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_be_dai_hw_params()
2095 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_params()
2096 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_hw_params()
2097 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) in dpcm_be_dai_hw_params()
2100 __soc_pcm_hw_free(be, be_substream); in dpcm_be_dai_hw_params()
2142 struct snd_soc_pcm_runtime *be; in dpcm_be_dai_trigger() local
2151 be = dpcm->be; in dpcm_be_dai_trigger()
2152 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_trigger()
2154 snd_soc_dpcm_stream_lock_irqsave_nested(be, stream, flags); in dpcm_be_dai_trigger()
2156 /* is this op for this BE ? */ in dpcm_be_dai_trigger()
2157 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_trigger()
2160 dev_dbg(be->dev, "ASoC: trigger BE %s cmd %d\n", in dpcm_be_dai_trigger()
2161 be->dai_link->name, cmd); in dpcm_be_dai_trigger()
2165 if (!be->dpcm[stream].be_start && in dpcm_be_dai_trigger()
2166 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && in dpcm_be_dai_trigger()
2167 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_trigger()
2168 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2171 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2172 if (be->dpcm[stream].be_start != 1) in dpcm_be_dai_trigger()
2175 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_PAUSED) in dpcm_be_dai_trigger()
2182 be->dpcm[stream].be_start--; in dpcm_be_dai_trigger()
2186 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
2189 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) in dpcm_be_dai_trigger()
2192 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2193 if (be->dpcm[stream].be_start != 1) in dpcm_be_dai_trigger()
2198 be->dpcm[stream].be_start--; in dpcm_be_dai_trigger()
2202 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
2205 if (!be->dpcm[stream].be_start && in dpcm_be_dai_trigger()
2206 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) && in dpcm_be_dai_trigger()
2207 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2211 be->dpcm[stream].be_pause--; in dpcm_be_dai_trigger()
2213 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2214 if (be->dpcm[stream].be_start != 1) 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_START) && in dpcm_be_dai_trigger()
2227 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2230 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2231 be->dpcm[stream].be_start--; in dpcm_be_dai_trigger()
2233 if (be->dpcm[stream].be_start != 0) in dpcm_be_dai_trigger()
2240 be->dpcm[stream].be_pause--; in dpcm_be_dai_trigger()
2243 if (be->dpcm[stream].be_pause != 0) in dpcm_be_dai_trigger()
2249 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2250 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2253 be->dpcm[stream].be_pause++; in dpcm_be_dai_trigger()
2258 if (be->dpcm[stream].be_pause != 0) in dpcm_be_dai_trigger()
2259 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PAUSED; in dpcm_be_dai_trigger()
2261 be->dpcm[stream].state = SND_SOC_DPCM_STATE_STOP; in dpcm_be_dai_trigger()
2265 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()
2269 if (be->dpcm[stream].be_start != 0) in dpcm_be_dai_trigger()
2274 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2278 be->dpcm[stream].state = SND_SOC_DPCM_STATE_SUSPEND; in dpcm_be_dai_trigger()
2281 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2285 be->dpcm[stream].be_pause++; in dpcm_be_dai_trigger()
2287 be->dpcm[stream].be_start--; in dpcm_be_dai_trigger()
2288 if (be->dpcm[stream].be_start != 0) in dpcm_be_dai_trigger()
2293 be->dpcm[stream].be_start++; in dpcm_be_dai_trigger()
2297 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PAUSED; in dpcm_be_dai_trigger()
2301 snd_soc_dpcm_stream_unlock_irqrestore(be, stream, flags); in dpcm_be_dai_trigger()
2452 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_prepare() local
2454 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_prepare()
2456 /* is this op for this BE ? */ in dpcm_be_dai_prepare()
2457 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_prepare()
2460 if (!snd_soc_dpcm_can_be_prepared(fe, be, stream)) in dpcm_be_dai_prepare()
2463 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_prepare()
2464 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_prepare()
2465 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND) && in dpcm_be_dai_prepare()
2466 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_prepare()
2469 dev_dbg(be->dev, "ASoC: prepare BE %s\n", in dpcm_be_dai_prepare()
2470 be->dai_link->name); in dpcm_be_dai_prepare()
2472 ret = __soc_pcm_prepare(be, be_substream); in dpcm_be_dai_prepare()
2476 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PREPARE; in dpcm_be_dai_prepare()
2545 /* call bespoke trigger - FE takes care of all BE triggers */ in dpcm_run_update_shutdown()
2561 /* run the stream event for each BE */ in dpcm_run_update_shutdown()
2578 /* Only start the BE if the FE is ready */ in dpcm_run_update_startup()
2587 /* startup must always be called for new BEs */ in dpcm_run_update_startup()
2608 /* run the stream event for each BE */ in dpcm_run_update_startup()
2617 /* call trigger on the frontend - FE takes care of all BE triggers */ in dpcm_run_update_startup()
2643 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_run_update_startup() local
2645 /* is this op for this BE ? */ in dpcm_run_update_startup()
2646 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_run_update_startup()
2649 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_CLOSE || in dpcm_run_update_startup()
2650 be->dpcm[stream].state == SND_SOC_DPCM_STATE_NEW) in dpcm_run_update_startup()
2787 /* calculate valid and active FE <-> BE dpcms */ in dpcm_fe_dai_open()
3051 /* is the current PCM operation for this BE ? */
3053 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_be_can_update() argument
3057 be->dpcm[stream].runtime_update)) in snd_soc_dpcm_be_can_update()
3063 /* get the substream for this BE */
3065 snd_soc_dpcm_get_substream(struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_get_substream() argument
3067 return be->pcm->streams[stream].substream; in snd_soc_dpcm_get_substream()
3072 struct snd_soc_pcm_runtime *be, in snd_soc_dpcm_check_state() argument
3082 for_each_dpcm_fe(be, stream, dpcm) { in snd_soc_dpcm_check_state()
3096 /* it's safe to do this BE DAI */ in snd_soc_dpcm_check_state()
3101 * We can only hw_free, stop, pause or suspend a BE DAI if any of it's FE
3105 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_free_stop() argument
3113 return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); in snd_soc_dpcm_can_be_free_stop()
3118 * We can only change hw params a BE DAI if any of it's FE are not prepared,
3122 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_params() argument
3131 return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); in snd_soc_dpcm_can_be_params()
3136 * We can only prepare a BE DAI if any of it's FE are not prepared,
3140 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_prepared() argument
3148 return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); in snd_soc_dpcm_can_be_prepared()