Skip to contentSkip to conversation

ASoC: SDCA: add route by the number of input pins in MU entity

PATCH In review [email protected] 3 participants 3 messages Jul 21, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 ASoC: SDCA: add route by the number of input pins in MU entity

From: Shuming Fan <[email protected]>

This patch removed the code where num_sources should be the same as cn_list. For better resilience, it would be preferable to explicitly add the route mapping the input pins to this MU entity.

---
 sound/soc/sdca/sdca_asoc.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
sound/soc/sdca/sdca_asoc.c +1 -10
index 1482869a7ad5..c493ec530cc5 100644
@@ -594,7 +594,6 @@ static int entity_parse_mu(struct device *dev,
 {
 	struct sdca_control *control;
 	struct snd_kcontrol_new *kctl;
-	int cn;
 	int i;
 
 	if (!entity->num_sources) {
@@ -611,18 +610,11 @@ static int entity_parse_mu(struct device *dev,
 		dev_warn(dev, "%s: unexpected access layer: %x\n",
 			 entity->label, control->layers);
 
-	if (entity->num_sources != hweight64(control->cn_list)) {
-		dev_err(dev, "%s: mismatched control and sources\n", entity->label);
-		return -EINVAL;
-	}
-
 	kctl = devm_kcalloc(dev, entity->num_sources, sizeof(*kctl), GFP_KERNEL);
 	if (!kctl)
 		return -ENOMEM;
 
-	i = 0;
-	for_each_set_bit(cn, (unsigned long *)&control->cn_list,
-			 BITS_PER_TYPE(control->cn_list)) {
+	for (i = 0; i < entity->num_sources; i++) {
 		const char *control_name;
 		struct soc_mixer_control *mc;
 
@@ -647,7 +639,6 @@ static int entity_parse_mu(struct device *dev,
 		kctl[i].info = snd_soc_info_volsw;
 		kctl[i].get = snd_soc_dapm_get_volsw;
 		kctl[i].put = snd_soc_dapm_put_volsw;
-		i++;
 	}
 
 	(*widget)->id = snd_soc_dapm_mixer;
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 2/2
#1 lore raw
Quoted 8 lines · On Mon, Jul 21, 2025 at 07:23:46PM +0800, [email protected] wrote:

From: Shuming Fan <[email protected]>

This patch removed the code where num_sources should be the same as cn_list. For better resilience, it would be preferable to explicitly add the route mapping the input pins to this MU entity.

---

Thanks,
Charles

maintainer
#2 lore raw
In reply to [email protected]
Quoted 5 lines · On Mon, 21 Jul 2025 19:23:46 +0800, [email protected] wrote:

This patch removed the code where num_sources should be the same as cn_list. For better resilience, it would be preferable to explicitly add the route mapping the input pins to this MU entity.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[2/2] ASoC: SDCA: add route by the number of input pins in MU entity

      commit: 17882721dcb49323eaa9728d7eaa2ae826c876f7

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark