Lines Matching refs:be

161 		struct snd_soc_pcm_runtime *be = dpcm->be;  in dpcm_dapm_stream_event()  local
163 dev_dbg(be->dev, "ASoC: BE %s event %d dir %d\n", in dpcm_dapm_stream_event()
164 be->dai_link->name, event, dir); in dpcm_dapm_stream_event()
166 snd_soc_dapm_stream_event(be, dir, event); in dpcm_dapm_stream_event()
1074 struct snd_soc_pcm_runtime *be, int stream) in dpcm_be_connect() argument
1080 if (dpcm->be == be && dpcm->fe == fe) in dpcm_be_connect()
1088 dpcm->be = be; in dpcm_be_connect()
1090 be->dpcm[stream].runtime = fe->dpcm[stream].runtime; in dpcm_be_connect()
1093 list_add(&dpcm->list_fe, &be->dpcm[stream].fe_clients); in dpcm_be_connect()
1097 stream ? "<-" : "->", be->dai_link->name); in dpcm_be_connect()
1101 dpcm->debugfs_state = debugfs_create_u32(be->dai_link->name, 0644, in dpcm_be_connect()
1109 struct snd_soc_pcm_runtime *be, int stream) in dpcm_be_reparent() argument
1115 if (!be->dpcm[stream].users) in dpcm_be_reparent()
1118 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_reparent()
1120 list_for_each_entry(dpcm, &be->dpcm[stream].fe_clients, list_fe) { in dpcm_be_reparent()
1127 stream ? "<-" : "->", dpcm->be->dai_link->name); in dpcm_be_reparent()
1143 dpcm->be->dai_link->name); in dpcm_be_disconnect()
1150 stream ? "<-" : "->", dpcm->be->dai_link->name); in dpcm_be_disconnect()
1153 dpcm_be_reparent(fe, dpcm->be, stream); in dpcm_be_disconnect()
1168 struct snd_soc_pcm_runtime *be; in dpcm_get_be() local
1173 be = &card->rtd[i]; in dpcm_get_be()
1175 if (!be->dai_link->no_pcm) in dpcm_get_be()
1178 if (be->cpu_dai->playback_widget == widget) in dpcm_get_be()
1179 return be; in dpcm_get_be()
1181 for (j = 0; j < be->num_codecs; j++) { in dpcm_get_be()
1182 struct snd_soc_dai *dai = be->codec_dais[j]; in dpcm_get_be()
1184 return be; in dpcm_get_be()
1190 be = &card->rtd[i]; in dpcm_get_be()
1192 if (!be->dai_link->no_pcm) in dpcm_get_be()
1195 if (be->cpu_dai->capture_widget == widget) in dpcm_get_be()
1196 return be; in dpcm_get_be()
1198 for (j = 0; j < be->num_codecs; j++) { in dpcm_get_be()
1199 struct snd_soc_dai *dai = be->codec_dais[j]; in dpcm_get_be()
1201 return be; in dpcm_get_be()
1268 widget = dai_get_widget(dpcm->be->cpu_dai, stream); in dpcm_prune_paths()
1275 for (i = 0; i < dpcm->be->num_codecs; i++) { in dpcm_prune_paths()
1276 struct snd_soc_dai *dai = dpcm->be->codec_dais[i]; in dpcm_prune_paths()
1286 dpcm->be->dai_link->name, fe->dai_link->name); in dpcm_prune_paths()
1288 dpcm->be->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE; in dpcm_prune_paths()
1301 struct snd_soc_pcm_runtime *be; in dpcm_add_paths() local
1316 be = dpcm_get_be(card, list->widgets[i], stream); in dpcm_add_paths()
1317 if (!be) { in dpcm_add_paths()
1324 if (!be->dai_link->no_pcm) in dpcm_add_paths()
1332 err = dpcm_be_connect(fe, be, stream); in dpcm_add_paths()
1341 be->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE; in dpcm_add_paths()
1367 dpcm->be->dpcm[stream].runtime_update = in dpcm_clear_pending_state()
1379 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_startup_unwind() local
1381 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_startup_unwind()
1383 if (be->dpcm[stream].users == 0) in dpcm_be_dai_startup_unwind()
1384 dev_err(be->dev, "ASoC: no users %s at close - state %d\n", in dpcm_be_dai_startup_unwind()
1386 be->dpcm[stream].state); in dpcm_be_dai_startup_unwind()
1388 if (--be->dpcm[stream].users != 0) in dpcm_be_dai_startup_unwind()
1391 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) in dpcm_be_dai_startup_unwind()
1396 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_startup_unwind()
1408 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_startup() local
1410 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_startup()
1413 dev_err(be->dev, "ASoC: no backend %s stream\n", in dpcm_be_dai_startup()
1419 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_startup()
1423 if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) in dpcm_be_dai_startup()
1424 dev_err(be->dev, "ASoC: too many users %s at open %d\n", in dpcm_be_dai_startup()
1426 be->dpcm[stream].state); in dpcm_be_dai_startup()
1428 if (be->dpcm[stream].users++ != 0) in dpcm_be_dai_startup()
1431 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_NEW) && in dpcm_be_dai_startup()
1432 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) in dpcm_be_dai_startup()
1435 dev_dbg(be->dev, "ASoC: open %s BE %s\n", in dpcm_be_dai_startup()
1436 stream ? "capture" : "playback", be->dai_link->name); in dpcm_be_dai_startup()
1438 be_substream->runtime = be->dpcm[stream].runtime; in dpcm_be_dai_startup()
1441 dev_err(be->dev, "ASoC: BE open failed %d\n", err); in dpcm_be_dai_startup()
1442 be->dpcm[stream].users--; in dpcm_be_dai_startup()
1443 if (be->dpcm[stream].users < 0) in dpcm_be_dai_startup()
1444 dev_err(be->dev, "ASoC: no users %s at unwind %d\n", in dpcm_be_dai_startup()
1446 be->dpcm[stream].state); in dpcm_be_dai_startup()
1448 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_startup()
1452 be->dpcm[stream].state = SND_SOC_DPCM_STATE_OPEN; in dpcm_be_dai_startup()
1461 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_startup() local
1463 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_startup()
1465 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_startup()
1468 if (be->dpcm[stream].users == 0) in dpcm_be_dai_startup()
1469 dev_err(be->dev, "ASoC: no users %s at close %d\n", in dpcm_be_dai_startup()
1471 be->dpcm[stream].state); in dpcm_be_dai_startup()
1473 if (--be->dpcm[stream].users != 0) in dpcm_be_dai_startup()
1476 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) in dpcm_be_dai_startup()
1481 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_startup()
1582 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_shutdown() local
1584 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_shutdown()
1587 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_shutdown()
1590 if (be->dpcm[stream].users == 0) in dpcm_be_dai_shutdown()
1591 dev_err(be->dev, "ASoC: no users %s at close - state %d\n", in dpcm_be_dai_shutdown()
1593 be->dpcm[stream].state); in dpcm_be_dai_shutdown()
1595 if (--be->dpcm[stream].users != 0) in dpcm_be_dai_shutdown()
1598 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_shutdown()
1599 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN)) in dpcm_be_dai_shutdown()
1602 dev_dbg(be->dev, "ASoC: close BE %s\n", in dpcm_be_dai_shutdown()
1608 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_shutdown()
1644 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_hw_free() local
1646 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_free()
1649 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_free()
1653 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_hw_free()
1657 if (be->dpcm[stream].users > 1) in dpcm_be_dai_hw_free()
1660 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_free()
1661 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && in dpcm_be_dai_hw_free()
1662 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_hw_free()
1663 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED) && in dpcm_be_dai_hw_free()
1664 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_hw_free()
1665 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) in dpcm_be_dai_hw_free()
1668 dev_dbg(be->dev, "ASoC: hw_free BE %s\n", in dpcm_be_dai_hw_free()
1673 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; in dpcm_be_dai_hw_free()
1713 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_hw_params() local
1715 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_params()
1718 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_params()
1722 if (!snd_soc_dpcm_can_be_params(fe, be, stream)) in dpcm_be_dai_hw_params()
1725 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_be_dai_hw_params()
1726 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_params()
1727 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE)) in dpcm_be_dai_hw_params()
1730 dev_dbg(be->dev, "ASoC: hw_params BE %s\n", in dpcm_be_dai_hw_params()
1738 if (be->dai_link->be_hw_params_fixup) { in dpcm_be_dai_hw_params()
1739 ret = be->dai_link->be_hw_params_fixup(be, in dpcm_be_dai_hw_params()
1742 dev_err(be->dev, in dpcm_be_dai_hw_params()
1751 dev_err(dpcm->be->dev, in dpcm_be_dai_hw_params()
1756 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_PARAMS; in dpcm_be_dai_hw_params()
1763 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_hw_params() local
1765 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_params()
1767 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_params()
1771 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_hw_params()
1774 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_be_dai_hw_params()
1775 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_params()
1776 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_hw_params()
1777 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) in dpcm_be_dai_hw_params()
1826 dev_dbg(dpcm->be->dev, "ASoC: trigger BE %s cmd %d\n", in dpcm_do_trigger()
1831 dev_err(dpcm->be->dev,"ASoC: trigger BE failed %d\n", ret); in dpcm_do_trigger()
1844 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_trigger() local
1846 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_trigger()
1849 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_trigger()
1854 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && in dpcm_be_dai_trigger()
1855 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) in dpcm_be_dai_trigger()
1862 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
1865 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) in dpcm_be_dai_trigger()
1872 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
1875 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
1882 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
1885 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
1888 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_trigger()
1895 be->dpcm[stream].state = SND_SOC_DPCM_STATE_STOP; in dpcm_be_dai_trigger()
1898 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
1901 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_trigger()
1908 be->dpcm[stream].state = SND_SOC_DPCM_STATE_SUSPEND; in dpcm_be_dai_trigger()
1911 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
1914 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_trigger()
1921 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PAUSED; in dpcm_be_dai_trigger()
2028 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_be_dai_prepare() local
2030 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_prepare()
2033 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_prepare()
2036 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_prepare()
2037 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) in dpcm_be_dai_prepare()
2040 dev_dbg(be->dev, "ASoC: prepare BE %s\n", in dpcm_be_dai_prepare()
2045 dev_err(be->dev, "ASoC: backend prepare failed %d\n", in dpcm_be_dai_prepare()
2050 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PREPARE; in dpcm_be_dai_prepare()
2226 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_run_update_startup() local
2227 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_run_update_startup()
2368 struct snd_soc_pcm_runtime *be = dpcm->be; in soc_dpcm_be_digital_mute() local
2371 if (be->dai_link->ignore_suspend) in soc_dpcm_be_digital_mute()
2374 for (i = 0; i < be->num_codecs; i++) { in soc_dpcm_be_digital_mute()
2375 struct snd_soc_dai *dai = be->codec_dais[i]; in soc_dpcm_be_digital_mute()
2378 dev_dbg(be->dev, "ASoC: BE digital mute %s\n", in soc_dpcm_be_digital_mute()
2379 be->dai_link->name); in soc_dpcm_be_digital_mute()
2592 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_be_can_update() argument
2596 be->dpcm[stream].runtime_update)) in snd_soc_dpcm_be_can_update()
2604 snd_soc_dpcm_get_substream(struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_get_substream() argument
2606 return be->pcm->streams[stream].substream; in snd_soc_dpcm_get_substream()
2612 snd_soc_dpcm_be_get_state(struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_be_get_state() argument
2614 return be->dpcm[stream].state; in snd_soc_dpcm_be_get_state()
2619 void snd_soc_dpcm_be_set_state(struct snd_soc_pcm_runtime *be, in snd_soc_dpcm_be_set_state() argument
2622 be->dpcm[stream].state = state; in snd_soc_dpcm_be_set_state()
2631 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_free_stop() argument
2636 list_for_each_entry(dpcm, &be->dpcm[stream].fe_clients, list_fe) { in snd_soc_dpcm_can_be_free_stop()
2658 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_params() argument
2663 list_for_each_entry(dpcm, &be->dpcm[stream].fe_clients, list_fe) { in snd_soc_dpcm_can_be_params()
2753 struct snd_soc_pcm_runtime *be = dpcm->be; in dpcm_show_state() local
2757 "- %s\n", be->dai_link->name); in dpcm_show_state()
2761 dpcm_state_string(be->dpcm[stream].state)); in dpcm_show_state()
2763 if ((be->dpcm[stream].state >= SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_show_state()
2764 (be->dpcm[stream].state <= SND_SOC_DPCM_STATE_STOP)) in dpcm_show_state()