Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

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.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250721112346.388542-1-shumingf@realtek.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Shuming Fan and committed by
Mark Brown
17882721 da863e77

+1 -10
+1 -10
sound/soc/sdca/sdca_asoc.c
··· 594 594 { 595 595 struct sdca_control *control; 596 596 struct snd_kcontrol_new *kctl; 597 - int cn; 598 597 int i; 599 598 600 599 if (!entity->num_sources) { ··· 610 611 dev_warn(dev, "%s: unexpected access layer: %x\n", 611 612 entity->label, control->layers); 612 613 613 - if (entity->num_sources != hweight64(control->cn_list)) { 614 - dev_err(dev, "%s: mismatched control and sources\n", entity->label); 615 - return -EINVAL; 616 - } 617 - 618 614 kctl = devm_kcalloc(dev, entity->num_sources, sizeof(*kctl), GFP_KERNEL); 619 615 if (!kctl) 620 616 return -ENOMEM; 621 617 622 - i = 0; 623 - for_each_set_bit(cn, (unsigned long *)&control->cn_list, 624 - BITS_PER_TYPE(control->cn_list)) { 618 + for (i = 0; i < entity->num_sources; i++) { 625 619 const char *control_name; 626 620 struct soc_mixer_control *mc; 627 621 ··· 639 647 kctl[i].info = snd_soc_info_volsw; 640 648 kctl[i].get = snd_soc_dapm_get_volsw; 641 649 kctl[i].put = snd_soc_dapm_put_volsw; 642 - i++; 643 650 } 644 651 645 652 (*widget)->id = snd_soc_dapm_mixer;