diff options
-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 6aa0c19390d7..fa2a6b1b81a6 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) | |||
363 | if ((err = snd_pcm_hw_constraint_integer(runtime, | 363 | if ((err = snd_pcm_hw_constraint_integer(runtime, |
364 | SNDRV_PCM_HW_PARAM_PERIODS)) < 0) | 364 | SNDRV_PCM_HW_PARAM_PERIODS)) < 0) |
365 | return err; | 365 | return err; |
366 | |||
367 | #ifdef CONFIG_OLPC | ||
368 | /* Enable the V_ref bias only while recording. */ | ||
369 | err = snd_ac97_update_bits(cs5535au->ac97, AC97_AD_MISC, | ||
370 | 1 << AC97_AD_VREFD_SHIFT, 0); | ||
371 | if (err < 0) | ||
372 | snd_printk(KERN_ERR "Error updating AD_MISC %d\n", err); | ||
373 | #endif | ||
366 | return 0; | 374 | return 0; |
367 | } | 375 | } |
368 | 376 | ||
369 | static int snd_cs5535audio_capture_close(struct snd_pcm_substream *substream) | 377 | static int snd_cs5535audio_capture_close(struct snd_pcm_substream *substream) |
370 | { | 378 | { |
379 | int err; | ||
380 | struct cs5535audio *cs5535au = snd_pcm_substream_chip(substream); | ||
381 | |||
382 | #ifdef CONFIG_OLPC | ||
383 | /* Disable V_ref bias. */ | ||
384 | err = snd_ac97_update_bits(cs5535au->ac97, AC97_AD_MISC, | ||
385 | 1 << AC97_AD_VREFD_SHIFT, 1 << AC97_AD_VREFD_SHIFT); | ||
386 | #endif | ||
371 | return 0; | 387 | return 0; |
372 | } | 388 | } |
373 | 389 | ||