diff options
author | Chris Ball <cjb@laptop.org> | 2008-11-06 16:50:09 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-12-10 17:14:45 +0100 |
commit | e463ae1d13ffe4943bb31f47cc6f24415e55a59a (patch) | |
tree | 676f8dd8713fa32c40409d7766c3013486efcfeb /sound/pci | |
parent | 189d34e747e9540b70227f6682bd680868d90b10 (diff) | |
download | kernel_samsung_smdk4412-e463ae1d13ffe4943bb31f47cc6f24415e55a59a.tar.gz kernel_samsung_smdk4412-e463ae1d13ffe4943bb31f47cc6f24415e55a59a.tar.bz2 kernel_samsung_smdk4412-e463ae1d13ffe4943bb31f47cc6f24415e55a59a.zip |
ALSA: cs5535audio: enable OLPC's V_REFOUT bias when recording
The OLPC has a privacy light hooked up in series with the microphone's
V_Ref bias. We want to activate the bias while we are capturing audio.
Signed-off-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/cs5535audio/cs5535audio_pcm.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sound/pci/cs5535audio/cs5535audio_pcm.c b/sound/pci/cs5535audio/cs5535audio_pcm.c index 6aa0c19390d..fa2a6b1b81a 100644 --- a/sound/pci/cs5535audio/cs5535audio_pcm.c +++ b/sound/pci/cs5535audio/cs5535audio_pcm.c @@ -363,11 +363,27 @@ static int snd_cs5535audio_capture_open(struct snd_pcm_substream *substream) if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) return err; + +#ifdef CONFIG_OLPC + /* Enable the V_ref bias only while recording. */ + err = snd_ac97_update_bits(cs5535au->ac97, AC97_AD_MISC, + 1 << AC97_AD_VREFD_SHIFT, 0); + if (err < 0) + snd_printk(KERN_ERR "Error updating AD_MISC %d\n", err); +#endif return 0; } static int snd_cs5535audio_capture_close(struct snd_pcm_substream *substream) { + int err; + struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream); + +#ifdef CONFIG_OLPC + /* Disable V_ref bias. */ + err = snd_ac97_update_bits(cs5535au->ac97, AC97_AD_MISC, + 1 << AC97_AD_VREFD_SHIFT, 1 << AC97_AD_VREFD_SHIFT); +#endif return 0; } |