2 comedi/drivers/comedi_pci.h
3 Various PCI functions for drivers.
5 Copyright (C) 2007 MEV Ltd. <http://www.mev.co.uk/>
7 COMEDI - Linux Control and Measurement Device Interface
8 Copyright (C) 2000 David A. Schleef <ds@schleef.org>
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #ifndef _COMEDI_PCI_H_
27 #define _COMEDI_PCI_H_
29 #include <linux/pci.h>
32 * Enable the PCI device and request the regions.
34 static inline int comedi_pci_enable(struct pci_dev
*pdev
, const char *res_name
)
38 rc
= pci_enable_device(pdev
);
42 rc
= pci_request_regions(pdev
, res_name
);
44 pci_disable_device(pdev
);
50 * Release the regions and disable the PCI device.
52 * This must be matched with a previous successful call to comedi_pci_enable().
54 static inline void comedi_pci_disable(struct pci_dev
*pdev
)
56 pci_release_regions(pdev
);
57 pci_disable_device(pdev
);