Skip to content

Commit

Permalink
ALSA: cs5535audio: enable OLPC's V_REFOUT bias when recording
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chris Ball authored and Takashi Iwai committed Dec 10, 2008
1 parent 189d34e commit e463ae1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions sound/pci/cs5535audio/cs5535audio_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e463ae1

Please sign in to comment.