47 #include "../comedidev.h"
49 #define PC263_DRIVER_NAME "amplc_pc263"
51 #define DO_ISA IS_ENABLED(CONFIG_COMEDI_AMPLC_PC263_ISA)
52 #define DO_PCI IS_ENABLED(CONFIG_COMEDI_AMPLC_PC263_PCI)
55 #define PCI_VENDOR_ID_AMPLICON 0x14dc
56 #define PCI_DEVICE_ID_AMPLICON_PCI263 0x000c
57 #define PCI_DEVICE_ID_INVALID 0xffff
60 #define PC263_IO_SIZE 2
118 for (i = 0; i <
ARRAY_SIZE(pc263_boards); i++)
119 if (is_pci_board(&pc263_boards[i]) &&
121 return &pc263_boards[i];
134 struct pci_dev *pci_dev =
NULL;
140 if (bus != pci_dev->
bus->number ||
151 foundboard = pc263_find_pci_board(pci_dev);
152 if (foundboard ==
NULL)
164 "No supported board found! (req. bus %d, slot %d)\n",
190 s->
state &= ~data[0];
191 s->
state |= data[0] & data[1];
201 const struct pc263_board *thisboard = comedi_board(dev);
202 struct pci_dev *
pcidev = comedi_to_pci_dev(dev);
205 if (is_isa_board(thisboard))
207 else if (is_pci_board(thisboard))
208 snprintf(tmpbuf,
sizeof(tmpbuf),
"(pci %s) ",
217 const struct pc263_board *thisboard = comedi_board(dev);
239 pc263_report_attach(dev);
243 static int pc263_pci_common_attach(
struct comedi_device *dev,
244 struct pci_dev *pci_dev)
249 comedi_set_hw_dev(dev, &pci_dev->
dev);
254 "error! cannot enable PCI device and request regions!\n");
258 return pc263_common_attach(dev, iobase);
269 const struct pc263_board *thisboard = comedi_board(dev);
275 if (is_isa_board(thisboard)) {
276 unsigned long iobase = it->
options[0];
280 return pc263_common_attach(dev, iobase);
281 }
else if (is_pci_board(thisboard)) {
284 pci_dev = pc263_find_pci_dev(dev, it);
287 return pc263_pci_common_attach(dev, pci_dev);
290 ": BUG! cannot determine board type!\n");
300 struct pci_dev *pci_dev)
307 dev->
board_ptr = pc263_find_pci_board(pci_dev);
319 return pc263_pci_common_attach(dev, pci_dev);
324 const struct pc263_board *thisboard = comedi_board(dev);
328 if (is_isa_board(thisboard)) {
331 }
else if (is_pci_board(thisboard)) {
332 struct pci_dev *pcidev = comedi_to_pci_dev(dev);
350 .attach = pc263_attach,
351 .attach_pci = pc263_attach_pci,
352 .detach = pc263_detach,
353 .board_name = &pc263_boards[0].
name,
365 static int __devinit amplc_pc263_pci_probe(
struct pci_dev *dev,
372 static void __devexit amplc_pc263_pci_remove(
struct pci_dev *dev)
377 static struct pci_driver amplc_pc263_pci_driver = {
379 .id_table = pc263_pci_table,
380 .probe = &lc_pc263_pci_probe,