Update of /cvsroot/alsa/alsa-kernel/pci/ac97
In directory sc8-pr-cvs1:/tmp/cvs-serv15504/pci/ac97
Modified Files:
ac97_codec.c ac97_patch.c ac97_patch.h
Log Message:
- added quirk type AC97_TUNE_AD_SHARING.
- added mask field to snd_ac97_quirk.
- new patch for AD1985. set more config bits for line/mic sharing.
- rewritten quirk table in C99 init style.
- more quirks for intel ICH5/AD1985 boards.
Index: ac97_codec.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_codec.c,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -r1.99 -r1.100
--- ac97_codec.c 1 Jul 2003 10:07:54 -0000 1.99
+++ ac97_codec.c 30 Jul 2003 10:54:03 -0000 1.100
@@ -103,7 +103,7 @@
{ 0x41445370, 0xffffffff, "AD1980", patch_ad1980, NULL },
{ 0x41445372, 0xffffffff, "AD1981A", patch_ad1881, NULL },
{ 0x41445374, 0xffffffff, "AD1981B", patch_ad1881, NULL },
-{ 0x41445375, 0xffffffff, "AD1985", patch_ad1980, NULL },
+{ 0x41445375, 0xffffffff, "AD1985", patch_ad1985, NULL },
{ 0x414c4300, 0xfffffff0, "RL5306", NULL, NULL },
{ 0x414c4310, 0xfffffff0, "RL5382", NULL, NULL },
{ 0x414c4320, 0xfffffff0, "RL5383", NULL, NULL },
@@ -2235,6 +2235,14 @@
return 0;
}
+static int tune_ad_sharing(ac97_t *ac97)
+{
+ unsigned short scfg;
+ /* Turn on OMS bit to route microphone to back panel */
+ scfg = snd_ac97_read(ac97, AC97_AD_SERIAL_CFG);
+ snd_ac97_write_cache(ac97, AC97_AD_SERIAL_CFG, scfg | 0x0200);
+ return swap_headphone(ac97, 1);
+}
/**
* snd_ac97_tune_hardware - tune up the hardware
@@ -2253,7 +2261,10 @@
snd_assert(quirk, return -EINVAL);
for (; quirk->vendor; quirk++) {
- if (quirk->vendor == ac97->subsystem_vendor && quirk->device ==
ac97->subsystem_device) {
+ if (quirk->vendor != ac97->subsystem_vendor)
+ continue;
+ if ((! quirk->mask && quirk->device == ac97->subsystem_device) ||
+ quirk->device == (quirk->mask & ac97->subsystem_device)) {
snd_printdd("ac97 quirk for %s (%04x:%04x)\n", quirk->name,
ac97->subsystem_vendor, ac97->subsystem_device);
switch (quirk->type) {
case AC97_TUNE_HP_ONLY:
@@ -2262,6 +2273,8 @@
return swap_headphone(ac97, 0);
case AC97_TUNE_SWAP_SURROUND:
return swap_surround(ac97);
+ case AC97_TUNE_AD_SHARING:
+ return tune_ad_sharing(ac97);
}
snd_printk(KERN_ERR "invalid quirk type %d for %s\n",
quirk->type, quirk->name);
return -EINVAL;
Index: ac97_patch.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_patch.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- ac97_patch.c 26 Jul 2003 09:46:14 -0000 1.17
+++ ac97_patch.c 30 Jul 2003 10:54:03 -0000 1.18
@@ -759,6 +759,19 @@
return 0;
}
+int patch_ad1985(ac97_t * ac97)
+{
+ unsigned short misc;
+
+ patch_ad1881(ac97);
+ ac97->build_ops = &patch_ad1980_build_ops;
+ misc = snd_ac97_read(ac97, AC97_AD_MISC);
+ /* switch front/surround line-out/hp-out */
+ /* center/LFE, surround in High-Z mode */
+ snd_ac97_write_cache(ac97, AC97_AD_MISC, misc | 0x1c28);
+ return 0;
+}
+
static const snd_kcontrol_new_t snd_ac97_controls_alc650[] = {
AC97_SINGLE("Duplicate Front", AC97_ALC650_MULTICH, 0, 1, 0),
AC97_SINGLE("Surround Down Mix", AC97_ALC650_MULTICH, 1, 1, 0),
Index: ac97_patch.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ac97/ac97_patch.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ac97_patch.h 17 Jun 2003 18:43:32 -0000 1.8
+++ ac97_patch.h 30 Jul 2003 10:54:03 -0000 1.9
@@ -42,6 +42,7 @@
int patch_ad1885(ac97_t * ac97);
int patch_ad1886(ac97_t * ac97);
int patch_ad1980(ac97_t * ac97);
+int patch_ad1985(ac97_t * ac97);
int patch_alc650(ac97_t * ac97);
int patch_cm9738(ac97_t * ac97);
int patch_cm9739(ac97_t * ac97);
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog