9 Jan
2014
9 Jan
'14
7:25 p.m.
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)?