Skip to content

Commit d169c03

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 c38eb9c commit d169c03

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
@@ -1452,6 +1452,9 @@ struct snd_soc_dai *snd_soc_find_dai(
14521452
struct snd_soc_dai *snd_soc_find_dai_with_mutex(
14531453
const struct snd_soc_dai_link_component *dlc);
14541454

1455+
void soc_pcm_set_dai_params(struct snd_soc_dai *dai,
1456+
struct snd_pcm_hw_params *params);
1457+
14551458
#include <sound/soc-dai.h>
14561459

14571460
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
@@ -458,8 +458,8 @@ int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir,
458458
return 0;
459459
}
460460

461-
static void soc_pcm_set_dai_params(struct snd_soc_dai *dai,
462-
struct snd_pcm_hw_params *params)
461+
void soc_pcm_set_dai_params(struct snd_soc_dai *dai,
462+
struct snd_pcm_hw_params *params)
463463
{
464464
if (params) {
465465
dai->symmetric_rate = params_rate(params);

0 commit comments

Comments
 (0)