aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi/xfi.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-06-08 12:10:32 -0400
committerTakashi Iwai <tiwai@suse.de>2009-06-08 12:10:32 -0400
commit9470195a9cd13e6d90221b8b5d897e9232da8d28 (patch)
tree12f57a49fe94310396f7108c267560c74189c0e0 /sound/pci/ctxfi/xfi.c
parentd362af62ed98f58c64a2b3dd58c79d25ad181b0b (diff)
ALSA: ctxfi - Clean up probe routines
Clean up probe routines and model detection routines so that the driver won't call and check the PCI subsystem id at each time. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ctxfi/xfi.c')
-rw-r--r--sound/pci/ctxfi/xfi.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sound/pci/ctxfi/xfi.c b/sound/pci/ctxfi/xfi.c
index 279dac6c34dd..2d3dd89af151 100644
--- a/sound/pci/ctxfi/xfi.c
+++ b/sound/pci/ctxfi/xfi.c
@@ -15,6 +15,7 @@
15#include <sound/core.h> 15#include <sound/core.h>
16#include <sound/initval.h> 16#include <sound/initval.h>
17#include "ctatc.h" 17#include "ctatc.h"
18#include "cthardware.h"
18 19
19MODULE_AUTHOR("Creative Technology Ltd"); 20MODULE_AUTHOR("Creative Technology Ltd");
20MODULE_DESCRIPTION("X-Fi driver version 1.03"); 21MODULE_DESCRIPTION("X-Fi driver version 1.03");
@@ -41,8 +42,12 @@ MODULE_PARM_DESC(enable, "Enable Creative X-Fi driver");
41 42
42static struct pci_device_id ct_pci_dev_ids[] = { 43static struct pci_device_id ct_pci_dev_ids[] = {
43 /* only X-Fi is supported, so... */ 44 /* only X-Fi is supported, so... */
44 { PCI_DEVICE(PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_20K1) }, 45 { PCI_DEVICE(PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_20K1),
45 { PCI_DEVICE(PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_20K2) }, 46 .driver_data = ATC20K1,
47 },
48 { PCI_DEVICE(PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_20K2),
49 .driver_data = ATC20K2,
50 },
46 { 0, } 51 { 0, }
47}; 52};
48MODULE_DEVICE_TABLE(pci, ct_pci_dev_ids); 53MODULE_DEVICE_TABLE(pci, ct_pci_dev_ids);
@@ -79,7 +84,8 @@ ct_card_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
79 "1 and 2, Value 2 is assumed.\n"); 84 "1 and 2, Value 2 is assumed.\n");
80 multiple = 2; 85 multiple = 2;
81 } 86 }
82 err = ct_atc_create(card, pci, reference_rate, multiple, &atc); 87 err = ct_atc_create(card, pci, reference_rate, multiple,
88 pci_id->driver_data, &atc);
83 if (err < 0) 89 if (err < 0)
84 goto error; 90 goto error;
85 91
@@ -92,7 +98,8 @@ ct_card_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
92 98
93 strcpy(card->driver, "SB-XFi"); 99 strcpy(card->driver, "SB-XFi");
94 strcpy(card->shortname, "Creative X-Fi"); 100 strcpy(card->shortname, "Creative X-Fi");
95 strcpy(card->longname, "Creative ALSA Driver X-Fi"); 101 snprintf(card->longname, sizeof(card->longname), "%s %s %s",
102 card->shortname, atc->chip_name, atc->model_name);
96 103
97 err = snd_card_register(card); 104 err = snd_card_register(card);
98 if (err < 0) 105 if (err < 0)