]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ASoC: qcom: sc8280xp: explicitly set S16LE format in sc8280xp_be_hw_params_fixup()
authorAlexey Klimov <alexey.klimov@linaro.org>
Thu, 11 Sep 2025 15:43:40 +0000 (16:43 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 18 Sep 2025 21:26:32 +0000 (22:26 +0100)
Setting format to s16le is required for compressed playback on compatible
soundcards.

Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
Link: https://patch.msgid.link/20250911154340.2798304-1-alexey.klimov@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/sc8280xp.c

index 73f9f82c4e2581c132e6f6468740a33a6f2ec0c8..5d10b1c5909e833f0323bb0e6989bf797709bb89 100644 (file)
@@ -7,6 +7,7 @@
 #include <sound/soc.h>
 #include <sound/soc-dapm.h>
 #include <sound/pcm.h>
+#include <sound/pcm_params.h>
 #include <linux/soundwire/sdw.h>
 #include <sound/jack.h>
 #include <linux/input-event-codes.h>
@@ -82,8 +83,10 @@ static int sc8280xp_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
                                        SNDRV_PCM_HW_PARAM_RATE);
        struct snd_interval *channels = hw_param_interval(params,
                                        SNDRV_PCM_HW_PARAM_CHANNELS);
+       struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
 
        rate->min = rate->max = 48000;
+       snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);
        channels->min = 2;
        channels->max = 2;
        switch (cpu_dai->id) {