public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Troy Kisky <troy.kisky@boundarydevices.com>
To: Anuj Aggarwal <anuj.aggarwal@ti.com>
Cc: alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
	Arun KS <arunks@mistralsolutions.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCH] ASoC: AM3517: Fix AIC23 suspend/resume hang
Date: Wed, 25 Nov 2009 13:22:42 -0700	[thread overview]
Message-ID: <4B0D9212.1060805@boundarydevices.com> (raw)
In-Reply-To: <1259154631-15251-1-git-send-email-anuj.aggarwal@ti.com>

Anuj Aggarwal wrote:
> System hang is observed While trying to do suspend. It was because
> of an infinite loop in the AIC23 resume path which was trying to
> restore AIC23 register values from the register cache.
> 
> This patch fixes the problem by correcting the resume path and
> properly activating/deactivating the digital interface while
> doing the suspend / off transitions.
> 
> Signed-off-by: Anuj Aggarwal <anuj.aggarwal@ti.com>
> ---
>  sound/soc/codecs/tlv320aic23.c |   16 +++-------------
>  1 files changed, 3 insertions(+), 13 deletions(-)
> 
> diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c
> index 6b24d8b..cabe60c 100644
> --- a/sound/soc/codecs/tlv320aic23.c
> +++ b/sound/soc/codecs/tlv320aic23.c
> @@ -565,13 +565,12 @@ static int tlv320aic23_set_bias_level(struct snd_soc_codec *codec,
>  	case SND_SOC_BIAS_PREPARE:
>  		break;
>  	case SND_SOC_BIAS_STANDBY:
> -		/* everything off except vref/vmid, */
> -		tlv320aic23_write(codec, TLV320AIC23_PWR, reg | 0x0040);
> +		/* Activate the digital interface */
> +		tlv320aic23_write(codec, TLV320AIC23_ACTIVE, 0x1);
>  		break;
>  	case SND_SOC_BIAS_OFF:
> -		/* everything off, dac mute, inactive */
> +		/* Deactivate the digital interface */
>  		tlv320aic23_write(codec, TLV320AIC23_ACTIVE, 0x0);
> -		tlv320aic23_write(codec, TLV320AIC23_PWR, 0xffff);
>  		break;
>  	}
>  	codec->bias_level = level;
> @@ -615,7 +614,6 @@ static int tlv320aic23_suspend(struct platform_device *pdev,
>  	struct snd_soc_device *socdev = platform_get_drvdata(pdev);
>  	struct snd_soc_codec *codec = socdev->card->codec;
>  
> -	tlv320aic23_write(codec, TLV320AIC23_ACTIVE, 0x0);
>  	tlv320aic23_set_bias_level(codec, SND_SOC_BIAS_OFF);
>  
>  	return 0;
> @@ -625,14 +623,6 @@ static int tlv320aic23_resume(struct platform_device *pdev)
>  {
>  	struct snd_soc_device *socdev = platform_get_drvdata(pdev);
>  	struct snd_soc_codec *codec = socdev->card->codec;
> -	int i;
> -	u16 reg;
> -
> -	/* Sync reg_cache with the hardware */
> -	for (reg = 0; reg < ARRAY_SIZE(tlv320aic23_reg); i++) {
> -		u16 val = tlv320aic23_read_reg_cache(codec, reg);
> -		tlv320aic23_write(codec, reg, val);
> -	}

Changing to
	for (reg = 0; reg < ARRAY_SIZE(tlv320aic23_reg); reg++) {

should be enough to fix the infinite loop.
Could you try this without the rest of the patch?

>  
>  	tlv320aic23_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
>  	tlv320aic23_set_bias_level(codec, codec->suspend_bias_level);

Adding Arun to cc list

  parent reply	other threads:[~2009-11-25 20:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25 13:10 [PATCH] ASoC: AM3517: Fix AIC23 suspend/resume hang Anuj Aggarwal
2009-11-25 13:33 ` Mark Brown
2009-11-25 19:19   ` Aggarwal, Anuj
2009-11-25 19:39     ` Mark Brown
2009-11-26  3:19       ` Aggarwal, Anuj
2009-11-25 20:22 ` Troy Kisky [this message]
2009-11-26  3:01   ` Aggarwal, Anuj
2009-11-26 10:22     ` [alsa-devel] " Mark Brown
2009-11-26 14:56       ` Aggarwal, Anuj
2009-11-26 15:11         ` Mark Brown
2009-11-26 15:22           ` Aggarwal, Anuj
2009-11-26 15:24             ` Aggarwal, Anuj
2009-11-26 15:29             ` Mark Brown
2009-11-27  8:07               ` Aggarwal, Anuj
2009-11-27 11:42                 ` [alsa-devel] " Mark Brown
2009-11-27 11:47                 ` Mark Brown
2009-11-26 15:42             ` Philby John

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=4B0D9212.1060805@boundarydevices.com \
    --to=troy.kisky@boundarydevices.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=anuj.aggarwal@ti.com \
    --cc=arunks@mistralsolutions.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-omap@vger.kernel.org \
    /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