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 
15 #include "comedidev.h"
16 
17 /*
18  * PCI Vendor IDs not in <linux/pci_ids.h>
19  */
20 #define PCI_VENDOR_ID_KOLTER		0x1001
21 #define PCI_VENDOR_ID_ICP		0x104c
22 #define PCI_VENDOR_ID_DT		0x1116
23 #define PCI_VENDOR_ID_IOTECH		0x1616
24 #define PCI_VENDOR_ID_CONTEC		0x1221
25 #define PCI_VENDOR_ID_RTD		0x1435
26 #define PCI_VENDOR_ID_HUMUSOFT		0x186c
27 
28 struct pci_dev *comedi_to_pci_dev(struct comedi_device *dev);
29 
30 int comedi_pci_enable(struct comedi_device *dev);
31 void comedi_pci_disable(struct comedi_device *dev);
32 void comedi_pci_detach(struct comedi_device *dev);
33 
34 int comedi_pci_auto_config(struct pci_dev *pcidev, struct comedi_driver *driver,
35 			   unsigned long context);
36 void comedi_pci_auto_unconfig(struct pci_dev *pcidev);
37 
38 int comedi_pci_driver_register(struct comedi_driver *comedi_driver,
39 			       struct pci_driver *pci_driver);
40 void comedi_pci_driver_unregister(struct comedi_driver *comedi_driver,
41 				  struct pci_driver *pci_driver);
42 
43 /**
44  * module_comedi_pci_driver() - Helper macro for registering a comedi PCI driver
45  * @__comedi_driver: comedi_driver struct
46  * @__pci_driver: pci_driver struct
47  *
48  * Helper macro for comedi PCI drivers which do not do anything special
49  * in module init/exit. This eliminates a lot of boilerplate. Each
50  * module may only use this macro once, and calling it replaces
51  * module_init() and module_exit()
52  */
53 #define module_comedi_pci_driver(__comedi_driver, __pci_driver) \
54 	module_driver(__comedi_driver, comedi_pci_driver_register, \
55 			comedi_pci_driver_unregister, &(__pci_driver))
56 
57 #endif /* _COMEDI_PCI_H */
58