* [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
* [PATCH 2/2] ASoC: Use DAPM context rather than CODEC when constructing sequences
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 ` 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
1 sibling, 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
DAPM widgets may be associated with non-CODEC devices so compare based
on the DAPM context rather than the CODEC pointer.
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 bc2ec06..5ee93a5 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -710,8 +710,8 @@ static int dapm_seq_compare(struct snd_soc_dapm_widget *a,
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;
+ if (a->dapm != b->dapm)
+ return (unsigned long)a->dapm - (unsigned long)b->dapm;
return 0;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2.6.37 1/2] ASoC: Fix dapm_seq_compare() for multi-component
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-12 19:10 ` Mark Brown
1 sibling, 1 reply; 6+ messages in thread
From: Jarkko Nikula @ 2010-11-12 19:06 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, patches, Liam Girdwood
On Fri, 12 Nov 2010 16:01:10 +0000
Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
> 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;
>
This sounds feasible change. What I was thinking are there any
benefit which one, the register or codec is compared first but I don't
think there's any practical difference.
A1, B1, A2, B2 (now)
or
A1, A2, B1, B2 (codec comparison before register)
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] ASoC: Use DAPM context rather than CODEC when constructing sequences
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
1 sibling, 0 replies; 6+ messages in thread
From: Jarkko Nikula @ 2010-11-12 19:06 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, patches, Liam Girdwood
On Fri, 12 Nov 2010 16:01:11 +0000
Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
> DAPM widgets may be associated with non-CODEC devices so compare based
> on the DAPM context rather than the CODEC pointer.
>
> 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 bc2ec06..5ee93a5 100644
> --- a/sound/soc/soc-dapm.c
> +++ b/sound/soc/soc-dapm.c
> @@ -710,8 +710,8 @@ static int dapm_seq_compare(struct snd_soc_dapm_widget *a,
> 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;
> + if (a->dapm != b->dapm)
> + return (unsigned long)a->dapm - (unsigned long)b->dapm;
>
Definitely, this conversion was missing from DAPM decoupling patch.
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2.6.37 1/2] ASoC: Fix dapm_seq_compare() for multi-component
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
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2010-11-12 19:10 UTC (permalink / raw)
To: Jarkko Nikula; +Cc: alsa-devel, patches, Liam Girdwood
On Fri, Nov 12, 2010 at 09:06:37PM +0200, Jarkko Nikula wrote:
> This sounds feasible change. What I was thinking are there any
> benefit which one, the register or codec is compared first but I don't
> think there's any practical difference.
> A1, B1, A2, B2 (now)
> or
> A1, A2, B1, B2 (codec comparison before register)
If you've got two identical CODECs it will *probably* sound smoother to
alternate between the two rather than enabling one then the other -
there will be less time difference between any audible issues in each
path. Probably a very small chance of that having an effect but it
seemed more likely to do something useful than any other scenario.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] ASoC: Use DAPM context rather than CODEC when constructing sequences
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
1 sibling, 0 replies; 6+ messages in thread
From: Liam Girdwood @ 2010-11-15 13:10 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, patches
On Fri, 2010-11-12 at 16:01 +0000, Mark Brown wrote:
> DAPM widgets may be associated with non-CODEC devices so compare based
> on the DAPM context rather than the CODEC pointer.
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Both
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
^ permalink raw reply [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).