From: Marc Boucher Date: Tue, 22 Jan 2008 14:32:25 +0000 (+0100) Subject: [ALSA] hda-codec - Add afg and mfg preset mask X-Git-Tag: v2.6.25-rc1~1127^2~54 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca7cfae9eb91c012ac448dc6816ded6285f6f39a;p=linux-2.6 [ALSA] hda-codec - Add afg and mfg preset mask Added afg and mfg preset masks for more finer codec-preset selection. Signed-off-by: Marc Boucher Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 6b93f45111..d4fd94805e 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -429,6 +429,10 @@ find_codec_preset(struct hda_codec *codec) for (tbl = hda_preset_tables; *tbl; tbl++) { for (preset = *tbl; preset->id; preset++) { u32 mask = preset->mask; + if (preset->afg && preset->afg != codec->afg) + continue; + if (preset->mfg && preset->mfg != codec->mfg) + continue; if (!mask) mask = ~0; if (preset->id == (codec->vendor_id & mask) && diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index eb4a2ae792..f14871151b 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h @@ -523,6 +523,7 @@ struct hda_codec_preset { unsigned int subs; unsigned int subs_mask; unsigned int rev; + hda_nid_t afg, mfg; const char *name; int (*patch)(struct hda_codec *codec); };