diff options
author | Mark Brown <broonie@kernel.org> | 2021-08-06 01:46:24 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-08-06 01:46:24 +0100 |
commit | ddaa1ed52c5da64fe9adf1d5ea6202cda3a53eea (patch) | |
tree | 119c5b9dcf67841af4a92f3d3a9b5e4efcc4557b /sound/soc/soc-pcm.c | |
parent | 585fb31c2c3aad38a5add009171d7e3277b76d45 (diff) | |
parent | e2f6867299ac85ce227eee18be11ce2c4a568447 (diff) |
Merge some cs42l42 patches into asoc-5.15
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r-- | sound/soc/soc-pcm.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 69893bd5be60..48f71bb81a2f 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1014,6 +1014,7 @@ out: static int soc_pcm_trigger(struct snd_pcm_substream *substream, int cmd) { + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); int ret = -EINVAL, _ret = 0; int rollback = 0; @@ -1054,14 +1055,23 @@ start_err: case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - ret = snd_soc_pcm_dai_trigger(substream, cmd, rollback); - if (ret < 0) - break; + if (rtd->dai_link->stop_dma_first) { + ret = snd_soc_pcm_component_trigger(substream, cmd, rollback); + if (ret < 0) + break; - ret = snd_soc_pcm_component_trigger(substream, cmd, rollback); - if (ret < 0) - break; + ret = snd_soc_pcm_dai_trigger(substream, cmd, rollback); + if (ret < 0) + break; + } else { + ret = snd_soc_pcm_dai_trigger(substream, cmd, rollback); + if (ret < 0) + break; + ret = snd_soc_pcm_component_trigger(substream, cmd, rollback); + if (ret < 0) + break; + } ret = snd_soc_link_trigger(substream, cmd, rollback); break; } |