All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for 2.6.40] ASoC: Fix power down for widgetless per-card DAPM context case
@ 2011-05-26 13:32 Jarkko Nikula
  2011-05-26 14:38 ` Liam Girdwood
  2011-05-26 15:08 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Jarkko Nikula @ 2011-05-26 13:32 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, Liam Girdwood

Commit 52ba67b ("ASoC: Force all DAPM contexts into the same bias state")
powers up all the DAPM contexts in a card if any DAPM context becomes
active. Unfortunately power down newer happens if per-card DAPM context
doesn't have any widgets.

Reason for this is that power state of per-card DAPM context without
widgets is never cleared and thus all the DAPM contexts remain permanently
active. Test for widgetless calling DAPM context in dapm_power_widgets()
doesn't work for per-card DAPM context since power change is never
originating from widgetless per-card DAPM context.

Fix this by pre-clearing power state flag of non-codec DAPM context at the
beginning of power sequence.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
---
 sound/soc/soc-dapm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 456617e..999bb08 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1110,7 +1110,7 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event)
 	trace_snd_soc_dapm_start(card);
 
 	list_for_each_entry(d, &card->dapm_list, list)
-		if (d->n_widgets)
+		if (d->n_widgets || d->codec == NULL)
 			d->dev_power = 0;
 
 	/* Check which widgets we need to power and store them in
-- 
1.7.4.4

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

* Re: [PATCH for 2.6.40] ASoC: Fix power down for widgetless per-card DAPM context case
  2011-05-26 13:32 [PATCH for 2.6.40] ASoC: Fix power down for widgetless per-card DAPM context case Jarkko Nikula
@ 2011-05-26 14:38 ` Liam Girdwood
  2011-05-26 15:08 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Liam Girdwood @ 2011-05-26 14:38 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: alsa-devel, Mark Brown

On 26/05/11 14:32, Jarkko Nikula wrote:
> Commit 52ba67b ("ASoC: Force all DAPM contexts into the same bias state")
> powers up all the DAPM contexts in a card if any DAPM context becomes
> active. Unfortunately power down newer happens if per-card DAPM context
> doesn't have any widgets.
> 
> Reason for this is that power state of per-card DAPM context without
> widgets is never cleared and thus all the DAPM contexts remain permanently
> active. Test for widgetless calling DAPM context in dapm_power_widgets()
> doesn't work for per-card DAPM context since power change is never
> originating from widgetless per-card DAPM context.
> 
> Fix this by pre-clearing power state flag of non-codec DAPM context at the
> beginning of power sequence.
> 
> Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
> ---
>  sound/soc/soc-dapm.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 

Acked-by: Liam Girdwood <lrg@ti.com>

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

* Re: [PATCH for 2.6.40] ASoC: Fix power down for widgetless per-card DAPM context case
  2011-05-26 13:32 [PATCH for 2.6.40] ASoC: Fix power down for widgetless per-card DAPM context case Jarkko Nikula
  2011-05-26 14:38 ` Liam Girdwood
@ 2011-05-26 15:08 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2011-05-26 15:08 UTC (permalink / raw)
  To: Jarkko Nikula; +Cc: alsa-devel, Liam Girdwood

On Thu, May 26, 2011 at 04:32:18PM +0300, Jarkko Nikula wrote:
> Commit 52ba67b ("ASoC: Force all DAPM contexts into the same bias state")
> powers up all the DAPM contexts in a card if any DAPM context becomes
> active. Unfortunately power down newer happens if per-card DAPM context
> doesn't have any widgets.
> 
> Reason for this is that power state of per-card DAPM context without
> widgets is never cleared and thus all the DAPM contexts remain permanently
> active. Test for widgetless calling DAPM context in dapm_power_widgets()
> doesn't work for per-card DAPM context since power change is never
> originating from widgetless per-card DAPM context.

Applied, thanks, though this is a bit of a band aid as we're currently
still allowing widgetless CODECs.

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

end of thread, other threads:[~2011-05-26 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-26 13:32 [PATCH for 2.6.40] ASoC: Fix power down for widgetless per-card DAPM context case Jarkko Nikula
2011-05-26 14:38 ` Liam Girdwood
2011-05-26 15:08 ` 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.