[alsa-devel] [PATCH 4/4] ASOC: wm8962: add some operation in wm8962_runtime_resume()

Mark Brown broonie at opensource.wolfsonmicro.com
Tue Jan 29 10:39:29 CET 2013


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...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20130129/1401925e/attachment.sig>


More information about the Alsa-devel mailing list