alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 4/4] ASOC: wm8962: add some operation in wm8962_runtime_resume()
       [not found] <1359445810-2105-1-git-send-email-b13634@freescale.com>
@ 2013-01-29  9:39 ` Mark Brown
  0 siblings, 0 replies; only message in thread
From: Mark Brown @ 2013-01-29  9:39 UTC (permalink / raw)
  To: Gary Zhang; +Cc: alsa-devel, lgirdwood


[-- 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 --]



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-01-29  9:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1359445810-2105-1-git-send-email-b13634@freescale.com>
2013-01-29  9:39 ` [PATCH 4/4] ASOC: wm8962: add some operation in wm8962_runtime_resume() Mark Brown

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