aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@suse.cz>2004-04-24 20:29:42 +0200
committerJaroslav Kysela <perex@suse.cz>2004-04-24 20:29:42 +0200
commitb4e34ef42f439232a0ad463e517331cadacdc858 (patch)
tree5c710341ce8b777993dc30d7c73130bfb4471f9e /sound
parent774a86172c170f27092c0ce29312ffdd2f0de2f7 (diff)
downloadhistory-b4e34ef42f439232a0ad463e517331cadacdc858.tar.gz
ALSA CVS update - Takashi Iwai <tiwai@suse.de>
AC97 Codec Core added the mic/center sharing switch of cm9739 codec again.
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/ac97/ac97_patch.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c
index c871d5a5d46332..6c1efbfa185634 100644
--- a/sound/pci/ac97/ac97_patch.c
+++ b/sound/pci/ac97/ac97_patch.c
@@ -1362,8 +1362,34 @@ static const snd_kcontrol_new_t snd_ac97_cm9739_controls_spdif[] = {
/* BIT 8: SPD32 - 32bit SPDIF - not supported yet */
};
+static int snd_ac97_cm9739_center_mic_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+ ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+ if (ac97->regs[AC97_CM9739_MULTI_CHAN] & 0x1000)
+ ucontrol->value.integer.value[0] = 1;
+ else
+ ucontrol->value.integer.value[0] = 0;
+ return 0;
+}
+
+static int snd_ac97_cm9739_center_mic_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol)
+{
+ ac97_t *ac97 = snd_kcontrol_chip(kcontrol);
+ return snd_ac97_update_bits(ac97, AC97_CM9739_MULTI_CHAN, 0x3000,
+ ucontrol->value.integer.value[0] ?
+ 0x1000 : 0x2000);
+}
+
static const snd_kcontrol_new_t snd_ac97_cm9739_controls[] = {
AC97_SINGLE("Line-In As Surround", AC97_CM9739_MULTI_CHAN, 10, 1, 0),
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Mic As Center/LFE",
+ .info = snd_ac97_info_single,
+ .get = snd_ac97_cm9739_center_mic_get,
+ .put = snd_ac97_cm9739_center_mic_put,
+ .private_value = AC97_SINGLE_VALUE(0, 0, 1, 0) /* only mask needed */
+ },
};
static int patch_cm9739_specific(ac97_t * ac97)
@@ -1398,10 +1424,13 @@ int patch_cm9739(ac97_t * ac97)
}
/* set-up multi channel */
- /* bit 13: enable internal vref output for mic */
- /* bit 12: enable center/lfe */
/* bit 14: 0 = SPDIF, 1 = EAPD */
- val = (1 << 12) | (1 << 13);
+ /* bit 13: enable internal vref output for mic */
+ /* bit 12: disable center/lfe (swithable) */
+ /* bit 10: disable surround/line (switchable) */
+ /* bit 9: mix 2 surround off */
+ /* bit 0: dB */
+ val = (1 << 13);
if (! (ac97->ext_id & AC97_EI_SPDIF))
val |= (1 << 14);
snd_ac97_write_cache(ac97, AC97_CM9739_MULTI_CHAN, val);