alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.37 1/2] ASoC: Fix dapm_seq_compare() for multi-component
@ 2010-11-12 16:01 Mark Brown
  2010-11-12 16:01 ` [PATCH 2/2] ASoC: Use DAPM context rather than CODEC when constructing sequences Mark Brown
  2010-11-12 19:06 ` [PATCH 2.6.37 1/2] ASoC: Fix dapm_seq_compare() for multi-component Jarkko Nikula
  0 siblings, 2 replies; 6+ messages in thread
From: Mark Brown @ 2010-11-12 16:01 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: alsa-devel, patches, Mark Brown

Ensure that we keep all widget powerups in DAPM sequence by making
the CODEC the last thing we compare on rather than the first thing.
Also fix the fact that we're currently comparing the widget pointers
rather than the CODEC pointers when we do the substraction so we
won't get stable results.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 sound/soc/soc-dapm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 8352430..bc2ec06 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -706,12 +706,12 @@ static int dapm_seq_compare(struct snd_soc_dapm_widget *a,
 			    struct snd_soc_dapm_widget *b,
 			    int sort[])
 {
-	if (a->codec != b->codec)
-		return (unsigned long)a - (unsigned long)b;
 	if (sort[a->id] != sort[b->id])
 		return sort[a->id] - sort[b->id];
 	if (a->reg != b->reg)
 		return a->reg - b->reg;
+	if (a->codec != b->codec)
+		return (unsigned long)a->codec - (unsigned long)b->codec;
 
 	return 0;
 }
-- 
1.7.1

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

end of thread, other threads:[~2010-11-15 13:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-12 16:01 [PATCH 2.6.37 1/2] ASoC: Fix dapm_seq_compare() for multi-component Mark Brown
2010-11-12 16:01 ` [PATCH 2/2] ASoC: Use DAPM context rather than CODEC when constructing sequences Mark Brown
2010-11-12 19:06   ` Jarkko Nikula
2010-11-15 13:10   ` Liam Girdwood
2010-11-12 19:06 ` [PATCH 2.6.37 1/2] ASoC: Fix dapm_seq_compare() for multi-component Jarkko Nikula
2010-11-12 19:10   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).