Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01b8cedf authored by Satish Babu Patakokila's avatar Satish Babu Patakokila Committed by Mark Brown
Browse files

ASoC: compress: Derive substream from stream based on direction



Currently compress driver hardcodes direction as playback to get
substream from the stream. This results in getting the incorrect
substream for compressed capture usecase.
To fix this, remove the hardcoding and derive substream based on
the stream direction.

Signed-off-by: default avatarSatish Babu Patakokila <sbpata@codeaurora.org>
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
Acked-By: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
parent 2ea659a9
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -81,7 +81,8 @@ static int soc_compr_open(struct snd_compr_stream *cstream)
static int soc_compr_open_fe(struct snd_compr_stream *cstream)
static int soc_compr_open_fe(struct snd_compr_stream *cstream)
{
{
	struct snd_soc_pcm_runtime *fe = cstream->private_data;
	struct snd_soc_pcm_runtime *fe = cstream->private_data;
	struct snd_pcm_substream *fe_substream = fe->pcm->streams[0].substream;
	struct snd_pcm_substream *fe_substream =
		 fe->pcm->streams[cstream->direction].substream;
	struct snd_soc_platform *platform = fe->platform;
	struct snd_soc_platform *platform = fe->platform;
	struct snd_soc_dai *cpu_dai = fe->cpu_dai;
	struct snd_soc_dai *cpu_dai = fe->cpu_dai;
	struct snd_soc_dpcm *dpcm;
	struct snd_soc_dpcm *dpcm;
@@ -467,7 +468,8 @@ static int soc_compr_set_params_fe(struct snd_compr_stream *cstream,
					struct snd_compr_params *params)
					struct snd_compr_params *params)
{
{
	struct snd_soc_pcm_runtime *fe = cstream->private_data;
	struct snd_soc_pcm_runtime *fe = cstream->private_data;
	struct snd_pcm_substream *fe_substream = fe->pcm->streams[0].substream;
	struct snd_pcm_substream *fe_substream =
		 fe->pcm->streams[cstream->direction].substream;
	struct snd_soc_platform *platform = fe->platform;
	struct snd_soc_platform *platform = fe->platform;
	struct snd_soc_dai *cpu_dai = fe->cpu_dai;
	struct snd_soc_dai *cpu_dai = fe->cpu_dai;
	int ret = 0, stream;
	int ret = 0, stream;