[alsa-devel] [PATCH] ASoC: fsl: imx-wm8962: Grant hw_params() permission to reprogram FLL

Mark Brown broonie at kernel.org
Thu Jan 9 19:25:51 CET 2014


On Wed, Dec 25, 2013 at 06:37:15PM +0800, Nicolin Chen wrote:

> +	spin_lock(&data->fll_lock);
> +
> +	/* Protect FLL if it has not been disabled */
> +	if (data->fll_frequency)
> +		goto err_unlock;
> +
> +	ret = snd_soc_dai_set_pll(codec_dai, WM8962_FLL, WM8962_FLL_MCLK,
> +				  data->clk_frequency, fll_frequency);

You can't hold a spinlock and call sleeping functions like set_pll()
safely - it might do I/O and both the ASoC core and regmap use mutexes
which might be contended.

> +	mask = WM8962_MIXINL_TO_HPMIXL_MASK | WM8962_MIXINR_TO_HPMIXL_MASK |
> +		WM8962_IN4L_TO_HPMIXL_MASK | WM8962_IN4R_TO_HPMIXL_MASK;
> +	ret |= snd_soc_read(codec, WM8962_HEADPHONE_MIXER_1) & mask;
> +	ret |= snd_soc_read(codec, WM8962_HEADPHONE_MIXER_2) & mask;
> +	ret |= snd_soc_read(codec, WM8962_SPEAKER_MIXER_1) & mask;
> +	ret |= snd_soc_read(codec, WM8962_SPEAKER_MIXER_2) & mask;

Peering inside the CODEC register map isn't great and given that we
implement bias level changes for non-CPU paths immediately I'm not sure
what that's giving you over just using the bias level (which is the way
you're supposed to check if the CODEC is active)?
-------------- 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/20140109/b7b9bebb/attachment.sig>


More information about the Alsa-devel mailing list