]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: SDCA: Allow sample width wild cards in set_usage()
authorSimon Trimmer <simont@opensource.cirrus.com>
Tue, 16 Dec 2025 14:22:04 +0000 (14:22 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 17 Dec 2025 12:04:35 +0000 (12:04 +0000)
The SDCA spec allows the sample rate and width to be wild cards, but the
current implementation of set_usage() only checked for a wild card of
the sample rate.

Fixes: 4ed357f72a0e ("ASoC: SDCA: Add hw_params() helper function")
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20251216142204.183958-1-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sdca/sdca_asoc.c

index 2d328bbb95b9453ac84a1984421ce4d812dfa4de..498aba9df5d9b50bd1331d89fa3d29c11a55447b 100644 (file)
@@ -1478,7 +1478,7 @@ static int set_usage(struct device *dev, struct regmap *regmap,
                unsigned int rate = sdca_range(range, SDCA_USAGE_SAMPLE_RATE, i);
                unsigned int width = sdca_range(range, SDCA_USAGE_SAMPLE_WIDTH, i);
 
-               if ((!rate || rate == target_rate) && width == target_width) {
+               if ((!rate || rate == target_rate) && (!width || width == target_width)) {
                        unsigned int usage = sdca_range(range, SDCA_USAGE_NUMBER, i);
                        unsigned int reg = SDW_SDCA_CTL(function->desc->adr,
                                                        entity->id, sel, 0);