aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi/ctatc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ctxfi/ctatc.c')
-rw-r--r--sound/pci/ctxfi/ctatc.c38
1 files changed, 17 insertions, 21 deletions
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c
index cb65bd0dd35b..480cb1e905b6 100644
--- a/sound/pci/ctxfi/ctatc.c
+++ b/sound/pci/ctxfi/ctatc.c
@@ -166,18 +166,7 @@ static void ct_unmap_audio_buffer(struct ct_atc *atc, struct ct_atc_pcm *apcm)
166 166
167static unsigned long atc_get_ptp_phys(struct ct_atc *atc, int index) 167static unsigned long atc_get_ptp_phys(struct ct_atc *atc, int index)
168{ 168{
169 struct ct_vm *vm; 169 return atc->vm->get_ptp_phys(atc->vm, index);
170 void *kvirt_addr;
171 unsigned long phys_addr;
172
173 vm = atc->vm;
174 kvirt_addr = vm->get_ptp_virt(vm, index);
175 if (kvirt_addr == NULL)
176 phys_addr = (~0UL);
177 else
178 phys_addr = virt_to_phys(kvirt_addr);
179
180 return phys_addr;
181} 170}
182 171
183static unsigned int convert_format(snd_pcm_format_t snd_format) 172static unsigned int convert_format(snd_pcm_format_t snd_format)
@@ -1225,10 +1214,11 @@ static int atc_dev_free(struct snd_device *dev)
1225 return ct_atc_destroy(atc); 1214 return ct_atc_destroy(atc);
1226} 1215}
1227 1216
1228static int __devinit atc_identify_card(struct ct_atc *atc) 1217static int __devinit atc_identify_card(struct ct_atc *atc, unsigned int ssid)
1229{ 1218{
1230 const struct snd_pci_quirk *p; 1219 const struct snd_pci_quirk *p;
1231 const struct snd_pci_quirk *list; 1220 const struct snd_pci_quirk *list;
1221 u16 vendor_id, device_id;
1232 1222
1233 switch (atc->chip_type) { 1223 switch (atc->chip_type) {
1234 case ATC20K1: 1224 case ATC20K1:
@@ -1242,13 +1232,19 @@ static int __devinit atc_identify_card(struct ct_atc *atc)
1242 default: 1232 default:
1243 return -ENOENT; 1233 return -ENOENT;
1244 } 1234 }
1245 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);
1246 if (p) { 1243 if (p) {
1247 if (p->value < 0) { 1244 if (p->value < 0) {
1248 printk(KERN_ERR "ctxfi: " 1245 printk(KERN_ERR "ctxfi: "
1249 "Device %04x:%04x is black-listed\n", 1246 "Device %04x:%04x is black-listed\n",
1250 atc->pci->subsystem_vendor, 1247 vendor_id, device_id);
1251 atc->pci->subsystem_device);
1252 return -ENOENT; 1248 return -ENOENT;
1253 } 1249 }
1254 atc->model = p->value; 1250 atc->model = p->value;
@@ -1261,8 +1257,7 @@ static int __devinit atc_identify_card(struct ct_atc *atc)
1261 atc->model_name = ct_subsys_name[atc->model]; 1257 atc->model_name = ct_subsys_name[atc->model];
1262 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",
1263 atc->chip_name, atc->model_name, 1259 atc->chip_name, atc->model_name,
1264 atc->pci->subsystem_vendor, 1260 vendor_id, device_id);
1265 atc->pci->subsystem_device);
1266 return 0; 1261 return 0;
1267} 1262}
1268 1263
@@ -1636,7 +1631,8 @@ static struct ct_atc atc_preset __devinitdata = {
1636 1631
1637int __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,
1638 unsigned int rsr, unsigned int msr, 1633 unsigned int rsr, unsigned int msr,
1639 int chip_type, struct ct_atc **ratc) 1634 int chip_type, unsigned int ssid,
1635 struct ct_atc **ratc)
1640{ 1636{
1641 struct ct_atc *atc; 1637 struct ct_atc *atc;
1642 static struct snd_device_ops ops = { 1638 static struct snd_device_ops ops = {
@@ -1662,14 +1658,14 @@ int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci,
1662 mutex_init(&atc->atc_mutex); 1658 mutex_init(&atc->atc_mutex);
1663 1659
1664 /* Find card model */ 1660 /* Find card model */
1665 err = atc_identify_card(atc); 1661 err = atc_identify_card(atc, ssid);
1666 if (err < 0) { 1662 if (err < 0) {
1667 printk(KERN_ERR "ctatc: Card not recognised\n"); 1663 printk(KERN_ERR "ctatc: Card not recognised\n");
1668 goto error1; 1664 goto error1;
1669 } 1665 }
1670 1666
1671 /* Set up device virtual memory management object */ 1667 /* Set up device virtual memory management object */
1672 err = ct_vm_create(&atc->vm); 1668 err = ct_vm_create(&atc->vm, pci);
1673 if (err < 0) 1669 if (err < 0)
1674 goto error1; 1670 goto error1;
1675 1671