Skip to content

Commit

Permalink
ASoC: wm8994: VMID management improvements
Browse files Browse the repository at this point in the history
Raise the ramp time to 50ms to cover corner cases, use the startup bias
generator, explicitly reset the ramp circuit when complete and reorder
things all of which should improve performance somewhat for systems that
are sensitive to noise from VMID.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Feb 11, 2012
1 parent d60d6c3 commit cc6d5a8
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions sound/soc/codecs/wm8994.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,29 +778,37 @@ static void vmid_reference(struct snd_soc_codec *codec)
wm8994->vmid_refcount);

if (wm8994->vmid_refcount == 1) {
snd_soc_update_bits(codec, WM8994_ANTIPOP_1,
WM8994_LINEOUT_VMID_BUF_ENA |
WM8994_LINEOUT1_DISCH |
WM8994_LINEOUT2_DISCH,
WM8994_LINEOUT_VMID_BUF_ENA);

/* Startup bias, VMID ramp & buffer */
snd_soc_update_bits(codec, WM8994_ANTIPOP_2,
WM8994_BIAS_SRC |
WM8994_VMID_DISCH |
WM8994_STARTUP_BIAS_ENA |
WM8994_VMID_BUF_ENA |
WM8994_VMID_RAMP_MASK,
WM8994_BIAS_SRC |
WM8994_STARTUP_BIAS_ENA |
WM8994_VMID_BUF_ENA |
(0x3 << WM8994_VMID_RAMP_SHIFT));

wm_hubs_vmid_ena(codec);

/* Remove discharge for line out */
snd_soc_update_bits(codec, WM8994_ANTIPOP_1,
WM8994_LINEOUT1_DISCH |
WM8994_LINEOUT2_DISCH, 0);

/* Main bias enable, VMID=2x40k */
snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_1,
WM8994_BIAS_ENA |
WM8994_VMID_SEL_MASK,
WM8994_BIAS_ENA | 0x2);

msleep(20);
msleep(50);

snd_soc_update_bits(codec, WM8994_ANTIPOP_2,
WM8994_VMID_RAMP_MASK | WM8994_BIAS_SRC,
0);
}
}

Expand Down

0 comments on commit cc6d5a8

Please sign in to comment.