[ALSA] hda-codec - Add afg and mfg preset mask

Previous thread: [ALSA] fix opti9xx/miro section mismatch by Linux Kernel Mailing List on Thursday, January 31, 2008 - 5:04 pm. (1 message)

Next thread: [ALSA] hda: Added mono_out_pin to autoconfig by Linux Kernel Mailing List on Thursday, January 31, 2008 - 5:04 pm. (1 message)
From: Linux Kernel Mailing List
Date: Thursday, January 31, 2008 - 5:04 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ca7cfa...
Commit:     ca7cfae9eb91c012ac448dc6816ded6285f6f39a
Parent:     1cfd52bc1ad516dbdc23839d40013dea4c19c70a
Author:     Marc Boucher <marc@linuxant.com>
AuthorDate: Tue Jan 22 15:32:25 2008 +0100
Committer:  Jaroslav Kysela <perex@perex.cz>
CommitDate: Thu Jan 31 17:30:10 2008 +0100

    [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 <marc@linuxant.com>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
 sound/pci/hda/hda_codec.c |    4 ++++
 sound/pci/hda/hda_codec.h |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 6b93f45..d4fd948 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 eb4a2ae..f148711 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);
 };
-

Previous thread: [ALSA] fix opti9xx/miro section mismatch by Linux Kernel Mailing List on Thursday, January 31, 2008 - 5:04 pm. (1 message)

Next thread: [ALSA] hda: Added mono_out_pin to autoconfig by Linux Kernel Mailing List on Thursday, January 31, 2008 - 5:04 pm. (1 message)