diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2020-03-30 11:06:02 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-03-30 18:22:37 +0100 |
commit | 1ba616bd1a6d5ebdb31ceaa9265b2a2bb670155b (patch) | |
tree | 0d58ad1076c2d171ba89d623c5b6a7283e94d72d /sound | |
parent | 0ab070917afdc93670c2d0ea02ab6defb6246a7c (diff) | |
download | linux-1ba616bd1a6d5ebdb31ceaa9265b2a2bb670155b.tar.gz linux-1ba616bd1a6d5ebdb31ceaa9265b2a2bb670155b.tar.bz2 linux-1ba616bd1a6d5ebdb31ceaa9265b2a2bb670155b.zip |
ASoC: soc-dai: fix DAI startup/shutdown sequence
The addition of a single flag to track the DAI status prevents the DAI
startup sequence from being called on capture if the DAI is already
used for playback.
Fix by extending the existing code with one flag per direction.
Fixes: b56be800f1292 ("ASoC: soc-pcm: call snd_soc_dai_startup()/shutdown() once")
Reported-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tested-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://lore.kernel.org/r/20200330160602.10180-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/soc-dai.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index 19142f6e533c..8f3cad8db89a 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -295,12 +295,12 @@ int snd_soc_dai_startup(struct snd_soc_dai *dai, { int ret = 0; - if (!dai->started && + if (!dai->started[substream->stream] && dai->driver->ops->startup) ret = dai->driver->ops->startup(substream, dai); if (ret == 0) - dai->started = 1; + dai->started[substream->stream] = 1; return ret; } @@ -308,11 +308,11 @@ int snd_soc_dai_startup(struct snd_soc_dai *dai, void snd_soc_dai_shutdown(struct snd_soc_dai *dai, struct snd_pcm_substream *substream) { - if (dai->started && + if (dai->started[substream->stream] && dai->driver->ops->shutdown) dai->driver->ops->shutdown(substream, dai); - dai->started = 0; + dai->started[substream->stream] = 0; } int snd_soc_dai_prepare(struct snd_soc_dai *dai, |