Skip to content

Commit 6501d97

Browse files
morimotogregkh
authored andcommitted
ASoC: soc-compress: use function to clear symmetric params
[ Upstream commit 07c774d ] Current soc-compress.c clears symmetric_rate, but it clears rate only, not clear other symmetric_channels/sample_bits. static int soc_compr_clean(...) { ... if (!snd_soc_dai_active(cpu_dai)) => cpu_dai->symmetric_rate = 0; if (!snd_soc_dai_active(codec_dai)) => codec_dai->symmetric_rate = 0; ... }; This feature was added when v3.7 kernel [1], and there was only symmetric_rate, no symmetric_channels/sample_bits in that timing. symmetric_channels/sample_bits were added in v3.14 [2], but I guess it didn't notice that soc-compress.c is updating symmetric_xxx. We are clearing symmetry_xxx by soc_pcm_set_dai_params(), but is soc-pcm.c local function. Makes it global function and clear symmetry_xxx by it. [1] commit 1245b70 ("ASoC: add compress stream support") [2] commit 3635bf0 ("ASoC: soc-pcm: add symmetry for channels and sample bits") Fixes: 3635bf0 ("ASoC: soc-pcm: add symmetry for channels and sample bits") Cc: Nicolin Chen <b42378@freescale.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://patch.msgid.link/87ms15e3kv.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 87f5cb3 commit 6501d97

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

include/sound/soc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,9 @@ struct snd_soc_dai *snd_soc_find_dai(
14121412
struct snd_soc_dai *snd_soc_find_dai_with_mutex(
14131413
const struct snd_soc_dai_link_component *dlc);
14141414

1415+
void soc_pcm_set_dai_params(struct snd_soc_dai *dai,
1416+
struct snd_pcm_hw_params *params);
1417+
14151418
#include <sound/soc-dai.h>
14161419

14171420
static inline

sound/soc/soc-compress.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ static int soc_compr_clean(struct snd_compr_stream *cstream, int rollback)
6969
snd_soc_dai_digital_mute(codec_dai, 1, stream);
7070

7171
if (!snd_soc_dai_active(cpu_dai))
72-
cpu_dai->symmetric_rate = 0;
72+
soc_pcm_set_dai_params(cpu_dai, NULL);
7373

7474
if (!snd_soc_dai_active(codec_dai))
75-
codec_dai->symmetric_rate = 0;
75+
soc_pcm_set_dai_params(codec_dai, NULL);
7676

7777
snd_soc_link_compr_shutdown(cstream, rollback);
7878

sound/soc/soc-pcm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,8 @@ void dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir, int event)
423423
snd_soc_dapm_stream_event(fe, dir, event);
424424
}
425425

426-
static void soc_pcm_set_dai_params(struct snd_soc_dai *dai,
427-
struct snd_pcm_hw_params *params)
426+
void soc_pcm_set_dai_params(struct snd_soc_dai *dai,
427+
struct snd_pcm_hw_params *params)
428428
{
429429
if (params) {
430430
dai->symmetric_rate = params_rate(params);

0 commit comments

Comments
 (0)