Unverified Commit 87783532 authored by Simon Trimmer's avatar Simon Trimmer Committed by Mark Brown
Browse files

ASoC: SDCA: Allow sample width wild cards in set_usage()



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: 4ed357f7 ("ASoC: SDCA: Add hw_params() helper function")
Signed-off-by: default avatarSimon Trimmer <simont@opensource.cirrus.com>
Reviewed-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20251216142204.183958-1-simont@opensource.cirrus.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent da1682d5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);