diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-22 19:54:53 (GMT) |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-22 20:01:40 (GMT) |
commit | ae19ffbadc1b2100285a5b5b3d0a4e0a11390904 (patch) | |
tree | 3c2086ab67398a019089a47ca3f362a4bc6db74f /drivers/staging/comedi/comedidev.h | |
parent | 34e84f39a27d059a3e6ec6e8b94aafa702e6f220 (diff) | |
parent | 9173a8ef24a6b1b8031507b35b8ffe5f85a87692 (diff) | |
download | linux-fsl-qoriq-ae19ffbadc1b2100285a5b5b3d0a4e0a11390904.tar.xz |
Merge branch 'master' into for-linus
Diffstat (limited to 'drivers/staging/comedi/comedidev.h')
-rw-r--r-- | drivers/staging/comedi/comedidev.h | 85 |
1 files changed, 48 insertions, 37 deletions
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h index 89af44a..e8a5f7d 100644 --- a/drivers/staging/comedi/comedidev.h +++ b/drivers/staging/comedi/comedidev.h @@ -156,28 +156,30 @@ struct comedi_subdevice { unsigned int *chanlist; /* driver-owned chanlist (not used) */ - int (*insn_read) (struct comedi_device *, struct comedi_subdevice *, struct comedi_insn *, - unsigned int *); - int (*insn_write) (struct comedi_device *, struct comedi_subdevice *, struct comedi_insn *, - unsigned int *); - int (*insn_bits) (struct comedi_device *, struct comedi_subdevice *, struct comedi_insn *, - unsigned int *); - int (*insn_config) (struct comedi_device *, struct comedi_subdevice *, struct comedi_insn *, - unsigned int *); + int (*insn_read) (struct comedi_device *, struct comedi_subdevice *, + struct comedi_insn *, unsigned int *); + int (*insn_write) (struct comedi_device *, struct comedi_subdevice *, + struct comedi_insn *, unsigned int *); + int (*insn_bits) (struct comedi_device *, struct comedi_subdevice *, + struct comedi_insn *, unsigned int *); + int (*insn_config) (struct comedi_device *, struct comedi_subdevice *, + struct comedi_insn *, unsigned int *); int (*do_cmd) (struct comedi_device *, struct comedi_subdevice *); - int (*do_cmdtest) (struct comedi_device *, struct comedi_subdevice *, struct comedi_cmd *); + int (*do_cmdtest) (struct comedi_device *, struct comedi_subdevice *, + struct comedi_cmd *); int (*poll) (struct comedi_device *, struct comedi_subdevice *); int (*cancel) (struct comedi_device *, struct comedi_subdevice *); /* int (*do_lock)(struct comedi_device *,struct comedi_subdevice *); */ /* int (*do_unlock)(struct comedi_device *,struct comedi_subdevice *); */ /* called when the buffer changes */ - int (*buf_change) (struct comedi_device *dev, struct comedi_subdevice *s, - unsigned long new_size); + int (*buf_change) (struct comedi_device * dev, + struct comedi_subdevice * s, unsigned long new_size); - void (*munge) (struct comedi_device *dev, struct comedi_subdevice *s, void *data, - unsigned int num_bytes, unsigned int start_chan_index); + void (*munge) (struct comedi_device * dev, struct comedi_subdevice * s, + void *data, unsigned int num_bytes, + unsigned int start_chan_index); enum dma_data_direction async_dma_dir; unsigned int state; @@ -231,7 +233,7 @@ struct comedi_async { int (*cb_func) (unsigned int flags, void *); void *cb_arg; - int (*inttrig) (struct comedi_device *dev, struct comedi_subdevice *s, + int (*inttrig) (struct comedi_device * dev, struct comedi_subdevice * s, unsigned int x); }; @@ -281,8 +283,8 @@ struct comedi_device { struct fasync_struct *async_queue; - void (*open) (struct comedi_device *dev); - void (*close) (struct comedi_device *dev); + void (*open) (struct comedi_device * dev); + void (*close) (struct comedi_device * dev); }; struct comedi_device_file_info { @@ -316,8 +318,9 @@ static const unsigned COMEDI_SUBDEVICE_MINOR_OFFSET = 1; struct comedi_device_file_info *comedi_get_device_file_info(unsigned minor); -static inline struct comedi_subdevice *comedi_get_read_subdevice( - const struct comedi_device_file_info *info) +static inline struct comedi_subdevice *comedi_get_read_subdevice(const struct + comedi_device_file_info + *info) { if (info->read_subdevice) return info->read_subdevice; @@ -326,8 +329,9 @@ static inline struct comedi_subdevice *comedi_get_read_subdevice( return info->device->read_subdev; } -static inline struct comedi_subdevice *comedi_get_write_subdevice( - const struct comedi_device_file_info *info) +static inline struct comedi_subdevice *comedi_get_write_subdevice(const struct + comedi_device_file_info + *info) { if (info->write_subdevice) return info->write_subdevice; @@ -337,7 +341,8 @@ static inline struct comedi_subdevice *comedi_get_write_subdevice( } void comedi_device_detach(struct comedi_device *dev); -int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it); +int comedi_device_attach(struct comedi_device *dev, + struct comedi_devconfig *it); int comedi_driver_register(struct comedi_driver *); int comedi_driver_unregister(struct comedi_driver *); @@ -346,8 +351,8 @@ void cleanup_polling(void); void start_polling(struct comedi_device *); void stop_polling(struct comedi_device *); -int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s, unsigned long - new_size); +int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s, + unsigned long new_size); #ifdef CONFIG_PROC_FS void comedi_proc_init(void); @@ -356,6 +361,7 @@ void comedi_proc_cleanup(void); static inline void comedi_proc_init(void) { } + static inline void comedi_proc_cleanup(void) { } @@ -378,10 +384,10 @@ enum subdevice_runflags { int do_rangeinfo_ioctl(struct comedi_device *dev, struct comedi_rangeinfo *arg); int check_chanlist(struct comedi_subdevice *s, int n, unsigned int *chanlist); void comedi_set_subdevice_runflags(struct comedi_subdevice *s, unsigned mask, - unsigned bits); + unsigned bits); unsigned comedi_get_subdevice_runflags(struct comedi_subdevice *s); int insn_inval(struct comedi_device *dev, struct comedi_subdevice *s, - struct comedi_insn *insn, unsigned int *data); + struct comedi_insn *insn, unsigned int *data); /* range stuff */ @@ -421,7 +427,8 @@ static inline int alloc_subdevices(struct comedi_device *dev, dev->n_subdevices = num_subdevices; dev->subdevices = - kcalloc(num_subdevices, sizeof(struct comedi_subdevice), GFP_KERNEL); + kcalloc(num_subdevices, sizeof(struct comedi_subdevice), + GFP_KERNEL); if (!dev->subdevices) return -ENOMEM; for (i = 0; i < num_subdevices; ++i) { @@ -451,7 +458,8 @@ static inline unsigned int bytes_per_sample(const struct comedi_subdevice *subd) /* must be used in attach to set dev->hw_dev if you wish to dma directly into comedi's buffer */ -static inline void comedi_set_hw_dev(struct comedi_device *dev, struct device *hw_dev) +static inline void comedi_set_hw_dev(struct comedi_device *dev, + struct device *hw_dev) { if (dev->hw_dev) put_device(dev->hw_dev); @@ -467,21 +475,23 @@ int comedi_buf_put(struct comedi_async *async, short x); int comedi_buf_get(struct comedi_async *async, short *x); unsigned int comedi_buf_write_n_available(struct comedi_async *async); -unsigned int comedi_buf_write_alloc(struct comedi_async *async, unsigned int nbytes); +unsigned int comedi_buf_write_alloc(struct comedi_async *async, + unsigned int nbytes); unsigned int comedi_buf_write_alloc_strict(struct comedi_async *async, - unsigned int nbytes); + unsigned int nbytes); unsigned comedi_buf_write_free(struct comedi_async *async, unsigned int nbytes); unsigned comedi_buf_read_alloc(struct comedi_async *async, unsigned nbytes); unsigned comedi_buf_read_free(struct comedi_async *async, unsigned int nbytes); unsigned int comedi_buf_read_n_available(struct comedi_async *async); void comedi_buf_memcpy_to(struct comedi_async *async, unsigned int offset, - const void *source, unsigned int num_bytes); + const void *source, unsigned int num_bytes); void comedi_buf_memcpy_from(struct comedi_async *async, unsigned int offset, - void *destination, unsigned int num_bytes); + void *destination, unsigned int num_bytes); static inline unsigned comedi_buf_write_n_allocated(struct comedi_async *async) { return async->buf_write_alloc_count - async->buf_write_count; } + static inline unsigned comedi_buf_read_n_allocated(struct comedi_async *async) { return async->buf_read_alloc_count - async->buf_read_count; @@ -516,25 +526,26 @@ static inline void *comedi_aux_data(int options[], int n) int comedi_alloc_board_minor(struct device *hardware_device); void comedi_free_board_minor(unsigned minor); -int comedi_alloc_subdevice_minor(struct comedi_device *dev, struct comedi_subdevice *s); +int comedi_alloc_subdevice_minor(struct comedi_device *dev, + struct comedi_subdevice *s); void comedi_free_subdevice_minor(struct comedi_subdevice *s); int comedi_pci_auto_config(struct pci_dev *pcidev, const char *board_name); void comedi_pci_auto_unconfig(struct pci_dev *pcidev); -struct usb_device; /* forward declaration */ +struct usb_device; /* forward declaration */ int comedi_usb_auto_config(struct usb_device *usbdev, const char *board_name); void comedi_usb_auto_unconfig(struct usb_device *usbdev); #ifdef CONFIG_COMEDI_PCI_DRIVERS - #define CONFIG_COMEDI_PCI +#define CONFIG_COMEDI_PCI #endif #ifdef CONFIG_COMEDI_PCI_DRIVERS_MODULE - #define CONFIG_COMEDI_PCI +#define CONFIG_COMEDI_PCI #endif #ifdef CONFIG_COMEDI_PCMCIA_DRIVERS - #define CONFIG_COMEDI_PCMCIA +#define CONFIG_COMEDI_PCMCIA #endif #ifdef CONFIG_COMEDI_PCMCIA_DRIVERS_MODULE - #define CONFIG_COMEDI_PCMCIA +#define CONFIG_COMEDI_PCMCIA #endif #endif /* _COMEDIDEV_H */ |