kbuild: Steal gcc's pie from the very beginning
[linux-2.6/btrfs-unstable.git] / drivers / staging / comedi / comedi_usb.h
blob721128bece3c902c4db5f95d414357fd4f4cfd7d
1 /*
2 * comedi_usb.h
3 * header file for USB Comedi drivers
5 * COMEDI - Linux Control and Measurement Device Interface
6 * Copyright (C) 1997-2000 David A. Schleef <ds@schleef.org>
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.
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.
19 #ifndef _COMEDI_USB_H
20 #define _COMEDI_USB_H
22 #include <linux/usb.h>
24 #include "comedidev.h"
26 struct usb_interface *comedi_to_usb_interface(struct comedi_device *);
27 struct usb_device *comedi_to_usb_dev(struct comedi_device *);
29 int comedi_usb_auto_config(struct usb_interface *, struct comedi_driver *,
30 unsigned long context);
31 void comedi_usb_auto_unconfig(struct usb_interface *);
33 int comedi_usb_driver_register(struct comedi_driver *, struct usb_driver *);
34 void comedi_usb_driver_unregister(struct comedi_driver *, struct usb_driver *);
36 /**
37 * module_comedi_usb_driver() - Helper macro for registering a comedi USB driver
38 * @__comedi_driver: comedi_driver struct
39 * @__usb_driver: usb_driver struct
41 * Helper macro for comedi USB drivers which do not do anything special
42 * in module init/exit. This eliminates a lot of boilerplate. Each
43 * module may only use this macro once, and calling it replaces
44 * module_init() and module_exit()
46 #define module_comedi_usb_driver(__comedi_driver, __usb_driver) \
47 module_driver(__comedi_driver, comedi_usb_driver_register, \
48 comedi_usb_driver_unregister, &(__usb_driver))
50 #endif /* _COMEDI_USB_H */