GNU Linux-libre 4.14.290-gnu1
[releases.git] / drivers / staging / comedi / comedi_pci.h
1 /*
2  * comedi_pci.h
3  * header file for Comedi PCI drivers
4  *
5  * COMEDI - Linux Control and Measurement Device Interface
6  * Copyright (C) 1997-2000 David A. Schleef <ds@schleef.org>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  */
18
19 #ifndef _COMEDI_PCI_H
20 #define _COMEDI_PCI_H
21
22 #include <linux/pci.h>
23
24 #include "comedidev.h"
25
26 /*
27  * PCI Vendor IDs not in <linux/pci_ids.h>
28  */
29 #define PCI_VENDOR_ID_KOLTER            0x1001
30 #define PCI_VENDOR_ID_ICP               0x104c
31 #define PCI_VENDOR_ID_DT                0x1116
32 #define PCI_VENDOR_ID_IOTECH            0x1616
33 #define PCI_VENDOR_ID_CONTEC            0x1221
34 #define PCI_VENDOR_ID_RTD               0x1435
35 #define PCI_VENDOR_ID_HUMUSOFT          0x186c
36
37 struct pci_dev *comedi_to_pci_dev(struct comedi_device *dev);
38
39 int comedi_pci_enable(struct comedi_device *dev);
40 void comedi_pci_disable(struct comedi_device *dev);
41 void comedi_pci_detach(struct comedi_device *dev);
42
43 int comedi_pci_auto_config(struct pci_dev *pcidev, struct comedi_driver *driver,
44                            unsigned long context);
45 void comedi_pci_auto_unconfig(struct pci_dev *pcidev);
46
47 int comedi_pci_driver_register(struct comedi_driver *comedi_driver,
48                                struct pci_driver *pci_driver);
49 void comedi_pci_driver_unregister(struct comedi_driver *comedi_driver,
50                                   struct pci_driver *pci_driver);
51
52 /**
53  * module_comedi_pci_driver() - Helper macro for registering a comedi PCI driver
54  * @__comedi_driver: comedi_driver struct
55  * @__pci_driver: pci_driver struct
56  *
57  * Helper macro for comedi PCI drivers which do not do anything special
58  * in module init/exit. This eliminates a lot of boilerplate. Each
59  * module may only use this macro once, and calling it replaces
60  * module_init() and module_exit()
61  */
62 #define module_comedi_pci_driver(__comedi_driver, __pci_driver) \
63         module_driver(__comedi_driver, comedi_pci_driver_register, \
64                         comedi_pci_driver_unregister, &(__pci_driver))
65
66 #endif /* _COMEDI_PCI_H */