aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-11-24 15:35:18 +0100
committerJaroslav Kysela <perex@suse.cz>2007-02-09 09:01:48 +0100
commitf41bea84c030793b502aa2526bb22476788e731e (patch)
treebce9663227044dd9350a5890e389411ac58cfe30
parentd9ea472c743ccd7344055cb118bc210befbd8007 (diff)
[ALSA] atiixp - Use quirk list helper function
Clean up ac97_codec quirk using snd_pci_quirk_lookup(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r--sound/pci/atiixp.c36
1 files changed, 10 insertions, 26 deletions
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index 92df811d695..7d8053b5e8d 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -296,21 +296,9 @@ static struct pci_device_id snd_atiixp_ids[] = {
MODULE_DEVICE_TABLE(pci, snd_atiixp_ids);
-struct atiixp_quirk {
- unsigned short subvendor;
- unsigned short subdevice;
- const char *name;
- int ac97_codec;
-};
-
-static struct atiixp_quirk atiixp_quirks[] __devinitdata = {
- {
- .subvendor = 0x15bd,
- .subdevice = 0x3100,
- .name = "DFI RS482",
- .ac97_codec = 0,
- },
- { .subvendor = 0 } /* terminator */
+static struct snd_pci_quirk atiixp_quirks[] __devinitdata = {
+ SND_PCI_QUIRK(0x15bd, 0x3100, "DFI RS482", 0),
+ { } /* terminator */
};
/*
@@ -574,17 +562,13 @@ static int snd_atiixp_aclink_down(struct atiixp *chip)
static int ac97_probing_bugs(struct pci_dev *pci)
{
- int i = 0;
-
- while (atiixp_quirks[i].subvendor) {
- if (pci->subsystem_vendor == atiixp_quirks[i].subvendor &&
- pci->subsystem_device == atiixp_quirks[i].subdevice) {
- printk(KERN_INFO "Atiixp quirk for %s. "
- "Forcing codec %d\n", atiixp_quirks[i].name,
- atiixp_quirks[i].ac97_codec);
- return atiixp_quirks[i].ac97_codec;
- }
- i++;
+ const struct snd_pci_quirk *q;
+
+ q = snd_pci_quirk_lookup(pci, atiixp_quirks);
+ if (q) {
+ snd_printdd(KERN_INFO "Atiixp quirk for %s. "
+ "Forcing codec %d\n", q->name, q->value);
+ return q->value;
}
/* this hardware doesn't need workarounds. Probe for codec */
return -1;