Index: src/sys/dev/sound/pcm/ac97.c =================================================================== RCS file: /home/ncvs/src/sys/dev/sound/pcm/ac97.c,v retrieving revision 1.53.2.3 diff -u -r1.53.2.3 ac97.c --- src/sys/dev/sound/pcm/ac97.c 9 Jan 2006 02:06:42 -0000 1.53.2.3 +++ src/sys/dev/sound/pcm/ac97.c 19 Apr 2007 04:25:03 -0000 @@ -28,6 +28,8 @@ #include #include +#include + #include "mixer_if.h" SND_DECLARE_FILE("$FreeBSD: src/sys/dev/sound/pcm/ac97.c,v 1.53.2.3 2006/01/09 02:06:42 ariff Exp $"); @@ -52,6 +54,7 @@ device_t dev; void *devinfo; u_int32_t id; + u_int32_t subvendor; unsigned count, caps, se, extcaps, extid, extstat, noext:1; u_int32_t flags; struct ac97mixtable_entry mix[32]; @@ -150,7 +153,7 @@ { 0x414c4740, 0x0f, 0, "ALC202", 0 }, { 0x414c4720, 0x0f, 0, "ALC650", 0 }, { 0x414c4752, 0x0f, 0, "ALC250", 0 }, - { 0x414c4760, 0x0f, 0, "ALC655", 0 }, + { 0x414c4760, 0x0f, 0, "ALC655", alc655_patch }, { 0x414c4770, 0x0f, 0, "ALC203", 0 }, { 0x414c4780, 0x0f, 0, "ALC658", 0 }, { 0x414c4790, 0x0f, 0, "ALC850", 0 }, @@ -403,6 +406,12 @@ return codec->caps; } +u_int32_t +ac97_getsubvendor(struct ac97_info *codec) +{ + return codec->subvendor; +} + static int ac97_setrecsrc(struct ac97_info *codec, int channel) { @@ -642,6 +651,9 @@ } codec->id = id; + codec->subvendor = (u_int32_t)pci_get_subdevice(codec->dev) << 16; + codec->subvendor |= (u_int32_t)pci_get_subvendor(codec->dev) & + 0x0000ffff; codec->noext = 0; codec_patch = NULL; Index: src/sys/dev/sound/pcm/ac97.h =================================================================== RCS file: /home/ncvs/src/sys/dev/sound/pcm/ac97.h,v retrieving revision 1.16.2.1 diff -u -r1.16.2.1 ac97.h --- src/sys/dev/sound/pcm/ac97.h 30 Dec 2005 19:55:54 -0000 1.16.2.1 +++ src/sys/dev/sound/pcm/ac97.h 19 Apr 2007 04:25:03 -0000 @@ -102,6 +102,7 @@ u_int16_t ac97_getextmode(struct ac97_info *codec); u_int16_t ac97_getextcaps(struct ac97_info *codec); u_int16_t ac97_getcaps(struct ac97_info *codec); +u_int32_t ac97_getsubvendor(struct ac97_info *codec); u_int16_t ac97_rdcd(struct ac97_info *codec, int reg); void ac97_wrcd(struct ac97_info *codec, int reg, u_int16_t val); Index: src/sys/dev/sound/pcm/ac97_patch.c =================================================================== RCS file: /home/ncvs/src/sys/dev/sound/pcm/ac97_patch.c,v retrieving revision 1.3.2.1 diff -u -r1.3.2.1 ac97_patch.c --- src/sys/dev/sound/pcm/ac97_patch.c 30 Dec 2005 19:55:54 -0000 1.3.2.1 +++ src/sys/dev/sound/pcm/ac97_patch.c 19 Apr 2007 04:25:03 -0000 @@ -56,3 +56,17 @@ ac97_wrcd(codec, AC97_MIXEXT_CLFE, 0x0000); ac97_wrcd(codec, 0x64, 0x7110); } + +void alc655_patch(struct ac97_info* codec) +{ + switch (ac97_getsubvendor(codec)) { + case 0x01311462: + case 0x01611462: + case 0x03511462: + case 0x00611462: + ac97_wrcd(codec, 0x7a, ac97_rdcd(codec, 0x7a) & 0xfffd); + break; + default: + break; + } +} Index: src/sys/dev/sound/pcm/ac97_patch.h =================================================================== RCS file: /home/ncvs/src/sys/dev/sound/pcm/ac97_patch.h,v retrieving revision 1.3.2.1 diff -u -r1.3.2.1 ac97_patch.h --- src/sys/dev/sound/pcm/ac97_patch.h 30 Dec 2005 19:55:54 -0000 1.3.2.1 +++ src/sys/dev/sound/pcm/ac97_patch.h 19 Apr 2007 04:25:03 -0000 @@ -30,3 +30,4 @@ void ad1886_patch(struct ac97_info*); void ad198x_patch(struct ac97_info*); void cmi9739_patch(struct ac97_info*); +void alc655_patch(struct ac97_info*);