]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: SOF: compress: Save channel count and sample bytes
authorLaurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Wed, 17 Aug 2022 08:05:28 +0000 (11:05 +0300)
committerMark Brown <broonie@kernel.org>
Wed, 17 Aug 2022 12:00:23 +0000 (13:00 +0100)
The purpose of this change is to enable the saving of the
channel count and sample container bytes format parameters for later use
to compute the timestamps.

This is done when setting the compress stream parameters
(in sof_compr_set_params).

Reviewed-by: Paul Olaru <paul.olaru@oss.nxp.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20220817080529.10864-4-daniel.baluta@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/compress.c
sound/soc/sof/sof-priv.h

index e990fa093bb5b5980a10b2d162a7aec0ba2ef0ab..ac79b46ce3b98f13ede3d910461dda41781c218b 100644 (file)
@@ -238,6 +238,8 @@ static int sof_compr_set_params(struct snd_soc_component *component,
        }
 
        sstream->sampling_rate = params->codec.sample_rate;
+       sstream->channels = params->codec.ch_out;
+       sstream->sample_container_bytes = pcm->params.sample_container_bytes;
 
        spcm->prepared[cstream->direction] = true;
 
index 42f112030fb8fb04fdd09dfc01f4e68f9ebc6dae..33165299a20f15c4eb02499f8565c256ccdbf8e6 100644 (file)
@@ -108,6 +108,8 @@ enum sof_debugfs_access_type {
 struct sof_compr_stream {
        u64 copied_total;
        u32 sampling_rate;
+       u16 channels;
+       u16 sample_container_bytes;
 };
 
 struct snd_sof_dev;