alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Gary Zhang <b13634@freescale.com>
Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com
Subject: Re: [PATCH 4/4] ASOC: wm8962: add some operation in wm8962_runtime_resume()
Date: Tue, 29 Jan 2013 17:39:29 +0800	[thread overview]
Message-ID: <20130129093926.GD32597@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1359445810-2105-1-git-send-email-b13634@freescale.com>


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

On Tue, Jan 29, 2013 at 03:50:10PM +0800, Gary Zhang wrote:
> 1. in this function, after wm8962_reset() is called, WM8962_SYSCLK_ENA bit
> is reset to 1. make sure it is off so we can safely write to registers if
> the device is declocked.
> 2. add bias level management

Split separate changes into separate patches; obviously there's bias
level management in the driver since otherwise it'd be totally
non-functional.

> @@ -3721,6 +3721,24 @@ static int wm8962_runtime_resume(struct device *dev)
>  
>  	regcache_sync(wm8962->regmap);
>  
> +	regmap_update_bits(wm8962->regmap, WM8962_CLOCKING2,
> +				WM8962_SYSCLK_ENA, 0);
> +

This seems like a bodge to work around some other problem in your
system.  The device should never be runtime suspended with an active
clock, and this seems like it isn't going to work as most of the
register cache restore will be done with SYSCLK enabled.  We need to
figure out what went wrong to allow the device to enter runtime suspend
with SYSCLK on.

> +	regmap_update_bits(wm8962->regmap, WM8962_ANTI_POP,
> +				WM8962_STARTUP_BIAS_ENA | WM8962_VMID_BUF_ENA,
> +				WM8962_STARTUP_BIAS_ENA | WM8962_VMID_BUF_ENA);
> +
> +	/* Bias enable at 2*50k for ramp */
> +	regmap_update_bits(wm8962->regmap, WM8962_PWR_MGMT_1,
> +				WM8962_VMID_SEL_MASK | WM8962_BIAS_ENA,
> +				WM8962_BIAS_ENA | 0x180);
> +
> +	msleep(5);
> +
> +	/* VMID back to 2x250k for standby */
> +	regmap_update_bits(wm8962->regmap, WM8962_PWR_MGMT_1,
> +				WM8962_VMID_SEL_MASK, 0x100);

We already have code to ramp VMID when exiting _OFF...

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

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



           reply	other threads:[~2013-01-29  9:39 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1359445810-2105-1-git-send-email-b13634@freescale.com>]

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=20130129093926.GD32597@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=b13634@freescale.com \
    --cc=lgirdwood@gmail.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;
as well as URLs for NNTP newsgroup(s).