From: Andres Salomon <dilinger@queued.net>
To: "Jaya Kumar" <jayakumar.lkml@gmail.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
Takashi Iwai <tiwai@suse.de>, Chris Ball <cjb@laptop.org>
Subject: [PATCH 9/14] ALSA: cs5535audio: enable OLPC's V_REFOUT bias when recording
Date: Thu, 6 Nov 2008 16:50:09 -0500 [thread overview]
Message-ID: <20081106165009.25e722f2@ephemeral> (raw)
From: Chris Ball <cjb@laptop.org>
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>
---
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 6aa0c19..fa2a6b1 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;
}
--
1.5.6.5
reply other threads:[~2008-11-06 21:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081106165009.25e722f2@ephemeral \
--to=dilinger@queued.net \
--cc=akpm@linux-foundation.org \
--cc=cjb@laptop.org \
--cc=jayakumar.lkml@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox