Skip to content

Commit c33fd6b

Browse files
committed
ASoC: SDCA: add route by the number of input pins in MU entity
The control number should not be equal to the number of input pins. Therefore, this patch removed the judgment. Signed-off-by: Shuming Fan <shumingf@realtek.com>
1 parent 7a737b8 commit c33fd6b

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

sound/soc/sdca/sdca_asoc.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,6 @@ static int entity_parse_mu(struct device *dev,
633633
{
634634
struct sdca_control *control;
635635
struct snd_kcontrol_new *kctl;
636-
int cn;
637636
int i;
638637

639638
if (!entity->num_sources) {
@@ -650,18 +649,11 @@ static int entity_parse_mu(struct device *dev,
650649
dev_warn(dev, "%s: unexpected access layer: %x\n",
651650
entity->label, control->layers);
652651

653-
if (entity->num_sources != hweight64(control->cn_list)) {
654-
dev_err(dev, "%s: mismatched control and sources\n", entity->label);
655-
return -EINVAL;
656-
}
657-
658-
kctl = devm_kcalloc(dev, entity->num_sources, sizeof(*kctl), GFP_KERNEL);
652+
kctl = devm_kcalloc(dev, hweight64(control->cn_list), sizeof(*kctl), GFP_KERNEL);
659653
if (!kctl)
660654
return -ENOMEM;
661655

662-
i = 0;
663-
for_each_set_bit(cn, (unsigned long *)&control->cn_list,
664-
BITS_PER_TYPE(control->cn_list)) {
656+
for (i = 0; i < entity->num_sources; i++) {
665657
const char *control_name;
666658
struct soc_mixer_control *mc;
667659

@@ -686,7 +678,6 @@ static int entity_parse_mu(struct device *dev,
686678
kctl[i].info = snd_soc_info_volsw;
687679
kctl[i].get = snd_soc_dapm_get_volsw;
688680
kctl[i].put = snd_soc_dapm_put_volsw;
689-
i++;
690681
}
691682

692683
(*widget)->id = snd_soc_dapm_mixer;

0 commit comments

Comments
 (0)