Update of /cvsroot/alsa/alsa-kernel/pci/ac97 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1747
Modified Files: ac97_patch.c Log Message: added the mic/center sharing switch of cm9739 codec again. Index: ac97_patch.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_patch.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- ac97_patch.c 16 Apr 2004 15:01:08 -0000 1.44 +++ ac97_patch.c 16 Apr 2004 18:25:15 -0000 1.45 @@ -1362,8 +1362,34 @@ /* 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 @@ } /* 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); ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Alsa-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-cvslog