• Home
  • Raw
  • Download

Lines Matching refs:stream

44 						int stream)  in snd_soc_dpcm_stream_lock_irq()  argument
46 snd_pcm_stream_lock_irq(snd_soc_dpcm_get_substream(rtd, stream)); in snd_soc_dpcm_stream_lock_irq()
49 #define snd_soc_dpcm_stream_lock_irqsave_nested(rtd, stream, flags) \ argument
50 snd_pcm_stream_lock_irqsave_nested(snd_soc_dpcm_get_substream(rtd, stream), flags)
53 int stream) in snd_soc_dpcm_stream_unlock_irq() argument
55 snd_pcm_stream_unlock_irq(snd_soc_dpcm_get_substream(rtd, stream)); in snd_soc_dpcm_stream_unlock_irq()
58 #define snd_soc_dpcm_stream_unlock_irqrestore(rtd, stream, flags) \ argument
59 snd_pcm_stream_unlock_irqrestore(snd_soc_dpcm_get_substream(rtd, stream), flags)
102 int stream, char *buf, size_t size) in dpcm_show_state() argument
104 struct snd_pcm_hw_params *params = &fe->dpcm[stream].hw_params; in dpcm_show_state()
111 stream ? "Capture" : "Playback"); in dpcm_show_state()
114 dpcm_state_string(fe->dpcm[stream].state)); in dpcm_show_state()
116 if ((fe->dpcm[stream].state >= SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_show_state()
117 (fe->dpcm[stream].state <= SND_SOC_DPCM_STATE_STOP)) in dpcm_show_state()
128 if (list_empty(&fe->dpcm[stream].be_clients)) { in dpcm_show_state()
134 for_each_dpcm_be(fe, stream, dpcm) { in dpcm_show_state()
143 dpcm_state_string(be->dpcm[stream].state)); in dpcm_show_state()
145 if ((be->dpcm[stream].state >= SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_show_state()
146 (be->dpcm[stream].state <= SND_SOC_DPCM_STATE_STOP)) in dpcm_show_state()
163 int stream; in dpcm_state_read_file() local
177 for_each_pcm_streams(stream) in dpcm_state_read_file()
178 if (snd_soc_dai_stream_valid(asoc_rtd_to_cpu(fe, 0), stream)) in dpcm_state_read_file()
179 offset += dpcm_show_state(fe, stream, in dpcm_state_read_file()
211 static void dpcm_create_debugfs_state(struct snd_soc_dpcm *dpcm, int stream) in dpcm_create_debugfs_state() argument
216 stream ? "capture" : "playback"); in dpcm_create_debugfs_state()
233 int stream) in dpcm_create_debugfs_state() argument
249 int stream, enum snd_soc_dpcm_update state) in dpcm_set_fe_update_state() argument
252 snd_soc_dpcm_get_substream(fe, stream); in dpcm_set_fe_update_state()
254 snd_soc_dpcm_stream_lock_irq(fe, stream); in dpcm_set_fe_update_state()
255 if (state == SND_SOC_DPCM_UPDATE_NO && fe->dpcm[stream].trigger_pending) { in dpcm_set_fe_update_state()
257 fe->dpcm[stream].trigger_pending - 1); in dpcm_set_fe_update_state()
258 fe->dpcm[stream].trigger_pending = 0; in dpcm_set_fe_update_state()
260 fe->dpcm[stream].runtime_update = state; in dpcm_set_fe_update_state()
261 snd_soc_dpcm_stream_unlock_irq(fe, stream); in dpcm_set_fe_update_state()
265 int stream, enum snd_soc_dpcm_update state) in dpcm_set_be_update_state() argument
267 be->dpcm[stream].runtime_update = state; in dpcm_set_be_update_state()
284 int stream, int action) in snd_soc_runtime_action() argument
292 snd_soc_dai_action(dai, stream, action); in snd_soc_runtime_action()
484 int stream = substream->stream; in soc_pcm_apply_msb() local
489 struct snd_soc_pcm_stream *pcm_codec = snd_soc_dai_get_pcm_stream(codec_dai, stream); in soc_pcm_apply_msb()
499 struct snd_soc_pcm_stream *pcm_cpu = snd_soc_dai_get_pcm_stream(cpu_dai, stream); in soc_pcm_apply_msb()
558 struct snd_pcm_hardware *hw, int stream) in snd_soc_runtime_calc_hw() argument
578 if (!snd_soc_dai_stream_valid(cpu_dai, stream)) in snd_soc_runtime_calc_hw()
581 cpu_stream = snd_soc_dai_get_pcm_stream(cpu_dai, stream); in snd_soc_runtime_calc_hw()
599 if (!snd_soc_dai_stream_valid(codec_dai, stream)) in snd_soc_runtime_calc_hw()
602 codec_stream = snd_soc_dai_get_pcm_stream(codec_dai, stream); in snd_soc_runtime_calc_hw()
638 snd_soc_runtime_calc_hw(rtd, hw, substream->stream); in soc_pcm_init_runtime_hw()
691 snd_soc_runtime_deactivate(rtd, substream->stream); in soc_pcm_clean()
827 snd_soc_runtime_activate(rtd, substream->stream); in __soc_pcm_open()
886 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && in __soc_pcm_prepare()
892 snd_soc_dapm_stream_event(rtd, substream->stream, in __soc_pcm_prepare()
896 snd_soc_dai_digital_mute(dai, 0, substream->stream); in __soc_pcm_prepare()
938 int active = snd_soc_dai_stream_active(dai, substream->stream); in soc_pcm_hw_clean()
944 snd_soc_dai_digital_mute(dai, 1, substream->stream); in soc_pcm_hw_clean()
948 snd_soc_dapm_stream_stop(rtd, substream->stream); in soc_pcm_hw_clean()
958 if (!snd_soc_dai_stream_valid(dai, substream->stream)) in soc_pcm_hw_clean()
1028 if (!snd_soc_dai_stream_valid(codec_dai, substream->stream)) in __soc_pcm_hw_params()
1035 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && in __soc_pcm_hw_params()
1040 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE && in __soc_pcm_hw_params()
1059 if (!snd_soc_dai_stream_valid(cpu_dai, substream->stream)) in __soc_pcm_hw_params()
1208 struct snd_soc_pcm_runtime *be, int stream) in dpcm_be_connect() argument
1217 for_each_dpcm_be(fe, stream, dpcm) { in dpcm_be_connect()
1222 fe_substream = snd_soc_dpcm_get_substream(fe, stream); in dpcm_be_connect()
1223 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_connect()
1242 be->dpcm[stream].runtime = fe->dpcm[stream].runtime; in dpcm_be_connect()
1244 snd_soc_dpcm_stream_lock_irq(fe, stream); in dpcm_be_connect()
1245 list_add(&dpcm->list_be, &fe->dpcm[stream].be_clients); in dpcm_be_connect()
1246 list_add(&dpcm->list_fe, &be->dpcm[stream].fe_clients); in dpcm_be_connect()
1247 snd_soc_dpcm_stream_unlock_irq(fe, stream); in dpcm_be_connect()
1250 stream ? "capture" : "playback", fe->dai_link->name, in dpcm_be_connect()
1251 stream ? "<-" : "->", be->dai_link->name); in dpcm_be_connect()
1253 dpcm_create_debugfs_state(dpcm, stream); in dpcm_be_connect()
1260 struct snd_soc_pcm_runtime *be, int stream) in dpcm_be_reparent() argument
1266 if (!be->dpcm[stream].users) in dpcm_be_reparent()
1269 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_reparent()
1273 for_each_dpcm_fe(be, stream, dpcm) { in dpcm_be_reparent()
1278 stream ? "capture" : "playback", in dpcm_be_reparent()
1280 stream ? "<-" : "->", dpcm->be->dai_link->name); in dpcm_be_reparent()
1282 fe_substream = snd_soc_dpcm_get_substream(dpcm->fe, stream); in dpcm_be_reparent()
1289 void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream) in dpcm_be_disconnect() argument
1296 snd_soc_dpcm_stream_lock_irq(fe, stream); in dpcm_be_disconnect()
1297 for_each_dpcm_be_safe(fe, stream, dpcm, d) { in dpcm_be_disconnect()
1299 stream ? "capture" : "playback", in dpcm_be_disconnect()
1306 stream ? "capture" : "playback", fe->dai_link->name, in dpcm_be_disconnect()
1307 stream ? "<-" : "->", dpcm->be->dai_link->name); in dpcm_be_disconnect()
1310 dpcm_be_reparent(fe, dpcm->be, stream); in dpcm_be_disconnect()
1315 snd_soc_dpcm_stream_unlock_irq(fe, stream); in dpcm_be_disconnect()
1328 struct snd_soc_dapm_widget *widget, int stream) in dpcm_get_be() argument
1342 if (!snd_soc_dpcm_get_substream(be, stream)) in dpcm_get_be()
1346 w = snd_soc_dai_get_widget(dai, stream); in dpcm_get_be()
1378 int stream; in dpcm_end_walk_at_be() local
1382 stream = SNDRV_PCM_STREAM_PLAYBACK; in dpcm_end_walk_at_be()
1384 stream = SNDRV_PCM_STREAM_CAPTURE; in dpcm_end_walk_at_be()
1386 rtd = dpcm_get_be(card, widget, stream); in dpcm_end_walk_at_be()
1394 int stream, struct snd_soc_dapm_widget_list **list) in dpcm_path_get() argument
1406 paths = snd_soc_dapm_dai_get_connected_widgets(cpu_dai, stream, list, in dpcm_path_get()
1412 stream ? "capture" : "playback"); in dpcm_path_get()
1415 stream ? "capture" : "playback"); in dpcm_path_get()
1425 static bool dpcm_be_is_active(struct snd_soc_dpcm *dpcm, int stream, in dpcm_be_is_active() argument
1433 struct snd_soc_dapm_widget *widget = snd_soc_dai_get_widget(dai, stream); in dpcm_be_is_active()
1446 static int dpcm_prune_paths(struct snd_soc_pcm_runtime *fe, int stream, in dpcm_prune_paths() argument
1453 for_each_dpcm_be(fe, stream, dpcm) { in dpcm_prune_paths()
1454 if (dpcm_be_is_active(dpcm, stream, *list_)) in dpcm_prune_paths()
1458 stream ? "capture" : "playback", in dpcm_prune_paths()
1461 dpcm_set_be_update_state(dpcm->be, stream, SND_SOC_DPCM_UPDATE_BE); in dpcm_prune_paths()
1469 static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, in dpcm_add_paths() argument
1483 if (stream != SNDRV_PCM_STREAM_PLAYBACK) in dpcm_add_paths()
1487 if (stream != SNDRV_PCM_STREAM_CAPTURE) in dpcm_add_paths()
1495 be = dpcm_get_be(card, widget, stream); in dpcm_add_paths()
1503 if (!fe->dpcm[stream].runtime && !fe->fe_compr) in dpcm_add_paths()
1507 err = dpcm_be_connect(fe, be, stream); in dpcm_add_paths()
1516 dpcm_set_be_update_state(be, stream, SND_SOC_DPCM_UPDATE_BE); in dpcm_add_paths()
1529 int stream, struct snd_soc_dapm_widget_list **list, int new) in dpcm_process_paths() argument
1532 return dpcm_add_paths(fe, stream, list); in dpcm_process_paths()
1534 return dpcm_prune_paths(fe, stream, list); in dpcm_process_paths()
1537 void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream) in dpcm_clear_pending_state() argument
1541 for_each_dpcm_be(fe, stream, dpcm) in dpcm_clear_pending_state()
1542 dpcm_set_be_update_state(dpcm->be, stream, SND_SOC_DPCM_UPDATE_NO); in dpcm_clear_pending_state()
1545 void dpcm_be_dai_stop(struct snd_soc_pcm_runtime *fe, int stream, in dpcm_be_dai_stop() argument
1551 for_each_dpcm_be(fe, stream, dpcm) { in dpcm_be_dai_stop()
1554 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_stop()
1560 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_stop()
1563 if (be->dpcm[stream].users == 0) { in dpcm_be_dai_stop()
1565 stream ? "capture" : "playback", in dpcm_be_dai_stop()
1566 be->dpcm[stream].state); in dpcm_be_dai_stop()
1570 if (--be->dpcm[stream].users != 0) in dpcm_be_dai_stop()
1573 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) { in dpcm_be_dai_stop()
1577 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) { in dpcm_be_dai_stop()
1579 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; in dpcm_be_dai_stop()
1585 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_stop()
1589 int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream) in dpcm_be_dai_startup() argument
1596 for_each_dpcm_be(fe, stream, dpcm) { in dpcm_be_dai_startup()
1600 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_startup()
1604 stream ? "capture" : "playback"); in dpcm_be_dai_startup()
1609 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_startup()
1613 if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) { in dpcm_be_dai_startup()
1615 stream ? "capture" : "playback", in dpcm_be_dai_startup()
1616 be->dpcm[stream].state); in dpcm_be_dai_startup()
1620 if (be->dpcm[stream].users++ != 0) in dpcm_be_dai_startup()
1623 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_NEW) && in dpcm_be_dai_startup()
1624 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) in dpcm_be_dai_startup()
1628 stream ? "capture" : "playback", be->dai_link->name); in dpcm_be_dai_startup()
1630 be_substream->runtime = be->dpcm[stream].runtime; in dpcm_be_dai_startup()
1633 be->dpcm[stream].users--; in dpcm_be_dai_startup()
1634 if (be->dpcm[stream].users < 0) in dpcm_be_dai_startup()
1636 stream ? "capture" : "playback", in dpcm_be_dai_startup()
1637 be->dpcm[stream].state); in dpcm_be_dai_startup()
1639 be->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_be_dai_startup()
1642 be->dpcm_be_start[stream] = 0; in dpcm_be_dai_startup()
1643 be->dpcm[stream].state = SND_SOC_DPCM_STATE_OPEN; in dpcm_be_dai_startup()
1650 dpcm_be_dai_startup_rollback(fe, stream, dpcm); in dpcm_be_dai_startup()
1664 int stream = substream->stream; in dpcm_runtime_setup_fe() local
1680 if (!snd_soc_dai_stream_valid(dai, stream)) in dpcm_runtime_setup_fe()
1683 cpu_stream = snd_soc_dai_get_pcm_stream(dai, stream); in dpcm_runtime_setup_fe()
1699 int stream = substream->stream; in dpcm_runtime_setup_be_format() local
1709 for_each_dpcm_be(fe, stream, dpcm) { in dpcm_runtime_setup_be_format()
1719 if (!snd_soc_dai_stream_valid(dai, stream)) in dpcm_runtime_setup_be_format()
1722 codec_stream = snd_soc_dai_get_pcm_stream(dai, stream); in dpcm_runtime_setup_be_format()
1735 int stream = substream->stream; in dpcm_runtime_setup_be_chan() local
1745 for_each_dpcm_be(fe, stream, dpcm) { in dpcm_runtime_setup_be_chan()
1756 if (!snd_soc_dai_stream_valid(dai, stream)) in dpcm_runtime_setup_be_chan()
1759 cpu_stream = snd_soc_dai_get_pcm_stream(dai, stream); in dpcm_runtime_setup_be_chan()
1770 asoc_rtd_to_codec(be, 0), stream); in dpcm_runtime_setup_be_chan()
1783 int stream = substream->stream; in dpcm_runtime_setup_be_rate() local
1793 for_each_dpcm_be(fe, stream, dpcm) { in dpcm_runtime_setup_be_rate()
1804 if (!snd_soc_dai_stream_valid(dai, stream)) in dpcm_runtime_setup_be_rate()
1807 pcm = snd_soc_dai_get_pcm_stream(dai, stream); in dpcm_runtime_setup_be_rate()
1815 int stream) in dpcm_apply_symmetry() argument
1834 for_each_dpcm_be(fe, stream, dpcm) { in dpcm_apply_symmetry()
1837 snd_soc_dpcm_get_substream(be, stream); in dpcm_apply_symmetry()
1868 int stream = fe_substream->stream, ret = 0; in dpcm_fe_dai_startup() local
1870 dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE); in dpcm_fe_dai_startup()
1872 ret = dpcm_be_dai_startup(fe, stream); in dpcm_fe_dai_startup()
1883 fe->dpcm[stream].state = SND_SOC_DPCM_STATE_OPEN; in dpcm_fe_dai_startup()
1891 ret = dpcm_apply_symmetry(fe_substream, stream); in dpcm_fe_dai_startup()
1895 dpcm_be_dai_startup_unwind(fe, stream); in dpcm_fe_dai_startup()
1897 dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO); in dpcm_fe_dai_startup()
1908 int stream = substream->stream; in dpcm_fe_dai_shutdown() local
1912 dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE); in dpcm_fe_dai_shutdown()
1915 dpcm_be_dai_shutdown(fe, stream); in dpcm_fe_dai_shutdown()
1923 dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_STOP); in dpcm_fe_dai_shutdown()
1925 fe->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; in dpcm_fe_dai_shutdown()
1926 dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO); in dpcm_fe_dai_shutdown()
1930 void dpcm_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream) in dpcm_be_dai_hw_free() argument
1936 for_each_dpcm_be(fe, stream, dpcm) { in dpcm_be_dai_hw_free()
1940 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_free()
1943 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_free()
1947 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_hw_free()
1951 if (be->dpcm[stream].users > 1) in dpcm_be_dai_hw_free()
1954 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_free()
1955 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && in dpcm_be_dai_hw_free()
1956 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_hw_free()
1957 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED) && in dpcm_be_dai_hw_free()
1958 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_hw_free()
1959 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) in dpcm_be_dai_hw_free()
1967 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; in dpcm_be_dai_hw_free()
1974 int stream = substream->stream; in dpcm_fe_dai_hw_free() local
1977 dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE); in dpcm_fe_dai_hw_free()
1986 dpcm_be_dai_hw_free(fe, stream); in dpcm_fe_dai_hw_free()
1988 fe->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; in dpcm_fe_dai_hw_free()
1989 dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO); in dpcm_fe_dai_hw_free()
1995 int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream) in dpcm_be_dai_hw_params() argument
2002 for_each_dpcm_be(fe, stream, dpcm) { in dpcm_be_dai_hw_params()
2004 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_params()
2007 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_params()
2011 memcpy(&dpcm->hw_params, &fe->dpcm[stream].hw_params, in dpcm_be_dai_hw_params()
2020 memcpy(&be->dpcm[stream].hw_params, &dpcm->hw_params, in dpcm_be_dai_hw_params()
2024 if (!snd_soc_dpcm_can_be_params(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()
2039 be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_PARAMS; in dpcm_be_dai_hw_params()
2048 for_each_dpcm_be_rollback(fe, stream, dpcm) { in dpcm_be_dai_hw_params()
2050 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_hw_params()
2052 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_hw_params()
2056 if (!snd_soc_dpcm_can_be_free_stop(fe, be, stream)) in dpcm_be_dai_hw_params()
2059 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && in dpcm_be_dai_hw_params()
2060 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_hw_params()
2061 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && in dpcm_be_dai_hw_params()
2062 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) in dpcm_be_dai_hw_params()
2075 int ret, stream = substream->stream; in dpcm_fe_dai_hw_params() local
2078 dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE); in dpcm_fe_dai_hw_params()
2080 memcpy(&fe->dpcm[stream].hw_params, params, in dpcm_fe_dai_hw_params()
2082 ret = dpcm_be_dai_hw_params(fe, stream); in dpcm_fe_dai_hw_params()
2093 dpcm_be_dai_hw_free(fe, stream); in dpcm_fe_dai_hw_params()
2095 fe->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_PARAMS; in dpcm_fe_dai_hw_params()
2098 dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO); in dpcm_fe_dai_hw_params()
2107 int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, in dpcm_be_dai_trigger() argument
2115 for_each_dpcm_be(fe, stream, dpcm) { in dpcm_be_dai_trigger()
2119 be_substream = snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_trigger()
2121 snd_soc_dpcm_stream_lock_irqsave_nested(be, stream, flags); in dpcm_be_dai_trigger()
2124 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_trigger()
2132 if (!be->dpcm_be_start[stream] && in dpcm_be_dai_trigger()
2133 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PREPARE) && in dpcm_be_dai_trigger()
2134 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_trigger()
2135 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2138 be->dpcm_be_start[stream]++; in dpcm_be_dai_trigger()
2139 if (be->dpcm_be_start[stream] != 1) in dpcm_be_dai_trigger()
2144 be->dpcm_be_start[stream]--; in dpcm_be_dai_trigger()
2148 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
2151 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND)) in dpcm_be_dai_trigger()
2154 be->dpcm_be_start[stream]++; in dpcm_be_dai_trigger()
2155 if (be->dpcm_be_start[stream]!= 1) in dpcm_be_dai_trigger()
2160 be->dpcm_be_start[stream]--; in dpcm_be_dai_trigger()
2164 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
2167 if (!be->dpcm_be_start[stream] && in dpcm_be_dai_trigger()
2168 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) && in dpcm_be_dai_trigger()
2169 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_trigger()
2170 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2173 be->dpcm_be_start[stream]++; in dpcm_be_dai_trigger()
2174 if (be->dpcm_be_start[stream] != 1) in dpcm_be_dai_trigger()
2179 be->dpcm_be_start[stream]--; in dpcm_be_dai_trigger()
2183 be->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_be_dai_trigger()
2186 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) && in dpcm_be_dai_trigger()
2187 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_trigger()
2190 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2191 be->dpcm_be_start[stream]--; in dpcm_be_dai_trigger()
2193 if (be->dpcm_be_start[stream] != 0) in dpcm_be_dai_trigger()
2198 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2199 be->dpcm_be_start[stream]++; in dpcm_be_dai_trigger()
2203 be->dpcm[stream].state = SND_SOC_DPCM_STATE_STOP; in dpcm_be_dai_trigger()
2206 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2209 be->dpcm_be_start[stream]--; in dpcm_be_dai_trigger()
2210 if (be->dpcm_be_start[stream] != 0) in dpcm_be_dai_trigger()
2215 be->dpcm_be_start[stream]++; in dpcm_be_dai_trigger()
2219 be->dpcm[stream].state = SND_SOC_DPCM_STATE_SUSPEND; in dpcm_be_dai_trigger()
2222 if (be->dpcm[stream].state != SND_SOC_DPCM_STATE_START) in dpcm_be_dai_trigger()
2225 be->dpcm_be_start[stream]--; in dpcm_be_dai_trigger()
2226 if (be->dpcm_be_start[stream] != 0) in dpcm_be_dai_trigger()
2231 be->dpcm_be_start[stream]++; in dpcm_be_dai_trigger()
2235 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PAUSED; in dpcm_be_dai_trigger()
2239 snd_soc_dpcm_stream_unlock_irqrestore(be, stream, flags); in dpcm_be_dai_trigger()
2265 ret = dpcm_be_dai_trigger(fe, substream->stream, cmd); in dpcm_dai_trigger_fe_be()
2270 ret = dpcm_be_dai_trigger(fe, substream->stream, cmd); in dpcm_dai_trigger_fe_be()
2285 int stream = substream->stream; in dpcm_fe_dai_do_trigger() local
2287 enum snd_soc_dpcm_trigger trigger = fe->dai_link->trigger[stream]; in dpcm_fe_dai_do_trigger()
2289 fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE; in dpcm_fe_dai_do_trigger()
2353 fe->dpcm[stream].state = SND_SOC_DPCM_STATE_START; in dpcm_fe_dai_do_trigger()
2357 fe->dpcm[stream].state = SND_SOC_DPCM_STATE_STOP; in dpcm_fe_dai_do_trigger()
2360 fe->dpcm[stream].state = SND_SOC_DPCM_STATE_PAUSED; in dpcm_fe_dai_do_trigger()
2365 fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO; in dpcm_fe_dai_do_trigger()
2372 int stream = substream->stream; in dpcm_fe_dai_trigger() local
2377 if (fe->dpcm[stream].runtime_update != SND_SOC_DPCM_UPDATE_NO) { in dpcm_fe_dai_trigger()
2378 fe->dpcm[stream].trigger_pending = cmd + 1; in dpcm_fe_dai_trigger()
2386 int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream) in dpcm_be_dai_prepare() argument
2391 for_each_dpcm_be(fe, stream, dpcm) { in dpcm_be_dai_prepare()
2395 snd_soc_dpcm_get_substream(be, stream); in dpcm_be_dai_prepare()
2398 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_be_dai_prepare()
2401 if (!snd_soc_dpcm_can_be_prepared(fe, be, stream)) in dpcm_be_dai_prepare()
2404 if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && in dpcm_be_dai_prepare()
2405 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) && in dpcm_be_dai_prepare()
2406 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND) && in dpcm_be_dai_prepare()
2407 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED)) in dpcm_be_dai_prepare()
2417 be->dpcm[stream].state = SND_SOC_DPCM_STATE_PREPARE; in dpcm_be_dai_prepare()
2429 int stream = substream->stream, ret = 0; in dpcm_fe_dai_prepare() local
2435 dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_FE); in dpcm_fe_dai_prepare()
2438 if (list_empty(&fe->dpcm[stream].be_clients)) { in dpcm_fe_dai_prepare()
2445 ret = dpcm_be_dai_prepare(fe, stream); in dpcm_fe_dai_prepare()
2454 fe->dpcm[stream].state = SND_SOC_DPCM_STATE_PREPARE; in dpcm_fe_dai_prepare()
2457 dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO); in dpcm_fe_dai_prepare()
2466 static int dpcm_run_update_shutdown(struct snd_soc_pcm_runtime *fe, int stream) in dpcm_run_update_shutdown() argument
2469 snd_soc_dpcm_get_substream(fe, stream); in dpcm_run_update_shutdown()
2470 enum snd_soc_dpcm_trigger trigger = fe->dai_link->trigger[stream]; in dpcm_run_update_shutdown()
2474 stream ? "capture" : "playback", fe->dai_link->name); in dpcm_run_update_shutdown()
2486 err = dpcm_be_dai_trigger(fe, stream, SNDRV_PCM_TRIGGER_STOP); in dpcm_run_update_shutdown()
2489 dpcm_be_dai_hw_free(fe, stream); in dpcm_run_update_shutdown()
2491 dpcm_be_dai_shutdown(fe, stream); in dpcm_run_update_shutdown()
2494 dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_NOP); in dpcm_run_update_shutdown()
2502 static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream) in dpcm_run_update_startup() argument
2505 snd_soc_dpcm_get_substream(fe, stream); in dpcm_run_update_startup()
2507 enum snd_soc_dpcm_trigger trigger = fe->dai_link->trigger[stream]; in dpcm_run_update_startup()
2511 stream ? "capture" : "playback", fe->dai_link->name); in dpcm_run_update_startup()
2514 if (fe->dpcm[stream].state == SND_SOC_DPCM_STATE_HW_FREE || in dpcm_run_update_startup()
2515 fe->dpcm[stream].state == SND_SOC_DPCM_STATE_CLOSE) { in dpcm_run_update_startup()
2517 fe->dai_link->name, fe->dpcm[stream].state); in dpcm_run_update_startup()
2523 ret = dpcm_be_dai_startup(fe, stream); in dpcm_run_update_startup()
2528 if (fe->dpcm[stream].state == SND_SOC_DPCM_STATE_OPEN) in dpcm_run_update_startup()
2531 ret = dpcm_be_dai_hw_params(fe, stream); in dpcm_run_update_startup()
2536 if (fe->dpcm[stream].state == SND_SOC_DPCM_STATE_HW_PARAMS) in dpcm_run_update_startup()
2539 ret = dpcm_be_dai_prepare(fe, stream); in dpcm_run_update_startup()
2544 dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_NOP); in dpcm_run_update_startup()
2547 if (fe->dpcm[stream].state == SND_SOC_DPCM_STATE_PREPARE || in dpcm_run_update_startup()
2548 fe->dpcm[stream].state == SND_SOC_DPCM_STATE_STOP) in dpcm_run_update_startup()
2563 ret = dpcm_be_dai_trigger(fe, stream, in dpcm_run_update_startup()
2572 dpcm_be_dai_hw_free(fe, stream); in dpcm_run_update_startup()
2574 dpcm_be_dai_shutdown(fe, stream); in dpcm_run_update_startup()
2577 for_each_dpcm_be(fe, stream, dpcm) { in dpcm_run_update_startup()
2581 if (!snd_soc_dpcm_be_can_update(fe, be, stream)) in dpcm_run_update_startup()
2584 if (be->dpcm[stream].state == SND_SOC_DPCM_STATE_CLOSE || in dpcm_run_update_startup()
2585 be->dpcm[stream].state == SND_SOC_DPCM_STATE_NEW) in dpcm_run_update_startup()
2598 int stream; in soc_dpcm_fe_runtime_update() local
2618 for_each_pcm_streams(stream) { in soc_dpcm_fe_runtime_update()
2621 if (!snd_soc_dai_stream_valid(asoc_rtd_to_cpu(fe, 0), stream) || in soc_dpcm_fe_runtime_update()
2622 !snd_soc_dai_stream_valid(asoc_rtd_to_codec(fe, 0), stream)) in soc_dpcm_fe_runtime_update()
2626 if (!snd_soc_dai_stream_active(asoc_rtd_to_cpu(fe, 0), stream) || in soc_dpcm_fe_runtime_update()
2627 !snd_soc_dai_stream_active(asoc_rtd_to_codec(fe, 0), stream)) in soc_dpcm_fe_runtime_update()
2630 paths = dpcm_path_get(fe, stream, &list); in soc_dpcm_fe_runtime_update()
2635 count = dpcm_process_paths(fe, stream, &list, new); in soc_dpcm_fe_runtime_update()
2637 dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_BE); in soc_dpcm_fe_runtime_update()
2639 dpcm_run_update_startup(fe, stream); in soc_dpcm_fe_runtime_update()
2641 dpcm_run_update_shutdown(fe, stream); in soc_dpcm_fe_runtime_update()
2642 dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO); in soc_dpcm_fe_runtime_update()
2644 dpcm_clear_pending_state(fe, stream); in soc_dpcm_fe_runtime_update()
2645 dpcm_be_disconnect(fe, stream); in soc_dpcm_fe_runtime_update()
2687 int stream = fe_substream->stream; in dpcm_fe_dai_cleanup() local
2692 for_each_dpcm_be(fe, stream, dpcm) in dpcm_fe_dai_cleanup()
2695 dpcm_be_disconnect(fe, stream); in dpcm_fe_dai_cleanup()
2697 fe->dpcm[stream].runtime = NULL; in dpcm_fe_dai_cleanup()
2719 int stream = fe_substream->stream; in dpcm_fe_dai_open() local
2722 fe->dpcm[stream].runtime = fe_substream->runtime; in dpcm_fe_dai_open()
2724 ret = dpcm_path_get(fe, stream, &list); in dpcm_fe_dai_open()
2729 dpcm_process_paths(fe, stream, &list, 1); in dpcm_fe_dai_open()
2735 dpcm_clear_pending_state(fe, stream); in dpcm_fe_dai_open()
2755 int stream; in soc_get_playback_capture() local
2758 stream = SNDRV_PCM_STREAM_PLAYBACK; in soc_get_playback_capture()
2761 if (snd_soc_dai_stream_valid(cpu_dai, stream)) { in soc_get_playback_capture()
2774 stream = SNDRV_PCM_STREAM_CAPTURE; in soc_get_playback_capture()
2777 if (snd_soc_dai_stream_valid(cpu_dai, stream)) { in soc_get_playback_capture()
2962 int snd_soc_dpcm_fe_can_update(struct snd_soc_pcm_runtime *fe, int stream) in snd_soc_dpcm_fe_can_update() argument
2964 if (fe->dpcm[stream].runtime_update == SND_SOC_DPCM_UPDATE_FE) in snd_soc_dpcm_fe_can_update()
2972 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_be_can_update() argument
2974 if ((fe->dpcm[stream].runtime_update == SND_SOC_DPCM_UPDATE_FE) || in snd_soc_dpcm_be_can_update()
2975 ((fe->dpcm[stream].runtime_update == SND_SOC_DPCM_UPDATE_BE) && in snd_soc_dpcm_be_can_update()
2976 be->dpcm[stream].runtime_update)) in snd_soc_dpcm_be_can_update()
2984 snd_soc_dpcm_get_substream(struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_get_substream() argument
2986 return be->pcm->streams[stream].substream; in snd_soc_dpcm_get_substream()
2992 int stream, in snd_soc_dpcm_check_state() argument
3001 for_each_dpcm_fe(be, stream, dpcm) { in snd_soc_dpcm_check_state()
3006 state = dpcm->fe->dpcm[stream].state; in snd_soc_dpcm_check_state()
3024 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_free_stop() argument
3032 return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); in snd_soc_dpcm_can_be_free_stop()
3041 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_params() argument
3050 return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); in snd_soc_dpcm_can_be_params()
3059 struct snd_soc_pcm_runtime *be, int stream) in snd_soc_dpcm_can_be_prepared() argument
3067 return snd_soc_dpcm_check_state(fe, be, stream, state, ARRAY_SIZE(state)); in snd_soc_dpcm_can_be_prepared()