public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: dapm: Break out of widget search when source and sink are located
@ 2015-05-07 10:33 Charles Keepax
  2015-05-07 10:33 ` [PATCH 2/2] ASoC: dapm: Add cache to speed up adding of routes Charles Keepax
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Charles Keepax @ 2015-05-07 10:33 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel, lars, lgirdwood, patches

Currently snd_soc_dapm_add_route will continue to search the widget list
even after both the source and sink for the route have been located.
This patch breaks out of the search when both are located giving a
small improvement in probe time for drivers.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---

Note these patches depend on:

commit 92fa12426741d52b39ec92ad77c9843d3fc2b3d6
Author: Lars-Peter Clausen <lars@metafoo.de>
Date:   Fri May 1 18:02:42 2015 +0200

    ASoC: dapm: Add new widgets to the end of the widget list

Thanks,
Charles

 sound/soc/soc-dapm.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index a2e5f22..ea3348e 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2617,14 +2617,20 @@ static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm,
 	list_for_each_entry(w, &dapm->card->widgets, list) {
 		if (!wsink && !(strcmp(w->name, sink))) {
 			wtsink = w;
-			if (w->dapm == dapm)
+			if (w->dapm == dapm) {
 				wsink = w;
+				if (wsource)
+					break;
+			}
 			continue;
 		}
 		if (!wsource && !(strcmp(w->name, source))) {
 			wtsource = w;
-			if (w->dapm == dapm)
+			if (w->dapm == dapm) {
 				wsource = w;
+				if (wsink)
+					break;
+			}
 		}
 	}
 	/* use widget from another DAPM context if not found from this */
-- 
1.7.2.5

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

end of thread, other threads:[~2015-05-07 16:33 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-07 10:33 [PATCH 1/2] ASoC: dapm: Break out of widget search when source and sink are located Charles Keepax
2015-05-07 10:33 ` [PATCH 2/2] ASoC: dapm: Add cache to speed up adding of routes Charles Keepax
2015-05-07 11:22   ` Lars-Peter Clausen
2015-05-07 12:35     ` Charles Keepax
2015-05-07 12:39     ` Mike Looijmans
2015-05-07 13:16     ` Mark Brown
2015-05-07 12:48   ` Mark Brown
2015-05-07 13:52     ` Charles Keepax
2015-05-07 14:09       ` Mark Brown
2015-05-07 14:53     ` Lars-Peter Clausen
2015-05-07 16:33       ` Mark Brown
2015-05-07 11:24 ` [PATCH 1/2] ASoC: dapm: Break out of widget search when source and sink are located Lars-Peter Clausen
2015-05-07 11:25 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox