Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Shine Liu <shinel@foxmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH] ASoC: UDA134X Codec: Fix mute/unmute code mistake and add ADC/DAC power control support
Date: Mon, 17 Aug 2009 12:27:57 +0100	[thread overview]
Message-ID: <20090817112756.GA19898@rakim.wolfsonmicro.main> (raw)
In-Reply-To: <1250508154.1932.37.camel@shinel>

On Mon, Aug 17, 2009 at 07:22:34PM +0800, Shine Liu wrote:

> When I play a wav file using aplay, I found there's no sound. After some
> debug work, I noticed that the DAC power control bit keeps zero since
> the system started up.

Please try the patch below.

commit 6294523841a61cd1ad24f220daf6e73e9cc83184
Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
Date:   Mon Aug 17 11:55:38 2009 +0100

    ASoC: Fix handling of bias levels for non-DAPM codecs
    
    If the system doesn't have any DAPM widgets then we can't use their
    state to check if the bias level for the codec should be up.
    
    Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index c68c204..4a21a5e 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -966,6 +966,22 @@ static int dapm_power_widgets(struct snd_soc_codec *codec, int event)
 		}
 	}
 
+	/* If there are no DAPM widgets then try to figure out power from the
+	 * event type.
+	 */
+	if (list_empty(&codec->dapm_widgets)) {
+		switch (event) {
+		case SND_SOC_DAPM_STREAM_START:
+		case SND_SOC_DAPM_STREAM_RESUME:
+			sys_power = 1;
+			break;
+		case SND_SOC_DAPM_STREAM_NOP:
+			sys_power == codec->bias_level != SND_SOC_BIAS_STANDBY;
+		default:
+			break;
+		}
+	}
+
 	/* If we're changing to all on or all off then prepare */
 	if ((sys_power && codec->bias_level == SND_SOC_BIAS_STANDBY) ||
 	    (!sys_power && codec->bias_level == SND_SOC_BIAS_ON)) {

  reply	other threads:[~2009-08-17 11:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17  8:36 [PATCH] ASoC: UDA134X Codec: Fix mute/unmute code mistake and add ADC/DAC power control support Shine Liu
2009-08-17 10:32 ` Mark Brown
2009-08-17 10:52   ` [PATCH] ASoC: UDA134X: Fix mistaken mute/unmute code Shine Liu
2009-08-17 10:59     ` Mark Brown
2009-08-17 11:22   ` [PATCH] ASoC: UDA134X Codec: Fix mute/unmute code mistake and add ADC/DAC power control support Shine Liu
2009-08-17 11:27     ` Mark Brown [this message]
2009-08-17 11:53       ` Shine Liu
2009-08-17 11:56         ` Mark Brown
2009-08-17 11:43   ` [PATCH] ASoC: UDA134X: Fix mistaken mute/unmute code Shine Liu
  -- strict thread matches above, loose matches on Subject: below --
2009-08-17  6:57 [PATCH] ASoC: UDA134X Codec: Fix mute/unmute code mistake and add ADC/DAC power control support Shine Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090817112756.GA19898@rakim.wolfsonmicro.main \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=shinel@foxmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox