alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: dapm: Remove bodges for no-widget CODECs
@ 2012-03-08 15:06 Mark Brown
  2012-03-09  2:19 ` Tabi Timur-B04825
  2012-03-19 18:11 ` Timur Tabi
  0 siblings, 2 replies; 5+ messages in thread
From: Mark Brown @ 2012-03-08 15:06 UTC (permalink / raw)
  To: Liam Girdwood, Timur Tabi; +Cc: alsa-devel, patches, Mark Brown

Now that we're creating widgets for all DAIs there should be no more
need for the bodges we've been carrying for non-DAPM CODEC drivers so
remove them.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---

I don't actually have any no widget CODECs so can't really test - Timur,
would it be possible for you to give it a spin?

 sound/soc/soc-dapm.c |   36 ++++--------------------------------
 1 files changed, 4 insertions(+), 32 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 8ce1e9c..6e5869d 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1441,12 +1441,10 @@ 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 || d->codec == NULL) {
-			if (d->idle_bias_off)
-				d->target_bias_level = SND_SOC_BIAS_OFF;
-			else
-				d->target_bias_level = SND_SOC_BIAS_STANDBY;
-		}
+		if (d->idle_bias_off)
+			d->target_bias_level = SND_SOC_BIAS_OFF;
+		else
+			d->target_bias_level = SND_SOC_BIAS_STANDBY;
 	}
 
 	dapm_reset(card);
@@ -1491,32 +1489,6 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event)
 
 	}
 
-	/* If there are no DAPM widgets then try to figure out power from the
-	 * event type.
-	 */
-	if (!dapm->n_widgets) {
-		switch (event) {
-		case SND_SOC_DAPM_STREAM_START:
-		case SND_SOC_DAPM_STREAM_RESUME:
-			dapm->target_bias_level = SND_SOC_BIAS_ON;
-			break;
-		case SND_SOC_DAPM_STREAM_STOP:
-			if (dapm->codec && dapm->codec->active)
-				dapm->target_bias_level = SND_SOC_BIAS_ON;
-			else
-				dapm->target_bias_level = SND_SOC_BIAS_STANDBY;
-			break;
-		case SND_SOC_DAPM_STREAM_SUSPEND:
-			dapm->target_bias_level = SND_SOC_BIAS_STANDBY;
-			break;
-		case SND_SOC_DAPM_STREAM_NOP:
-			dapm->target_bias_level = dapm->bias_level;
-			break;
-		default:
-			break;
-		}
-	}
-
 	/* Force all contexts in the card to the same bias state if
 	 * they're not ground referenced.
 	 */
-- 
1.7.9.1

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

* Re: [PATCH] ASoC: dapm: Remove bodges for no-widget CODECs
  2012-03-08 15:06 [PATCH] ASoC: dapm: Remove bodges for no-widget CODECs Mark Brown
@ 2012-03-09  2:19 ` Tabi Timur-B04825
  2012-03-09 12:21   ` Mark Brown
  2012-03-19 18:11 ` Timur Tabi
  1 sibling, 1 reply; 5+ messages in thread
From: Tabi Timur-B04825 @ 2012-03-09  2:19 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
	Tabi Timur-B04825, Liam Girdwood

Mark Brown wrote:
> I don't actually have any no widget CODECs so can't really test - Timur,
> would it be possible for you to give it a spin?

I'm assuming you're talking about the CS4270?  I don't even know what a 
dapm widget is.  Is there anything in particular I should check when 
testing this patch?

-- 
Timur Tabi
Linux kernel developer at Freescale

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

* Re: [PATCH] ASoC: dapm: Remove bodges for no-widget CODECs
  2012-03-09  2:19 ` Tabi Timur-B04825
@ 2012-03-09 12:21   ` Mark Brown
  2012-03-09 17:21     ` Liam Girdwood
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2012-03-09 12:21 UTC (permalink / raw)
  To: Tabi Timur-B04825
  Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
	Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 417 bytes --]

On Fri, Mar 09, 2012 at 02:19:02AM +0000, Tabi Timur-B04825 wrote:
> Mark Brown wrote:

> > I don't actually have any no widget CODECs so can't really test - Timur,
> > would it be possible for you to give it a spin?

> I'm assuming you're talking about the CS4270?  I don't even know what a 
> dapm widget is.  Is there anything in particular I should check when 
> testing this patch?

Does it power up.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] ASoC: dapm: Remove bodges for no-widget CODECs
  2012-03-09 12:21   ` Mark Brown
@ 2012-03-09 17:21     ` Liam Girdwood
  0 siblings, 0 replies; 5+ messages in thread
From: Liam Girdwood @ 2012-03-09 17:21 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
	Tabi Timur-B04825

On Fri, 2012-03-09 at 12:21 +0000, Mark Brown wrote:
> On Fri, Mar 09, 2012 at 02:19:02AM +0000, Tabi Timur-B04825 wrote:
> > Mark Brown wrote:
> 
> > > I don't actually have any no widget CODECs so can't really test - Timur,
> > > would it be possible for you to give it a spin?
> 
> > I'm assuming you're talking about the CS4270?  I don't even know what a 
> > dapm widget is.  Is there anything in particular I should check when 
> > testing this patch?
> 
> Does it power up.

If it works as expected:-

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

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

* Re: [PATCH] ASoC: dapm: Remove bodges for no-widget CODECs
  2012-03-08 15:06 [PATCH] ASoC: dapm: Remove bodges for no-widget CODECs Mark Brown
  2012-03-09  2:19 ` Tabi Timur-B04825
@ 2012-03-19 18:11 ` Timur Tabi
  1 sibling, 0 replies; 5+ messages in thread
From: Timur Tabi @ 2012-03-19 18:11 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, patches, Liam Girdwood

Mark Brown wrote:
> Now that we're creating widgets for all DAIs there should be no more
> need for the bodges we've been carrying for non-DAPM CODEC drivers so
> remove them.
> 
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
> 
> I don't actually have any no widget CODECs so can't really test - Timur,
> would it be possible for you to give it a spin?

It doesn't break anything, so:

Acked-by: Timur Tabi <timur@freescale.com>

Note that I don't have any DAPM support on my board.

-- 
Timur Tabi
Linux kernel developer at Freescale

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

end of thread, other threads:[~2012-03-19 18:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-08 15:06 [PATCH] ASoC: dapm: Remove bodges for no-widget CODECs Mark Brown
2012-03-09  2:19 ` Tabi Timur-B04825
2012-03-09 12:21   ` Mark Brown
2012-03-09 17:21     ` Liam Girdwood
2012-03-19 18:11 ` Timur Tabi

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).