All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] ASoC: SDCA: add route by the number of input pins in MU entity
@ 2025-07-21 11:23 shumingf
  2025-07-21 14:10 ` Charles Keepax
  2025-07-21 18:00 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: shumingf @ 2025-07-21 11:23 UTC (permalink / raw)
  To: broonie, lgirdwood
  Cc: linux-sound, lars, flove, oder_chiou, jack.yu, derek.fang,
	ckeepax, Shuming Fan

From: Shuming Fan <shumingf@realtek.com>

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>
---
 sound/soc/sdca/sdca_asoc.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/sound/soc/sdca/sdca_asoc.c b/sound/soc/sdca/sdca_asoc.c
index 1482869a7ad5..c493ec530cc5 100644
--- a/sound/soc/sdca/sdca_asoc.c
+++ b/sound/soc/sdca/sdca_asoc.c
@@ -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;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-21 18:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-21 11:23 [PATCH 2/2] ASoC: SDCA: add route by the number of input pins in MU entity shumingf
2025-07-21 14:10 ` Charles Keepax
2025-07-21 18:00 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.