]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: SOF: compress: return the configured codec from get_params
authorCássio Gabriel <cassiogabrielcontato@gmail.com>
Wed, 25 Mar 2026 20:05:11 +0000 (17:05 -0300)
committerMark Brown <broonie@kernel.org>
Mon, 6 Apr 2026 12:11:57 +0000 (13:11 +0100)
commit2c4fdd055f92a2fc8602dcd88bcea08c374b7e8b
tree066254efc7892226d617782a2d4fcfacadd504ff
parentb481eabe5a193ba8499f446c2ab7e0ac042f8776
ASoC: SOF: compress: return the configured codec from get_params

The SOF compressed offload path accepts codec parameters in
sof_compr_set_params() and forwards them to firmware as
extended data in the SOF IPC stream params message.

However, sof_compr_get_params() still returns success without
filling the snd_codec structure. Since the compress core allocates
that structure zeroed and copies it back to userspace on success,
SNDRV_COMPRESS_GET_PARAMS returns an all-zero codec description
even after the stream has been configured successfully.

The stale TODO in this callback conflates get_params() with capability
discovery. Supported codec enumeration belongs in get_caps() and
get_codec_caps(). get_params() should report the current codec settings.

Cache the codec accepted by sof_compr_set_params() in the per-stream SOF
compress state and return it from sof_compr_get_params().

Fixes: 6324cf901e14 ("ASoC: SOF: compr: Add compress ops implementation")
Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Link: https://patch.msgid.link/20260325-sof-compr-get-params-v1-1-0758815f13c7@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/compress.c
sound/soc/sof/sof-priv.h