xref: /linux/include/linux/comedi/comedi_pci.h (revision df0e68c1)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * comedi_pci.h
4  * header file for Comedi PCI drivers
5  *
6  * COMEDI - Linux Control and Measurement Device Interface
7  * Copyright (C) 1997-2000 David A. Schleef <ds@schleef.org>
8  */
9 
10 #ifndef _COMEDI_PCI_H
11 #define _COMEDI_PCI_H
12 
13 #include <linux/pci.h>
14 #include <linux/comedi/comedidev.h>
15 
16 /*
17  * PCI Vendor IDs not in <linux/pci_ids.h>
18  */
19 #define PCI_VENDOR_ID_KOLTER		0x1001
20 #define PCI_VENDOR_ID_ICP		0x104c
21 #define PCI_VENDOR_ID_DT		0x1116
22 #define PCI_VENDOR_ID_IOTECH		0x1616
23 #define PCI_VENDOR_ID_CONTEC		0x1221
24 #define PCI_VENDOR_ID_RTD		0x1435
25 #define PCI_VENDOR_ID_HUMUSOFT		0x186c
26 
27 struct pci_dev *comedi_to_pci_dev(struct comedi_device *dev);
28 
29 int comedi_pci_enable(struct comedi_device *dev);
30 void comedi_pci_disable(struct comedi_device *dev);
31 void comedi_pci_detach(struct comedi_device *dev);
32 
33 int comedi_pci_auto_config(struct pci_dev *pcidev, struct comedi_driver *driver,
34 			   unsigned long context);
35 void comedi_pci_auto_unconfig(struct pci_dev *pcidev);
36 
37 int comedi_pci_driver_register(struct comedi_driver *comedi_driver,
38 			       struct pci_driver *pci_driver);
39 void comedi_pci_driver_unregister(struct comedi_driver *comedi_driver,
40 				  struct pci_driver *pci_driver);
41 
42 /**
43  * module_comedi_pci_driver() - Helper macro for registering a comedi PCI driver
44  * @__comedi_driver: comedi_driver struct
45  * @__pci_driver: pci_driver struct
46  *
47  * Helper macro for comedi PCI drivers which do not do anything special
48  * in module init/exit. This eliminates a lot of boilerplate. Each
49  * module may only use this macro once, and calling it replaces
50  * module_init() and module_exit()
51  */
52 #define module_comedi_pci_driver(__comedi_driver, __pci_driver) \
53 	module_driver(__comedi_driver, comedi_pci_driver_register, \
54 			comedi_pci_driver_unregister, &(__pci_driver))
55 
56 #endif /* _COMEDI_PCI_H */
57