summaryrefslogtreecommitdiff
path: root/sound/pci/ctxfi/cthardware.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-06-08 18:10:32 +0200
committerTakashi Iwai <tiwai@suse.de>2009-06-08 18:10:32 +0200
commit9470195a9cd13e6d90221b8b5d897e9232da8d28 (patch)
tree12f57a49fe94310396f7108c267560c74189c0e0 /sound/pci/ctxfi/cthardware.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/cthardware.c')
-rw-r--r--sound/pci/ctxfi/cthardware.c31
1 files changed, 7 insertions, 24 deletions
diff --git a/sound/pci/ctxfi/cthardware.c b/sound/pci/ctxfi/cthardware.c
index 5ec6813d3911..8e64f4862e85 100644
--- a/sound/pci/ctxfi/cthardware.c
+++ b/sound/pci/ctxfi/cthardware.c
@@ -20,34 +20,16 @@
#include "cthw20k2.h"
#include <linux/bug.h>
-static enum CHIPTYP __devinitdata get_chip_type(struct hw *hw)
-{
- enum CHIPTYP type;
-
- switch (hw->pci->device) {
- case 0x0005: /* 20k1 device */
- type = ATC20K1;
- break;
- case 0x000B: /* 20k2 device */
- type = ATC20K2;
- break;
- default:
- type = ATCNONE;
- break;
- }
-
- return type;
-}
-
-int __devinit create_hw_obj(struct pci_dev *pci, struct hw **rhw)
+int __devinit create_hw_obj(struct pci_dev *pci, enum CHIPTYP chip_type,
+ enum CTCARDS model, struct hw **rhw)
{
int err;
- switch (pci->device) {
- case 0x0005: /* 20k1 device */
+ switch (chip_type) {
+ case ATC20K1:
err = create_20k1_hw_obj(rhw);
break;
- case 0x000B: /* 20k2 device */
+ case ATC20K2:
err = create_20k2_hw_obj(rhw);
break;
default:
@@ -58,7 +40,8 @@ int __devinit create_hw_obj(struct pci_dev *pci, struct hw **rhw)
return err;
(*rhw)->pci = pci;
- (*rhw)->get_chip_type = get_chip_type;
+ (*rhw)->chip_type = chip_type;
+ (*rhw)->model = model;
return 0;
}