Skip to content

Commit 1788272

Browse files
shumingfanbroonie
authored andcommitted
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 <[email protected]> Reviewed-by: Charles Keepax <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent da863e7 commit 1788272

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

sound/soc/sdca/sdca_asoc.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,6 @@ static int entity_parse_mu(struct device *dev,
594594
{
595595
struct sdca_control *control;
596596
struct snd_kcontrol_new *kctl;
597-
int cn;
598597
int i;
599598

600599
if (!entity->num_sources) {
@@ -611,18 +610,11 @@ static int entity_parse_mu(struct device *dev,
611610
dev_warn(dev, "%s: unexpected access layer: %x\n",
612611
entity->label, control->layers);
613612

614-
if (entity->num_sources != hweight64(control->cn_list)) {
615-
dev_err(dev, "%s: mismatched control and sources\n", entity->label);
616-
return -EINVAL;
617-
}
618-
619613
kctl = devm_kcalloc(dev, entity->num_sources, sizeof(*kctl), GFP_KERNEL);
620614
if (!kctl)
621615
return -ENOMEM;
622616

623-
i = 0;
624-
for_each_set_bit(cn, (unsigned long *)&control->cn_list,
625-
BITS_PER_TYPE(control->cn_list)) {
617+
for (i = 0; i < entity->num_sources; i++) {
626618
const char *control_name;
627619
struct soc_mixer_control *mc;
628620

@@ -647,7 +639,6 @@ static int entity_parse_mu(struct device *dev,
647639
kctl[i].info = snd_soc_info_volsw;
648640
kctl[i].get = snd_soc_dapm_get_volsw;
649641
kctl[i].put = snd_soc_dapm_put_volsw;
650-
i++;
651642
}
652643

653644
(*widget)->id = snd_soc_dapm_mixer;

0 commit comments

Comments
 (0)