aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2010-02-16 05:25:03 -0500
committerJaroslav Kysela <perex@perex.cz>2010-02-16 05:25:03 -0500
commitb8f1f5983fbe751aa3d07d9ce7ebb0c23bf4b7e4 (patch)
treee9f11863f683a9f4eb03d76008740a36d6b4ff3c /sound/pci/ctxfi
parentba9341dfef6b0201cd30e3904dcd0a47d3dc35e0 (diff)
parent47b5d028fdce8f809bf22852ac900338fb90e8aa (diff)
Merge branch 'topic/misc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 into devel
Diffstat (limited to 'sound/pci/ctxfi')
-rw-r--r--sound/pci/ctxfi/ctatc.c23
-rw-r--r--sound/pci/ctxfi/ctatc.h2
-rw-r--r--sound/pci/ctxfi/xfi.c7
3 files changed, 21 insertions, 11 deletions
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c
index 459c1f62783b..480cb1e905b6 100644
--- a/sound/pci/ctxfi/ctatc.c
+++ b/sound/pci/ctxfi/ctatc.c
@@ -1214,10 +1214,11 @@ static int atc_dev_free(struct snd_device *dev)
1214 return ct_atc_destroy(atc); 1214 return ct_atc_destroy(atc);
1215} 1215}
1216 1216
1217static int __devinit atc_identify_card(struct ct_atc *atc) 1217static int __devinit atc_identify_card(struct ct_atc *atc, unsigned int ssid)
1218{ 1218{
1219 const struct snd_pci_quirk *p; 1219 const struct snd_pci_quirk *p;
1220 const struct snd_pci_quirk *list; 1220 const struct snd_pci_quirk *list;
1221 u16 vendor_id, device_id;
1221 1222
1222 switch (atc->chip_type) { 1223 switch (atc->chip_type) {
1223 case ATC20K1: 1224 case ATC20K1:
@@ -1231,13 +1232,19 @@ static int __devinit atc_identify_card(struct ct_atc *atc)
1231 default: 1232 default:
1232 return -ENOENT; 1233 return -ENOENT;
1233 } 1234 }
1234 p = snd_pci_quirk_lookup(atc->pci, list); 1235 if (ssid) {
1236 vendor_id = ssid >> 16;
1237 device_id = ssid & 0xffff;
1238 } else {
1239 vendor_id = atc->pci->subsystem_vendor;
1240 device_id = atc->pci->subsystem_device;
1241 }
1242 p = snd_pci_quirk_lookup_id(vendor_id, device_id, list);
1235 if (p) { 1243 if (p) {
1236 if (p->value < 0) { 1244 if (p->value < 0) {
1237 printk(KERN_ERR "ctxfi: " 1245 printk(KERN_ERR "ctxfi: "
1238 "Device %04x:%04x is black-listed\n", 1246 "Device %04x:%04x is black-listed\n",
1239 atc->pci->subsystem_vendor, 1247 vendor_id, device_id);
1240 atc->pci->subsystem_device);
1241 return -ENOENT; 1248 return -ENOENT;
1242 } 1249 }
1243 atc->model = p->value; 1250 atc->model = p->value;
@@ -1250,8 +1257,7 @@ static int __devinit atc_identify_card(struct ct_atc *atc)
1250 atc->model_name = ct_subsys_name[atc->model]; 1257 atc->model_name = ct_subsys_name[atc->model];
1251 snd_printd("ctxfi: chip %s model %s (%04x:%04x) is found\n", 1258 snd_printd("ctxfi: chip %s model %s (%04x:%04x) is found\n",
1252 atc->chip_name, atc->model_name, 1259 atc->chip_name, atc->model_name,
1253 atc->pci->subsystem_vendor, 1260 vendor_id, device_id);
1254 atc->pci->subsystem_device);
1255 return 0; 1261 return 0;
1256} 1262}
1257 1263
@@ -1625,7 +1631,8 @@ static struct ct_atc atc_preset __devinitdata = {
1625 1631
1626int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci, 1632int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci,
1627 unsigned int rsr, unsigned int msr, 1633 unsigned int rsr, unsigned int msr,
1628 int chip_type, struct ct_atc **ratc) 1634 int chip_type, unsigned int ssid,
1635 struct ct_atc **ratc)
1629{ 1636{
1630 struct ct_atc *atc; 1637 struct ct_atc *atc;
1631 static struct snd_device_ops ops = { 1638 static struct snd_device_ops ops = {
@@ -1651,7 +1658,7 @@ int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci,
1651 mutex_init(&atc->atc_mutex); 1658 mutex_init(&atc->atc_mutex);
1652 1659
1653 /* Find card model */ 1660 /* Find card model */
1654 err = atc_identify_card(atc); 1661 err = atc_identify_card(atc, ssid);
1655 if (err < 0) { 1662 if (err < 0) {
1656 printk(KERN_ERR "ctatc: Card not recognised\n"); 1663 printk(KERN_ERR "ctatc: Card not recognised\n");
1657 goto error1; 1664 goto error1;
diff --git a/sound/pci/ctxfi/ctatc.h b/sound/pci/ctxfi/ctatc.h
index 9fd8a5708943..7167c0185d52 100644
--- a/sound/pci/ctxfi/ctatc.h
+++ b/sound/pci/ctxfi/ctatc.h
@@ -148,7 +148,7 @@ struct ct_atc {
148 148
149int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci, 149int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci,
150 unsigned int rsr, unsigned int msr, int chip_type, 150 unsigned int rsr, unsigned int msr, int chip_type,
151 struct ct_atc **ratc); 151 unsigned int subsysid, struct ct_atc **ratc);
152int __devinit ct_atc_create_alsa_devs(struct ct_atc *atc); 152int __devinit ct_atc_create_alsa_devs(struct ct_atc *atc);
153 153
154#endif /* CTATC_H */ 154#endif /* CTATC_H */
diff --git a/sound/pci/ctxfi/xfi.c b/sound/pci/ctxfi/xfi.c
index 76541748e7bc..f42e7e1a1074 100644
--- a/sound/pci/ctxfi/xfi.c
+++ b/sound/pci/ctxfi/xfi.c
@@ -32,6 +32,7 @@ module_param(multiple, uint, S_IRUGO);
32static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; 32static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
33static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; 33static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;
34static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; 34static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
35static unsigned int subsystem[SNDRV_CARDS];
35 36
36module_param_array(index, int, NULL, 0444); 37module_param_array(index, int, NULL, 0444);
37MODULE_PARM_DESC(index, "Index value for Creative X-Fi driver"); 38MODULE_PARM_DESC(index, "Index value for Creative X-Fi driver");
@@ -39,8 +40,10 @@ module_param_array(id, charp, NULL, 0444);
39MODULE_PARM_DESC(id, "ID string for Creative X-Fi driver"); 40MODULE_PARM_DESC(id, "ID string for Creative X-Fi driver");
40module_param_array(enable, bool, NULL, 0444); 41module_param_array(enable, bool, NULL, 0444);
41MODULE_PARM_DESC(enable, "Enable Creative X-Fi driver"); 42MODULE_PARM_DESC(enable, "Enable Creative X-Fi driver");
43module_param_array(subsystem, int, NULL, 0444);
44MODULE_PARM_DESC(subsystem, "Override subsystem ID for Creative X-Fi driver");
42 45
43static struct pci_device_id ct_pci_dev_ids[] = { 46static DEFINE_PCI_DEVICE_TABLE(ct_pci_dev_ids) = {
44 /* only X-Fi is supported, so... */ 47 /* only X-Fi is supported, so... */
45 { PCI_DEVICE(PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_20K1), 48 { PCI_DEVICE(PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_20K1),
46 .driver_data = ATC20K1, 49 .driver_data = ATC20K1,
@@ -85,7 +88,7 @@ ct_card_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
85 multiple = 2; 88 multiple = 2;
86 } 89 }
87 err = ct_atc_create(card, pci, reference_rate, multiple, 90 err = ct_atc_create(card, pci, reference_rate, multiple,
88 pci_id->driver_data, &atc); 91 pci_id->driver_data, subsystem[dev], &atc);
89 if (err < 0) 92 if (err < 0)
90 goto error; 93 goto error;
91 94