From 9470195a9cd13e6d90221b8b5d897e9232da8d28 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 8 Jun 2009 18:10:32 +0200 Subject: 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 --- sound/pci/ctxfi/xfi.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'sound/pci/ctxfi/xfi.c') diff --git a/sound/pci/ctxfi/xfi.c b/sound/pci/ctxfi/xfi.c index 279dac6c34d..2d3dd89af15 100644 --- a/sound/pci/ctxfi/xfi.c +++ b/sound/pci/ctxfi/xfi.c @@ -15,6 +15,7 @@ #include #include #include "ctatc.h" +#include "cthardware.h" MODULE_AUTHOR("Creative Technology Ltd"); MODULE_DESCRIPTION("X-Fi driver version 1.03"); @@ -41,8 +42,12 @@ MODULE_PARM_DESC(enable, "Enable Creative X-Fi driver"); static struct pci_device_id ct_pci_dev_ids[] = { /* only X-Fi is supported, so... */ - { PCI_DEVICE(PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_20K1) }, - { PCI_DEVICE(PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_20K2) }, + { PCI_DEVICE(PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_20K1), + .driver_data = ATC20K1, + }, + { PCI_DEVICE(PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_20K2), + .driver_data = ATC20K2, + }, { 0, } }; MODULE_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) "1 and 2, Value 2 is assumed.\n"); multiple = 2; } - err = ct_atc_create(card, pci, reference_rate, multiple, &atc); + err = ct_atc_create(card, pci, reference_rate, multiple, + pci_id->driver_data, &atc); if (err < 0) goto error; @@ -92,7 +98,8 @@ ct_card_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) strcpy(card->driver, "SB-XFi"); strcpy(card->shortname, "Creative X-Fi"); - strcpy(card->longname, "Creative ALSA Driver X-Fi"); + snprintf(card->longname, sizeof(card->longname), "%s %s %s", + card->shortname, atc->chip_name, atc->model_name); err = snd_card_register(card); if (err < 0) -- cgit v1.2.2