Commit 0a85b6f0 authored by Mithlesh Thukral's avatar Mithlesh Thukral Committed by Greg Kroah-Hartman

Staging: Comedi: Lindent changes to comdi driver in staging tree

Lindent changes to comdi driver in staging tree.
This patch is followed by the checkpatch.pl error fixes.
Did not make them part of this patch as the patch size is already huge.
Signed-off-by: default avatarMithlesh Thukral <mithlesh@linsyssoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent df678568
This diff is collapsed.
......@@ -103,7 +103,7 @@ static int translated_ioctl(struct file *file, unsigned int cmd,
#ifdef HAVE_UNLOCKED_IOCTL
if (file->f_op->unlocked_ioctl) {
int rc = (int)(*file->f_op->unlocked_ioctl)(file, cmd, arg);
int rc = (int)(*file->f_op->unlocked_ioctl) (file, cmd, arg);
if (rc == -ENOIOCTLCMD)
rc = -ENOTTY;
return rc;
......@@ -112,7 +112,7 @@ static int translated_ioctl(struct file *file, unsigned int cmd,
if (file->f_op->ioctl) {
int rc;
lock_kernel();
rc = (*file->f_op->ioctl)(file->f_dentry->d_inode,
rc = (*file->f_op->ioctl) (file->f_dentry->d_inode,
file, cmd, arg);
unlock_kernel();
return rc;
......@@ -136,8 +136,7 @@ static int compat_chaninfo(struct file *file, unsigned long arg)
/* Copy chaninfo structure. Ignore unused members. */
if (!access_ok(VERIFY_READ, chaninfo32, sizeof(*chaninfo32))
|| !access_ok(VERIFY_WRITE, chaninfo,
sizeof(*chaninfo))) {
|| !access_ok(VERIFY_WRITE, chaninfo, sizeof(*chaninfo))) {
return -EFAULT;
}
err = 0;
......@@ -171,8 +170,7 @@ static int compat_rangeinfo(struct file *file, unsigned long arg)
/* Copy rangeinfo structure. */
if (!access_ok(VERIFY_READ, rangeinfo32, sizeof(*rangeinfo32))
|| !access_ok(VERIFY_WRITE, rangeinfo,
sizeof(*rangeinfo))) {
|| !access_ok(VERIFY_WRITE, rangeinfo, sizeof(*rangeinfo))) {
return -EFAULT;
}
err = 0;
......@@ -188,8 +186,8 @@ static int compat_rangeinfo(struct file *file, unsigned long arg)
}
/* Copy 32-bit cmd structure to native cmd structure. */
static int get_compat_cmd(struct comedi_cmd __user *cmd,
struct comedi32_cmd_struct __user *cmd32)
static int get_compat_cmd(struct comedi_cmd __user * cmd,
struct comedi32_cmd_struct __user * cmd32)
{
int err;
union {
......@@ -239,7 +237,8 @@ static int get_compat_cmd(struct comedi_cmd __user *cmd,
}
/* Copy native cmd structure to 32-bit cmd structure. */
static int put_compat_cmd(struct comedi32_cmd_struct __user *cmd32, struct comedi_cmd __user *cmd)
static int put_compat_cmd(struct comedi32_cmd_struct __user * cmd32,
struct comedi_cmd __user * cmd)
{
int err;
unsigned int temp;
......@@ -329,8 +328,8 @@ static int compat_cmdtest(struct file *file, unsigned long arg)
}
/* Copy 32-bit insn structure to native insn structure. */
static int get_compat_insn(struct comedi_insn __user *insn,
struct comedi32_insn_struct __user *insn32)
static int get_compat_insn(struct comedi_insn __user * insn,
struct comedi32_insn_struct __user * insn32)
{
int err;
union {
......@@ -477,8 +476,7 @@ static inline int raw_ioctl(struct file *file, unsigned int cmd,
/* compat_ioctl file operation. */
/* Returns -ENOIOCTLCMD for unrecognised ioctl codes. */
long comedi_compat_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
return raw_ioctl(file, cmd, arg);
}
......@@ -515,27 +513,27 @@ static int mapped_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg,
struct ioctl32_map {
unsigned int cmd;
int (*handler)(unsigned int, unsigned int, unsigned long,
int (*handler) (unsigned int, unsigned int, unsigned long,
struct file *);
int registered;
};
static struct ioctl32_map comedi_ioctl32_map[] = {
{ COMEDI_DEVCONFIG, mapped_ioctl, 0 },
{ COMEDI_DEVINFO, mapped_ioctl, 0 },
{ COMEDI_SUBDINFO, mapped_ioctl, 0 },
{ COMEDI_BUFCONFIG, mapped_ioctl, 0 },
{ COMEDI_BUFINFO, mapped_ioctl, 0 },
{ COMEDI_LOCK, mapped_ioctl, 0 },
{ COMEDI_UNLOCK, mapped_ioctl, 0 },
{ COMEDI_CANCEL, mapped_ioctl, 0 },
{ COMEDI_POLL, mapped_ioctl, 0 },
{ COMEDI32_CHANINFO, mapped_ioctl, 0 },
{ COMEDI32_RANGEINFO, mapped_ioctl, 0 },
{ COMEDI32_CMD, mapped_ioctl, 0 },
{ COMEDI32_CMDTEST, mapped_ioctl, 0 },
{ COMEDI32_INSNLIST, mapped_ioctl, 0 },
{ COMEDI32_INSN, mapped_ioctl, 0 },
{COMEDI_DEVCONFIG, mapped_ioctl, 0},
{COMEDI_DEVINFO, mapped_ioctl, 0},
{COMEDI_SUBDINFO, mapped_ioctl, 0},
{COMEDI_BUFCONFIG, mapped_ioctl, 0},
{COMEDI_BUFINFO, mapped_ioctl, 0},
{COMEDI_LOCK, mapped_ioctl, 0},
{COMEDI_UNLOCK, mapped_ioctl, 0},
{COMEDI_CANCEL, mapped_ioctl, 0},
{COMEDI_POLL, mapped_ioctl, 0},
{COMEDI32_CHANINFO, mapped_ioctl, 0},
{COMEDI32_RANGEINFO, mapped_ioctl, 0},
{COMEDI32_CMD, mapped_ioctl, 0},
{COMEDI32_CMDTEST, mapped_ioctl, 0},
{COMEDI32_INSNLIST, mapped_ioctl, 0},
{COMEDI32_INSN, mapped_ioctl, 0},
};
#define NUM_IOCTL32_MAPS ARRAY_SIZE(comedi_ioctl32_map)
......@@ -566,9 +564,10 @@ void comedi_unregister_ioctl32(void)
for (n = 0; n < NUM_IOCTL32_MAPS; n++) {
if (comedi_ioctl32_map[n].registered) {
rc = unregister_ioctl32_conversion(
comedi_ioctl32_map[n].cmd,
comedi_ioctl32_map[n].handler);
rc = unregister_ioctl32_conversion(comedi_ioctl32_map
[n].cmd,
comedi_ioctl32_map
[n].handler);
if (rc) {
printk(KERN_ERR
"comedi: failed to unregister 32-bit "
......
This diff is collapsed.
......@@ -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)
{
}
......@@ -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,7 +475,8 @@ 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 comedi_buf_write_free(struct comedi_async *async, unsigned int nbytes);
......@@ -482,6 +491,7 @@ 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,7 +526,8 @@ 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);
......@@ -525,16 +536,16 @@ 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 */
......@@ -58,7 +58,8 @@ int comedi_fileno(void *dev);
int comedi_cancel(void *dev, unsigned int subdev);
int comedi_register_callback(void *dev, unsigned int subdev,
unsigned int mask, int (*cb) (unsigned int, void *), void *arg);
unsigned int mask, int (*cb) (unsigned int,
void *), void *arg);
int comedi_command(void *dev, struct comedi_cmd *cmd);
int comedi_command_test(void *dev, struct comedi_cmd *cmd);
......@@ -69,9 +70,10 @@ int comedi_data_write(void *dev, unsigned int subdev, unsigned int chan,
int comedi_data_read(void *dev, unsigned int subdev, unsigned int chan,
unsigned int range, unsigned int aref, unsigned int *data);
int comedi_data_read_hint(void *dev, unsigned int subdev,
unsigned int chan, unsigned int range, unsigned int aref);
int comedi_data_read_delayed(void *dev, unsigned int subdev,
unsigned int chan, unsigned int range, unsigned int aref,
unsigned int chan, unsigned int range,
unsigned int aref);
int comedi_data_read_delayed(void *dev, unsigned int subdev, unsigned int chan,
unsigned int range, unsigned int aref,
unsigned int *data, unsigned int nano_sec);
int comedi_dio_config(void *dev, unsigned int subdev, unsigned int chan,
unsigned int io);
......@@ -90,14 +92,12 @@ int comedi_find_subdevice_by_type(void *dev, int type, unsigned int subd);
int comedi_get_n_channels(void *dev, unsigned int subdevice);
unsigned int comedi_get_maxdata(void *dev, unsigned int subdevice, unsigned
int chan);
int comedi_get_n_ranges(void *dev, unsigned int subdevice, unsigned int
chan);
int comedi_get_n_ranges(void *dev, unsigned int subdevice, unsigned int chan);
int comedi_do_insn(void *dev, struct comedi_insn *insn);
int comedi_poll(void *dev, unsigned int subdev);
/* DEPRECATED functions */
int comedi_get_rangetype(void *dev, unsigned int subdevice,
unsigned int chan);
int comedi_get_rangetype(void *dev, unsigned int subdevice, unsigned int chan);
/* ALPHA functions */
unsigned int comedi_get_subdevice_flags(void *dev, unsigned int subdevice);
......@@ -135,12 +135,15 @@ int comedi_unlock(unsigned int minor, unsigned int subdev);
int comedi_cancel(unsigned int minor, unsigned int subdev);
int comedi_register_callback(unsigned int minor, unsigned int subdev,
unsigned int mask, int (*cb) (unsigned int, void *), void *arg);
unsigned int mask, int (*cb) (unsigned int,
void *), void *arg);
int comedi_command(unsigned int minor, struct comedi_cmd *cmd);
int comedi_command_test(unsigned int minor, struct comedi_cmd *cmd);
int comedi_trigger(unsigned int minor, unsigned int subdev, struct comedi_trig *it);
int __comedi_trigger(unsigned int minor, unsigned int subdev, struct comedi_trig *it);
int comedi_trigger(unsigned int minor, unsigned int subdev,
struct comedi_trig *it);
int __comedi_trigger(unsigned int minor, unsigned int subdev,
struct comedi_trig *it);
int comedi_data_write(unsigned int dev, unsigned int subdev, unsigned int chan,
unsigned int range, unsigned int aref, unsigned int data);
int comedi_data_read(unsigned int dev, unsigned int subdev, unsigned int chan,
......
This diff is collapsed.
......@@ -29,7 +29,9 @@
#define i8253_cascade_ns_to_timer i8253_cascade_ns_to_timer_2div
static inline void i8253_cascade_ns_to_timer_2div_old(int i8253_osc_base,
unsigned int *d1, unsigned int *d2, unsigned int *nanosec,
unsigned int *d1,
unsigned int *d2,
unsigned int *nanosec,
int round_mode)
{
int divider;
......@@ -78,7 +80,9 @@ static inline void i8253_cascade_ns_to_timer_2div_old(int i8253_osc_base,
}
static inline void i8253_cascade_ns_to_timer_power(int i8253_osc_base,
unsigned int *d1, unsigned int *d2, unsigned int *nanosec,
unsigned int *d1,
unsigned int *d2,
unsigned int *nanosec,
int round_mode)
{
int div1, div2;
......@@ -118,7 +122,9 @@ static inline void i8253_cascade_ns_to_timer_power(int i8253_osc_base,
}
static inline void i8253_cascade_ns_to_timer_2div(int i8253_osc_base,
unsigned int *d1, unsigned int *d2, unsigned int *nanosec,
unsigned int *d1,
unsigned int *d2,
unsigned int *nanosec,
int round_mode)
{
unsigned int divider;
......@@ -136,8 +142,7 @@ static inline void i8253_cascade_ns_to_timer_2div(int i8253_osc_base,
div2 = *d2 ? *d2 : max_count;
divider = div1 * div2;
if (div1 * div2 * i8253_osc_base == *nanosec &&
div1 > 1 && div1 <= max_count &&
div2 > 1 && div2 <= max_count &&
div1 > 1 && div1 <= max_count && div2 > 1 && div2 <= max_count &&
/* check for overflow */
divider > div1 && divider > div2 &&
divider * i8253_osc_base > divider &&
......@@ -229,7 +234,8 @@ static inline void i8253_cascade_ns_to_timer_2div(int i8253_osc_base,
#define i8254_control_reg 3
static inline int i8254_load(unsigned long base_address, unsigned int regshift,
unsigned int counter_number, unsigned int count, unsigned int mode)
unsigned int counter_number, unsigned int count,
unsigned int mode)
{
unsigned int byte;
......@@ -255,7 +261,8 @@ static inline int i8254_load(unsigned long base_address, unsigned int regshift,
}
static inline int i8254_mm_load(void *base_address, unsigned int regshift,
unsigned int counter_number, unsigned int count, unsigned int mode)
unsigned int counter_number, unsigned int count,
unsigned int mode)
{
unsigned int byte;
......@@ -325,7 +332,8 @@ static inline int i8254_mm_read(void *base_address, unsigned int regshift,
/* Loads 16 bit initial counter value, should work for 8253 also. */
static inline void i8254_write(unsigned long base_address,
unsigned int regshift, unsigned int counter_number, unsigned int count)
unsigned int regshift,
unsigned int counter_number, unsigned int count)
{
unsigned int byte;
......@@ -339,7 +347,9 @@ static inline void i8254_write(unsigned long base_address,
}
static inline void i8254_mm_write(void *base_address,
unsigned int regshift, unsigned int counter_number, unsigned int count)
unsigned int regshift,
unsigned int counter_number,
unsigned int count)
{
unsigned int byte;
......@@ -360,7 +370,8 @@ static inline void i8254_mm_write(void *base_address,
* I8254_BCD, I8254_BINARY
*/
static inline int i8254_set_mode(unsigned long base_address,
unsigned int regshift, unsigned int counter_number, unsigned int mode)
unsigned int regshift,
unsigned int counter_number, unsigned int mode)
{
unsigned int byte;
......@@ -378,7 +389,9 @@ static inline int i8254_set_mode(unsigned long base_address,
}
static inline int i8254_mm_set_mode(void *base_address,
unsigned int regshift, unsigned int counter_number, unsigned int mode)
unsigned int regshift,
unsigned int counter_number,
unsigned int mode)
{
unsigned int byte;
......@@ -396,7 +409,8 @@ static inline int i8254_mm_set_mode(void *base_address,
}
static inline int i8254_status(unsigned long base_address,
unsigned int regshift, unsigned int counter_number)
unsigned int regshift,
unsigned int counter_number)
{
outb(0xE0 | (2 << counter_number),
base_address + (i8254_control_reg << regshift));
......@@ -404,7 +418,8 @@ static inline int i8254_status(unsigned long base_address,
}
static inline int i8254_mm_status(void *base_address,
unsigned int regshift, unsigned int counter_number)
unsigned int regshift,
unsigned int counter_number)
{
writeb(0xE0 | (2 << counter_number),
base_address + (i8254_control_reg << regshift));
......
......@@ -105,7 +105,8 @@ struct subdev_8255_struct {
#define CALLBACK_FUNC (((struct subdev_8255_struct *)s->private)->cb_func)
#define subdevpriv ((struct subdev_8255_struct *)s->private)
static int dev_8255_attach(struct comedi_device *dev, struct comedi_devconfig * it);
static int dev_8255_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int dev_8255_detach(struct comedi_device *dev);
static struct comedi_driver driver_8255 = {
.driver_name = "8255",
......@@ -116,9 +117,10 @@ static struct comedi_driver driver_8255 = {
COMEDI_INITCLEANUP(driver_8255);
static void do_config(struct comedi_device *dev, struct comedi_subdevice * s);
static void do_config(struct comedi_device *dev, struct comedi_subdevice *s);
void subdev_8255_interrupt(struct comedi_device *dev, struct comedi_subdevice * s)
void subdev_8255_interrupt(struct comedi_device *dev,
struct comedi_subdevice *s)
{
short d;
......@@ -143,7 +145,8 @@ static int subdev_8255_cb(int dir, int port, int data, unsigned long arg)
}
}
static int subdev_8255_insn(struct comedi_device *dev, struct comedi_subdevice * s,
static int subdev_8255_insn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
if (data[0]) {
......@@ -168,7 +171,8 @@ static int subdev_8255_insn(struct comedi_device *dev, struct comedi_subdevice *
return 2;
}
static int subdev_8255_insn_config(struct comedi_device *dev, struct comedi_subdevice * s,
static int subdev_8255_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
unsigned int mask;
......@@ -205,7 +209,7 @@ static int subdev_8255_insn_config(struct comedi_device *dev, struct comedi_subd
return 1;
}
static void do_config(struct comedi_device *dev, struct comedi_subdevice * s)
static void do_config(struct comedi_device *dev, struct comedi_subdevice *s)
{
int config;
......@@ -222,7 +226,8 @@ static void do_config(struct comedi_device *dev, struct comedi_subdevice * s)
CALLBACK_FUNC(1, _8255_CR, config, CALLBACK_ARG);
}
static int subdev_8255_cmdtest(struct comedi_device *dev, struct comedi_subdevice * s,
static int subdev_8255_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{
int err = 0;
......@@ -297,22 +302,25 @@ static int subdev_8255_cmdtest(struct comedi_device *dev, struct comedi_subdevic
return 0;
}
static int subdev_8255_cmd(struct comedi_device *dev, struct comedi_subdevice * s)
static int subdev_8255_cmd(struct comedi_device *dev,
struct comedi_subdevice *s)
{
/* FIXME */
return 0;
}
static int subdev_8255_cancel(struct comedi_device *dev, struct comedi_subdevice * s)
static int subdev_8255_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{
/* FIXME */
return 0;
}
int subdev_8255_init(struct comedi_device *dev, struct comedi_subdevice * s, int (*cb) (int,
int, int, unsigned long), unsigned long arg)
int subdev_8255_init(struct comedi_device *dev, struct comedi_subdevice *s,
int (*cb) (int, int, int, unsigned long),
unsigned long arg)
{
s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
......@@ -340,8 +348,9 @@ int subdev_8255_init(struct comedi_device *dev, struct comedi_subdevice * s, int
return 0;
}
int subdev_8255_init_irq(struct comedi_device *dev, struct comedi_subdevice * s,
int (*cb) (int, int, int, unsigned long), unsigned long arg)
int subdev_8255_init_irq(struct comedi_device *dev, struct comedi_subdevice *s,
int (*cb) (int, int, int, unsigned long),
unsigned long arg)
{
int ret;
......@@ -358,7 +367,7 @@ int subdev_8255_init_irq(struct comedi_device *dev, struct comedi_subdevice * s,
return 0;
}
void subdev_8255_cleanup(struct comedi_device *dev, struct comedi_subdevice * s)
void subdev_8255_cleanup(struct comedi_device *dev, struct comedi_subdevice *s)
{
if (s->private) {
/* this test does nothing, so comment it out
......@@ -376,7 +385,8 @@ void subdev_8255_cleanup(struct comedi_device *dev, struct comedi_subdevice * s)
*/
static int dev_8255_attach(struct comedi_device *dev, struct comedi_devconfig * it)
static int dev_8255_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
int ret;
unsigned long iobase;
......
......@@ -29,16 +29,20 @@
#if defined(CONFIG_COMEDI_8255) || defined(CONFIG_COMEDI_8255_MODULE)
int subdev_8255_init(struct comedi_device *dev, struct comedi_subdevice *s,
int (*cb) (int, int, int, unsigned long), unsigned long arg);
int (*cb) (int, int, int, unsigned long),
unsigned long arg);
int subdev_8255_init_irq(struct comedi_device *dev, struct comedi_subdevice *s,
int (*cb) (int, int, int, unsigned long), unsigned long arg);
int (*cb) (int, int, int, unsigned long),
unsigned long arg);
void subdev_8255_cleanup(struct comedi_device *dev, struct comedi_subdevice *s);
void subdev_8255_interrupt(struct comedi_device *dev, struct comedi_subdevice *s);
void subdev_8255_interrupt(struct comedi_device *dev,
struct comedi_subdevice *s);
#else
static inline int subdev_8255_init(struct comedi_device *dev, struct comedi_subdevice *s,
void *x, unsigned long y)
static inline int subdev_8255_init(struct comedi_device *dev,
struct comedi_subdevice *s, void *x,
unsigned long y)
{
printk("8255 support not configured -- disabling subdevice\n");
......
......@@ -22,7 +22,8 @@ Devices: [Adlink] ACL-7225b (acl7225b), [ICP] P16R16DIO (p16r16dio)
#define ACL7225_DI_LO 2 /* Digital input low byte (DI0-DI7) */
#define ACL7225_DI_HI 3 /* Digital input high byte (DI8-DI15) */
static int acl7225b_attach(struct comedi_device *dev, struct comedi_devconfig * it);
static int acl7225b_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int acl7225b_detach(struct comedi_device *dev);
struct boardtype {
......@@ -50,7 +51,8 @@ static struct comedi_driver driver_acl7225b = {
COMEDI_INITCLEANUP(driver_acl7225b);
static int acl7225b_do_insn(struct comedi_device *dev, struct comedi_subdevice * s,
static int acl7225b_do_insn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
if (insn->n != 2)
......@@ -71,7 +73,8 @@ static int acl7225b_do_insn(struct comedi_device *dev, struct comedi_subdevice *
return 2;
}
static int acl7225b_di_insn(struct comedi_device *dev, struct comedi_subdevice * s,
static int acl7225b_di_insn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
if (insn->n != 2)
......@@ -83,7 +86,8 @@ static int acl7225b_di_insn(struct comedi_device *dev, struct comedi_subdevice *
return 2;
}
static int acl7225b_attach(struct comedi_device *dev, struct comedi_devconfig * it)
static int acl7225b_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct comedi_subdevice *s;
int iobase, iorange;
......
......@@ -90,8 +90,9 @@ static const struct pci6208_board pci6208_boards[] = {
static DEFINE_PCI_DEVICE_TABLE(pci6208_pci_table) = {
/* { PCI_VENDOR_ID_ADLINK, 0x6208, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, */
/* { PCI_VENDOR_ID_ADLINK, 0x6208, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, */
{PCI_VENDOR_ID_ADLINK, 0x6208, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{0}
{
PCI_VENDOR_ID_ADLINK, 0x6208, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
0}
};
MODULE_DEVICE_TABLE(pci, pci6208_pci_table);
......@@ -107,7 +108,8 @@ struct pci6208_private {
#define devpriv ((struct pci6208_private *)dev->private)
static int pci6208_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static int pci6208_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int pci6208_detach(struct comedi_device *dev);
static struct comedi_driver driver_pci6208 = {
......@@ -125,9 +127,11 @@ pci6208_pci_setup(struct pci_dev *pci_dev, unsigned long *io_base_ptr,
int dev_minor);
/*read/write functions*/
static int pci6208_ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s,
static int pci6208_ao_winsn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int pci6208_ao_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
static int pci6208_ao_rinsn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
/* static int pci6208_dio_insn_bits(struct comedi_device *dev,struct comedi_subdevice *s, */
/* struct comedi_insn *insn,unsigned int *data); */
......@@ -140,7 +144,8 @@ static int pci6208_ao_rinsn(struct comedi_device *dev, struct comedi_subdevice *
* in the driver structure, dev->board_ptr contains that
* address.
*/
static int pci6208_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static int pci6208_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct comedi_subdevice *s;
int retval;
......@@ -217,7 +222,8 @@ static int pci6208_detach(struct comedi_device *dev)
return 0;
}
static int pci6208_ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s,
static int pci6208_ao_winsn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int i = 0, Data_Read;
......@@ -242,7 +248,8 @@ static int pci6208_ao_winsn(struct comedi_device *dev, struct comedi_subdevice *
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
static int pci6208_ao_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
static int pci6208_ao_rinsn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int i;
......@@ -335,7 +342,7 @@ static int pci6208_find_device(struct comedi_device *dev, int bus, int slot)
dev->minor, bus, slot);
return -EIO;
found:
found:
printk("comedi%d: found %s (b:s:f=%d:%d:%d) , irq=%d\n",
dev->minor,
pci6208_boards[i].name,
......@@ -361,7 +368,9 @@ pci6208_pci_setup(struct pci_dev *pci_dev, unsigned long *io_base_ptr,
/* Enable PCI device and request regions */
if (comedi_pci_enable(pci_dev, PCI6208_DRIVER_NAME) < 0) {
printk("comedi%d: Failed to enable PCI device and request regions\n", dev_minor);
printk
("comedi%d: Failed to enable PCI device and request regions\n",
dev_minor);
return -EIO;
}
/* Read local configuration register base address [PCI_BASE_ADDRESS #1]. */
......
......@@ -49,9 +49,10 @@ Configuration Options:
#define PCI_DEVICE_ID_PCI7296 0x7296
static DEFINE_PCI_DEVICE_TABLE(adl_pci7296_pci_table) = {
{PCI_VENDOR_ID_ADLINK, PCI_DEVICE_ID_PCI7296, PCI_ANY_ID, PCI_ANY_ID, 0,
0, 0},
{0}
{
PCI_VENDOR_ID_ADLINK, PCI_DEVICE_ID_PCI7296, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0}, {
0}
};
MODULE_DEVICE_TABLE(pci, adl_pci7296_pci_table);
......@@ -61,10 +62,10 @@ struct adl_pci7296_private {
struct pci_dev *pci_dev;
};
#define devpriv ((struct adl_pci7296_private *)dev->private)
static int adl_pci7296_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static int adl_pci7296_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int adl_pci7296_detach(struct comedi_device *dev);
static struct comedi_driver driver_adl_pci7296 = {
.driver_name = "adl_pci7296",
......@@ -73,7 +74,8 @@ static struct comedi_driver driver_adl_pci7296 = {
.detach = adl_pci7296_detach,
};
static int adl_pci7296_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static int adl_pci7296_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct pci_dev *pcidev;
struct comedi_subdevice *s;
......@@ -108,7 +110,9 @@ static int adl_pci7296_attach(struct comedi_device *dev, struct comedi_devconfig
}
devpriv->pci_dev = pcidev;
if (comedi_pci_enable(pcidev, "adl_pci7296") < 0) {
printk("comedi%d: Failed to enable PCI device and request regions\n", dev->minor);
printk
("comedi%d: Failed to enable PCI device and request regions\n",
dev->minor);
return -EIO;
}
......@@ -122,19 +126,22 @@ static int adl_pci7296_attach(struct comedi_device *dev, struct comedi_devconfig
s = dev->subdevices + 1;
ret = subdev_8255_init(dev, s, NULL,
(unsigned long)(dev->iobase + PORT2A));
(unsigned long)(dev->iobase +
PORT2A));
if (ret < 0)
return ret;
s = dev->subdevices + 2;
ret = subdev_8255_init(dev, s, NULL,
(unsigned long)(dev->iobase + PORT3A));
(unsigned long)(dev->iobase +
PORT3A));
if (ret < 0)
return ret;
s = dev->subdevices + 3;
ret = subdev_8255_init(dev, s, NULL,
(unsigned long)(dev->iobase + PORT4A));
(unsigned long)(dev->iobase +
PORT4A));
if (ret < 0)
return ret;
......
......@@ -44,9 +44,10 @@ Configuration Options:
#define PCI_DEVICE_ID_PCI7432 0x7432
static DEFINE_PCI_DEVICE_TABLE(adl_pci7432_pci_table) = {
{PCI_VENDOR_ID_ADLINK, PCI_DEVICE_ID_PCI7432, PCI_ANY_ID, PCI_ANY_ID, 0,
0, 0},
{0}
{
PCI_VENDOR_ID_ADLINK, PCI_DEVICE_ID_PCI7432, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0}, {
0}
};
MODULE_DEVICE_TABLE(pci, adl_pci7432_pci_table);
......@@ -58,7 +59,8 @@ struct adl_pci7432_private {
#define devpriv ((struct adl_pci7432_private *)dev->private)
static int adl_pci7432_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static int adl_pci7432_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int adl_pci7432_detach(struct comedi_device *dev);
static struct comedi_driver driver_adl_pci7432 = {
.driver_name = "adl_pci7432",
......@@ -69,15 +71,20 @@ static struct comedi_driver driver_adl_pci7432 = {
/* Digital IO */
static int adl_pci7432_di_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int adl_pci7432_di_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data);
static int adl_pci7432_do_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int adl_pci7432_do_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data);
/* */
static int adl_pci7432_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static int adl_pci7432_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct pci_dev *pcidev;
struct comedi_subdevice *s;
......@@ -111,7 +118,9 @@ static int adl_pci7432_attach(struct comedi_device *dev, struct comedi_devconfig
}
devpriv->pci_dev = pcidev;
if (comedi_pci_enable(pcidev, "adl_pci7432") < 0) {
printk("comedi%d: Failed to enable PCI device and request regions\n", dev->minor);
printk
("comedi%d: Failed to enable PCI device and request regions\n",
dev->minor);
return -EIO;
}
dev->iobase = pci_resource_start(pcidev, 2);
......@@ -164,8 +173,10 @@ static int adl_pci7432_detach(struct comedi_device *dev)
return 0;
}
static int adl_pci7432_do_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
static int adl_pci7432_do_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
printk("comedi: pci7432_do_insn_bits called\n");
printk("comedi: data0: %8x data1: %8x\n", data[0], data[1]);
......@@ -184,8 +195,10 @@ static int adl_pci7432_do_insn_bits(struct comedi_device *dev, struct comedi_sub
return 2;
}
static int adl_pci7432_di_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
static int adl_pci7432_di_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
printk("comedi: pci7432_di_insn_bits called\n");
printk("comedi: data0: %8x data1: %8x\n", data[0], data[1]);
......
......@@ -56,9 +56,10 @@ Configuration Options:
#define PCI_DEVICE_ID_PCI8164 0x8164
static DEFINE_PCI_DEVICE_TABLE(adl_pci8164_pci_table) = {
{PCI_VENDOR_ID_ADLINK, PCI_DEVICE_ID_PCI8164, PCI_ANY_ID, PCI_ANY_ID, 0,
0, 0},
{0}
{
PCI_VENDOR_ID_ADLINK, PCI_DEVICE_ID_PCI8164, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0}, {
0}
};
MODULE_DEVICE_TABLE(pci, adl_pci8164_pci_table);
......@@ -70,7 +71,8 @@ struct adl_pci8164_private {
#define devpriv ((struct adl_pci8164_private *)dev->private)
static int adl_pci8164_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static int adl_pci8164_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int adl_pci8164_detach(struct comedi_device *dev);
static struct comedi_driver driver_adl_pci8164 = {
.driver_name = "adl_pci8164",
......@@ -79,31 +81,48 @@ static struct comedi_driver driver_adl_pci8164 = {
.detach = adl_pci8164_detach,
};
static int adl_pci8164_insn_read_msts(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int adl_pci8164_insn_read_msts(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data);
static int adl_pci8164_insn_read_ssts(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int adl_pci8164_insn_read_ssts(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data);
static int adl_pci8164_insn_read_buf0(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int adl_pci8164_insn_read_buf0(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data);
static int adl_pci8164_insn_read_buf1(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int adl_pci8164_insn_read_buf1(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data);
static int adl_pci8164_insn_write_cmd(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int adl_pci8164_insn_write_cmd(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data);
static int adl_pci8164_insn_write_otp(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int adl_pci8164_insn_write_otp(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data);
static int adl_pci8164_insn_write_buf0(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data);
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data);
static int adl_pci8164_insn_write_buf1(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data);
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data);
static int adl_pci8164_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static int adl_pci8164_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct pci_dev *pcidev;
struct comedi_subdevice *s;
......@@ -137,7 +156,9 @@ static int adl_pci8164_attach(struct comedi_device *dev, struct comedi_devconfig
}
devpriv->pci_dev = pcidev;
if (comedi_pci_enable(pcidev, "adl_pci8164") < 0) {
printk("comedi%d: Failed to enable PCI device and request regions\n", dev->minor);
printk
("comedi%d: Failed to enable PCI device and request regions\n",
dev->minor);
return -EIO;
}
dev->iobase = pci_resource_start(pcidev, 2);
......@@ -216,8 +237,7 @@ static void adl_pci8164_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data,
char *action,
unsigned short offset)
char *action, unsigned short offset)
{
int axis, axis_reg;
char *axisname;
......@@ -247,8 +267,8 @@ static void adl_pci8164_insn_read(struct comedi_device *dev,
}
data[0] = inw(dev->iobase + axis_reg + offset);
printk("comedi: pci8164 %s read -> %04X:%04X on axis %s\n", action, data[0],
data[1], axisname);
printk("comedi: pci8164 %s read -> %04X:%04X on axis %s\n", action,
data[0], data[1], axisname);
}
static int adl_pci8164_insn_read_msts(struct comedi_device *dev,
......@@ -260,22 +280,28 @@ static int adl_pci8164_insn_read_msts(struct comedi_device *dev,
return 2;
}
static int adl_pci8164_insn_read_ssts(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
static int adl_pci8164_insn_read_ssts(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
adl_pci8164_insn_read(dev, s, insn, data, "SSTS", PCI8164_SSTS);
return 2;
}
static int adl_pci8164_insn_read_buf0(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
static int adl_pci8164_insn_read_buf0(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
adl_pci8164_insn_read(dev, s, insn, data, "BUF0", PCI8164_BUF0);
return 2;
}
static int adl_pci8164_insn_read_buf1(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
static int adl_pci8164_insn_read_buf1(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
adl_pci8164_insn_read(dev, s, insn, data, "BUF1", PCI8164_BUF1);
return 2;
......@@ -289,8 +315,7 @@ static void adl_pci8164_insn_out(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data,
char *action,
unsigned short offset)
char *action, unsigned short offset)
{
unsigned int axis, axis_reg;
......@@ -327,30 +352,37 @@ static void adl_pci8164_insn_out(struct comedi_device *dev,
}
static int adl_pci8164_insn_write_cmd(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
static int adl_pci8164_insn_write_cmd(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
adl_pci8164_insn_out(dev, s, insn, data, "CMD", PCI8164_CMD);
return 2;
}
static int adl_pci8164_insn_write_otp(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
static int adl_pci8164_insn_write_otp(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
adl_pci8164_insn_out(dev, s, insn, data, "OTP", PCI8164_OTP);
return 2;
}
static int adl_pci8164_insn_write_buf0(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
adl_pci8164_insn_out(dev, s, insn, data, "BUF0", PCI8164_BUF0);
return 2;
}
static int adl_pci8164_insn_write_buf1(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
adl_pci8164_insn_out(dev, s, insn, data, "BUF1", PCI8164_BUF1);
return 2;
......
......@@ -62,7 +62,6 @@ If you do not specify any options, they will default to
single-ended 0 1-2 1-2 (factory default)
differential 1 2-3 2-3
written by jeremy theler <thelerg@ib.cnea.gov.ar>
instituto balseiro
......@@ -105,16 +104,17 @@ static const struct comedi_lrange range_adq12b_ai_bipolar = { 4, {
BIP_RANGE(2),
BIP_RANGE(1),
BIP_RANGE(0.5)
}};
}
};
static const struct comedi_lrange range_adq12b_ai_unipolar = { 4, {
UNI_RANGE(5),
UNI_RANGE(2),
UNI_RANGE(1),
UNI_RANGE(0.5)
}};
UNI_RANGE
(0.5)
}
};
struct adq12b_board {
const char *name;
......@@ -132,8 +132,7 @@ static const struct adq12b_board adq12b_boards[] = {
.ai_diff_chans = 8,
.ai_bits = 12,
.di_chans = 5,
.do_chans = 8
}
.do_chans = 8}
/* potentially, more adq-based deviced will be added */
/*,
.name = "adq12b",
......@@ -162,21 +161,28 @@ struct adq12b_private {
* the board, and also about the kernel module that contains
* the device code.
*/
static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static int adq12b_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int adq12b_detach(struct comedi_device *dev);
static struct comedi_driver driver_adq12b={
driver_name: "adq12b",
module: THIS_MODULE,
attach: adq12b_attach,
detach: adq12b_detach,
board_name: &adq12b_boards[0].name,
offset: sizeof(struct adq12b_board),
num_names: ARRAY_SIZE(adq12b_boards),
static struct comedi_driver driver_adq12b = {
driver_name:"adq12b",
module:THIS_MODULE,
attach:adq12b_attach,
detach:adq12b_detach,
board_name:&adq12b_boards[0].name,
offset:sizeof(struct adq12b_board),
num_names:ARRAY_SIZE(adq12b_boards),
};
static int adq12b_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data);
static int adq12b_di_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data);
static int adq12b_do_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data);
static int adq12b_ai_rinsn(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn,
unsigned int *data);
static int adq12b_di_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int adq12b_do_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
/*
* Attach is called by the Comedi core to configure the driver
......@@ -194,11 +200,15 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
unipolar = it->options[1];
differential = it->options[2];
printk("comedi%d: adq12b called with options base=0x%03lx, %s and %s\n", dev->minor, iobase, (unipolar==1)?"unipolar":"bipolar", (differential==1) ? "differential" : "single-ended");
printk("comedi%d: adq12b called with options base=0x%03lx, %s and %s\n",
dev->minor, iobase, (unipolar == 1) ? "unipolar" : "bipolar",
(differential == 1) ? "differential" : "single-ended");
/* if no address was specified, try the default 0x300 */
if (iobase == 0) {
printk("comedi%d: adq12b warning: I/O base address not specified. Trying the default 0x300.\n", dev->minor);
printk
("comedi%d: adq12b warning: I/O base address not specified. Trying the default 0x300.\n",
dev->minor);
iobase = 0x300;
}
......@@ -219,7 +229,7 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
* Allocate the private structure area. alloc_private() is a
* convenient macro defined in comedidev.h.
*/
if (alloc_private (dev, sizeof (struct adq12b_private)) < 0)
if (alloc_private(dev, sizeof(struct adq12b_private)) < 0)
return -ENOMEM;
/* fill in devpriv structure */
......@@ -231,22 +241,21 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
devpriv->last_channel = -1;
devpriv->last_range = -1;
/*
* Allocate the subdevice structures. alloc_subdevice() is a
* convenient macro defined in comedidev.h.
*/
if (alloc_subdevices (dev, 3)<0)
if (alloc_subdevices(dev, 3) < 0)
return -ENOMEM;
s = dev->subdevices+0;
s = dev->subdevices + 0;
/* analog input subdevice */
s->type = COMEDI_SUBD_AI;
if (differential) {
s->subdev_flags = SDF_READABLE|SDF_GROUND|SDF_DIFF;
s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF;
s->n_chan = thisboard->ai_diff_chans;
} else {
s->subdev_flags = SDF_READABLE|SDF_GROUND;
s->subdev_flags = SDF_READABLE | SDF_GROUND;
s->n_chan = thisboard->ai_se_chans;
}
......@@ -256,24 +265,22 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->range_table = &range_adq12b_ai_bipolar;
}
s->maxdata = (1 << thisboard->ai_bits)-1;
s->maxdata = (1 << thisboard->ai_bits) - 1;
s->len_chanlist = 4; /* This is the maximum chanlist length that
the board can handle */
s->insn_read = adq12b_ai_rinsn;
s = dev->subdevices+1;
s = dev->subdevices + 1;
/* digital input subdevice */
s->type = COMEDI_SUBD_DI;
s->subdev_flags = SDF_READABLE;
s->n_chan=thisboard->di_chans;
s->n_chan = thisboard->di_chans;
s->maxdata = 1;
s->range_table = &range_digital;
s->insn_bits = adq12b_di_insn_bits;
s = dev->subdevices+2;
s = dev->subdevices + 2;
/* digital output subdevice */
s->type = COMEDI_SUBD_DO;
s->subdev_flags = SDF_WRITABLE;
......@@ -282,13 +289,11 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->range_table = &range_digital;
s->insn_bits = adq12b_do_insn_bits;
printk("attached\n");
return 0;
}
/*
* _detach is called to deconfigure a device. It should deallocate
* resources.
......@@ -314,7 +319,9 @@ static int adq12b_detach(struct comedi_device *dev)
* mode.
*/
static int adq12b_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
static int adq12b_ai_rinsn(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn,
unsigned int *data)
{
int n, i;
int range, channel;
......@@ -332,7 +339,7 @@ static int adq12b_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s
status = inb(dev->iobase + ADQ12B_ADLOW);
/* convert n samples */
for (n=0; n < insn->n; n++){
for (n = 0; n < insn->n; n++) {
/* wait for end of convertion */
i = 0;
......@@ -356,29 +363,32 @@ static int adq12b_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s
return n;
}
static int adq12b_di_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
static int adq12b_di_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
/* only bits 0-4 have information about digital inputs */
data[1] = (inb(dev->iobase+ADQ12B_STINR) & (0x1f));
data[1] = (inb(dev->iobase + ADQ12B_STINR) & (0x1f));
return 2;
}
static int adq12b_do_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
static int adq12b_do_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int channel;
for (channel = 0; channel < 8; channel++)
if (((data[0]>>channel) & 0x01) != 0)
outb((((data[1]>>channel)&0x01)<<3) | channel, dev->iobase + ADQ12B_OUTBR);
if (((data[0] >> channel) & 0x01) != 0)
outb((((data[1] >> channel) & 0x01) << 3) | channel,
dev->iobase + ADQ12B_OUTBR);
/* store information to retrieve when asked for reading */
if (data[0]) {
devpriv->digital_state &= ~data[0];
devpriv->digital_state |= (data[0]&data[1]);
devpriv->digital_state |= (data[0] & data[1]);
}
data[1] = devpriv->digital_state;
......@@ -386,7 +396,6 @@ static int adq12b_do_insn_bits(struct comedi_device *dev, struct comedi_subdevic
return 2;
}
/*
* A convenient macro that defines init_module() and cleanup_module(),
* as necessary.
......
......@@ -131,8 +131,9 @@ static const struct pci1723_board boardtypes[] = {
/* This is used by modprobe to translate PCI IDs to drivers. Should
* only be used for PCI and ISA-PnP devices */
static DEFINE_PCI_DEVICE_TABLE(pci1723_pci_table) = {
{PCI_VENDOR_ID_ADVANTECH, 0x1723, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{0}
{
PCI_VENDOR_ID_ADVANTECH, 0x1723, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
0}
};
MODULE_DEVICE_TABLE(pci, pci1723_pci_table);
......@@ -143,7 +144,8 @@ MODULE_DEVICE_TABLE(pci, pci1723_pci_table);
* the board, and also about the kernel module that contains
* the device code.
*/
static int pci1723_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static int pci1723_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int pci1723_detach(struct comedi_device *dev);
#define n_boardtypes (sizeof(boardtypes)/sizeof(struct pci1723_board))
......@@ -202,7 +204,8 @@ static int pci1723_reset(struct comedi_device *dev)
return 0;
}
static int pci1723_insn_read_ao(struct comedi_device *dev, struct comedi_subdevice *s,
static int pci1723_insn_read_ao(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int n, chan;
......@@ -218,7 +221,8 @@ static int pci1723_insn_read_ao(struct comedi_device *dev, struct comedi_subdevi
/*
analog data output;
*/
static int pci1723_ao_write_winsn(struct comedi_device *dev, struct comedi_subdevice *s,
static int pci1723_ao_write_winsn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int n, chan;
......@@ -238,7 +242,8 @@ static int pci1723_ao_write_winsn(struct comedi_device *dev, struct comedi_subde
/*
digital i/o config/query
*/
static int pci1723_dio_insn_config(struct comedi_device *dev, struct comedi_subdevice *s,
static int pci1723_dio_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
unsigned int mask;
......@@ -278,7 +283,8 @@ static int pci1723_dio_insn_config(struct comedi_device *dev, struct comedi_subd
/*
digital i/o bits read/write
*/
static int pci1723_dio_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s,
static int pci1723_dio_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
if (data[0]) {
......@@ -294,7 +300,8 @@ static int pci1723_dio_insn_bits(struct comedi_device *dev, struct comedi_subdev
* Attach is called by the Comedi core to configure the driver
* for a pci1723 board.
*/
static int pci1723_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static int pci1723_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct comedi_subdevice *s;
int ret, subdev, n_subdevices;
......@@ -304,8 +311,7 @@ static int pci1723_attach(struct comedi_device *dev, struct comedi_devconfig *it
int opt_bus, opt_slot;
const char *errstr;
printk("comedi%d: adv_pci1723: board=%s", dev->minor,
this_board->name);
printk("comedi%d: adv_pci1723: board=%s", dev->minor, this_board->name);
opt_bus = it->options[0];
opt_slot = it->options[1];
......@@ -334,7 +340,8 @@ static int pci1723_attach(struct comedi_device *dev, struct comedi_devconfig *it
* Enable PCI device and request regions.
*/
if (comedi_pci_enable(pcidev, "adv_pci1723")) {
errstr = "failed to enable PCI device and request regions!";
errstr =
"failed to enable PCI device and request regions!";
continue;
}
break;
......
......@@ -183,7 +183,8 @@ enum hw_io_access {
#define OMBCMD_RETRY 0x03 /* 3 times try request before error */
static int pci_dio_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static int pci_dio_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int pci_dio_detach(struct comedi_device *dev);
struct diosubd_data {
......@@ -207,19 +208,20 @@ struct dio_boardtype {
};
static DEFINE_PCI_DEVICE_TABLE(pci_dio_pci_table) = {
{PCI_VENDOR_ID_ADVANTECH, 0x1730, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_ADVANTECH, 0x1733, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_ADVANTECH, 0x1734, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_ADVANTECH, 0x1736, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_ADVANTECH, 0x1750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_ADVANTECH, 0x1751, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_ADVANTECH, 0x1752, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_ADVANTECH, 0x1753, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_ADVANTECH, 0x1754, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_ADVANTECH, 0x1756, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_ADVANTECH, 0x1760, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_ADVANTECH, 0x1762, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{0}
{
PCI_VENDOR_ID_ADVANTECH, 0x1730, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
PCI_VENDOR_ID_ADVANTECH, 0x1733, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
PCI_VENDOR_ID_ADVANTECH, 0x1734, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
PCI_VENDOR_ID_ADVANTECH, 0x1736, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
PCI_VENDOR_ID_ADVANTECH, 0x1750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
PCI_VENDOR_ID_ADVANTECH, 0x1751, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
PCI_VENDOR_ID_ADVANTECH, 0x1752, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
PCI_VENDOR_ID_ADVANTECH, 0x1753, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
PCI_VENDOR_ID_ADVANTECH, 0x1754, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
PCI_VENDOR_ID_ADVANTECH, 0x1756, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
PCI_VENDOR_ID_ADVANTECH, 0x1760, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
PCI_VENDOR_ID_ADVANTECH, 0x1762, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
0}
};
MODULE_DEVICE_TABLE(pci, pci_dio_pci_table);
......@@ -251,8 +253,8 @@ static const struct dio_boardtype boardtypes[] = {
TYPE_PCI1736,
{{0, 0, 0, 0}, {16, PCI1736_IDI, 2, 0}},
{{0, 0, 0, 0}, {16, PCI1736_IDO, 2, 0}},
{{ 0, 0, 0, 0}, { 0, 0, 0, 0}},
{ 4, PCI1736_BOARDID, 1, SDF_INTERNAL},
{{0, 0, 0, 0}, {0, 0, 0, 0}},
{4, PCI1736_BOARDID, 1, SDF_INTERNAL},
IO_8b,
},
{"pci1750", PCI_VENDOR_ID_ADVANTECH, 0x1750, PCIDIO_MAINREG,
......@@ -357,7 +359,8 @@ static struct pci_dio_private *pci_priv = NULL; /* list of allocated cards */
/*
==============================================================================
*/
static int pci_dio_insn_bits_di_b(struct comedi_device *dev, struct comedi_subdevice *s,
static int pci_dio_insn_bits_di_b(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
const struct diosubd_data *d = (const struct diosubd_data *)s->private;
......@@ -374,7 +377,8 @@ static int pci_dio_insn_bits_di_b(struct comedi_device *dev, struct comedi_subde
/*
==============================================================================
*/
static int pci_dio_insn_bits_di_w(struct comedi_device *dev, struct comedi_subdevice *s,
static int pci_dio_insn_bits_di_w(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
const struct diosubd_data *d = (const struct diosubd_data *)s->private;
......@@ -390,7 +394,8 @@ static int pci_dio_insn_bits_di_w(struct comedi_device *dev, struct comedi_subde
/*
==============================================================================
*/
static int pci_dio_insn_bits_do_b(struct comedi_device *dev, struct comedi_subdevice *s,
static int pci_dio_insn_bits_do_b(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
const struct diosubd_data *d = (const struct diosubd_data *)s->private;
......@@ -411,7 +416,8 @@ static int pci_dio_insn_bits_do_b(struct comedi_device *dev, struct comedi_subde
/*
==============================================================================
*/
static int pci_dio_insn_bits_do_w(struct comedi_device *dev, struct comedi_subdevice *s,
static int pci_dio_insn_bits_do_w(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
const struct diosubd_data *d = (const struct diosubd_data *)s->private;
......@@ -433,7 +439,8 @@ static int pci_dio_insn_bits_do_w(struct comedi_device *dev, struct comedi_subde
==============================================================================
*/
static int pci1760_unchecked_mbxrequest(struct comedi_device *dev,
unsigned char *omb, unsigned char *imb, int repeats)
unsigned char *omb, unsigned char *imb,
int repeats)
{
int cnt, tout, ok = 0;
......@@ -491,7 +498,8 @@ static int pci1760_mbxrequest(struct comedi_device *dev,
/*
==============================================================================
*/
static int pci1760_insn_bits_di(struct comedi_device *dev, struct comedi_subdevice *s,
static int pci1760_insn_bits_di(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
data[1] = inb(dev->iobase + IMB3);
......@@ -502,7 +510,8 @@ static int pci1760_insn_bits_di(struct comedi_device *dev, struct comedi_subdevi
/*
==============================================================================
*/
static int pci1760_insn_bits_do(struct comedi_device *dev, struct comedi_subdevice *s,
static int pci1760_insn_bits_do(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int ret;
......@@ -530,7 +539,8 @@ static int pci1760_insn_bits_do(struct comedi_device *dev, struct comedi_subdevi
/*
==============================================================================
*/
static int pci1760_insn_cnt_read(struct comedi_device *dev, struct comedi_subdevice *s,
static int pci1760_insn_cnt_read(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int ret, n;
......@@ -555,7 +565,8 @@ static int pci1760_insn_cnt_read(struct comedi_device *dev, struct comedi_subdev
/*
==============================================================================
*/
static int pci1760_insn_cnt_write(struct comedi_device *dev, struct comedi_subdevice *s,
static int pci1760_insn_cnt_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int ret;
......@@ -697,11 +708,11 @@ static int pci_dio_reset(struct comedi_device *dev)
break;
case TYPE_PCI1736:
outb(0, dev->iobase+PCI1736_IDO);
outb(0, dev->iobase+PCI1736_IDO+1);
outb(0, dev->iobase+PCI1736_3_INT_EN); /* disable interrupts */
outb(0x0f, dev->iobase+PCI1736_3_INT_CLR);/* clear interrupts */
outb(0, dev->iobase+PCI1736_3_INT_RF); /* set rising edge trigger */
outb(0, dev->iobase + PCI1736_IDO);
outb(0, dev->iobase + PCI1736_IDO + 1);
outb(0, dev->iobase + PCI1736_3_INT_EN); /* disable interrupts */
outb(0x0f, dev->iobase + PCI1736_3_INT_CLR); /* clear interrupts */
outb(0, dev->iobase + PCI1736_3_INT_RF); /* set rising edge trigger */
break;
case TYPE_PCI1750:
......@@ -756,7 +767,8 @@ static int pci_dio_reset(struct comedi_device *dev)
/*
==============================================================================
*/
static int pci1760_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static int pci1760_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct comedi_subdevice *s;
int subdev = 0;
......@@ -863,7 +875,8 @@ static int pci_dio_add_do(struct comedi_device *dev, struct comedi_subdevice *s,
/*
==============================================================================
*/
static int CheckAndAllocCard(struct comedi_device *dev, struct comedi_devconfig *it,
static int CheckAndAllocCard(struct comedi_device *dev,
struct comedi_devconfig *it,
struct pci_dev *pcidev)
{
struct pci_dio_private *pr, *prev;
......@@ -889,7 +902,8 @@ static int CheckAndAllocCard(struct comedi_device *dev, struct comedi_devconfig
/*
==============================================================================
*/
static int pci_dio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static int pci_dio_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct comedi_subdevice *s;
int ret, subdev, n_subdevices, i, j;
......@@ -917,13 +931,13 @@ static int pci_dio_attach(struct comedi_device *dev, struct comedi_devconfig *it
if (it->options[0] || it->options[1]) {
/* are we on the wrong bus/slot? */
if (pcidev->bus->number != it->options[0] ||
PCI_SLOT(pcidev->devfn) !=
it->options[1]) {
PCI_SLOT(pcidev->devfn) != it->options[1]) {
continue;
}
}
ret = CheckAndAllocCard(dev, it, pcidev);
if (ret != 1) continue;
if (ret != 1)
continue;
dev->board_ptr = boardtypes + i;
break;
}
......@@ -932,8 +946,7 @@ static int pci_dio_attach(struct comedi_device *dev, struct comedi_devconfig *it
}
if (!dev->board_ptr) {
printk
(", Error: Requested type of the card was not found!\n");
printk(", Error: Requested type of the card was not found!\n");
return -EIO;
}
......@@ -994,7 +1007,8 @@ static int pci_dio_attach(struct comedi_device *dev, struct comedi_devconfig *it
for (j = 0; j < this_board->sdio[i].regs; j++) {
s = dev->subdevices + subdev;
subdev_8255_init(dev, s, NULL,
dev->iobase + this_board->sdio[i].addr +
dev->iobase +
this_board->sdio[i].addr +
SIZE_8255 * j);
subdev++;
}
......
......@@ -88,7 +88,8 @@ struct aio12_8_private {
#define devpriv ((struct aio12_8_private *) dev->private)
static int aio_aio12_8_ai_read(struct comedi_device *dev, struct comedi_subdevice *s,
static int aio_aio12_8_ai_read(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int n;
......@@ -122,7 +123,8 @@ static int aio_aio12_8_ai_read(struct comedi_device *dev, struct comedi_subdevic
return n;
}
static int aio_aio12_8_ao_read(struct comedi_device *dev, struct comedi_subdevice *s,
static int aio_aio12_8_ao_read(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int i;
......@@ -133,7 +135,8 @@ static int aio_aio12_8_ao_read(struct comedi_device *dev, struct comedi_subdevic
return insn->n;
}
static int aio_aio12_8_ao_write(struct comedi_device *dev, struct comedi_subdevice *s,
static int aio_aio12_8_ao_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int i;
......@@ -161,7 +164,8 @@ static const struct comedi_lrange range_aio_aio12_8 = {
}
};
static int aio_aio12_8_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static int aio_aio12_8_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
int iobase;
struct comedi_subdevice *s;
......
......@@ -67,7 +67,8 @@ struct aio_iiro_16_private {
#define devpriv ((struct aio_iiro_16_private *) dev->private)
static int aio_iiro_16_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static int aio_iiro_16_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int aio_iiro_16_detach(struct comedi_device *dev);
......@@ -82,12 +83,17 @@ static struct comedi_driver driver_aio_iiro_16 = {
};
static int aio_iiro_16_dio_insn_bits_read(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data);
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data);
static int aio_iiro_16_dio_insn_bits_write(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data);
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data);
static int aio_iiro_16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static int aio_iiro_16_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
int iobase;
struct comedi_subdevice *s;
......@@ -143,7 +149,9 @@ static int aio_iiro_16_detach(struct comedi_device *dev)
}
static int aio_iiro_16_dio_insn_bits_write(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
if (insn->n != 2)
return -EINVAL;
......@@ -162,7 +170,9 @@ static int aio_iiro_16_dio_insn_bits_write(struct comedi_device *dev,
}
static int aio_iiro_16_dio_insn_bits_read(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
if (insn->n != 2)
return -EINVAL;
......
......@@ -420,11 +420,12 @@ static const struct dio200_layout_struct dio200_layouts[] = {
#ifdef CONFIG_COMEDI_PCI
static DEFINE_PCI_DEVICE_TABLE(dio200_pci_table) = {
{PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI215,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI272,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{0}
{
PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI215,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI272,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
0}
};
MODULE_DEVICE_TABLE(pci, dio200_pci_table);
......@@ -475,7 +476,8 @@ struct dio200_subdev_intr {
* the board, and also about the kernel module that contains
* the device code.
*/
static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static int dio200_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int dio200_detach(struct comedi_device *dev);
static struct comedi_driver driver_amplc_dio200 = {
.driver_name = DIO200_DRIVER_NAME,
......@@ -574,7 +576,8 @@ dio200_request_region(unsigned minor, unsigned long from, unsigned long extent)
* 'insn_bits' function for an 'INTERRUPT' subdevice.
*/
static int
dio200_subdev_intr_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s,
dio200_subdev_intr_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
struct dio200_subdev_intr *subpriv = s->private;
......@@ -593,7 +596,8 @@ dio200_subdev_intr_insn_bits(struct comedi_device *dev, struct comedi_subdevice
/*
* Called to stop acquisition for an 'INTERRUPT' subdevice.
*/
static void dio200_stop_intr(struct comedi_device *dev, struct comedi_subdevice *s)
static void dio200_stop_intr(struct comedi_device *dev,
struct comedi_subdevice *s)
{
struct dio200_subdev_intr *subpriv = s->private;
......@@ -607,7 +611,8 @@ static void dio200_stop_intr(struct comedi_device *dev, struct comedi_subdevice
/*
* Called to start acquisition for an 'INTERRUPT' subdevice.
*/
static int dio200_start_intr(struct comedi_device *dev, struct comedi_subdevice *s)
static int dio200_start_intr(struct comedi_device *dev,
struct comedi_subdevice *s)
{
unsigned int n;
unsigned isn_bits;
......@@ -673,7 +678,8 @@ dio200_inttrig_start_intr(struct comedi_device *dev, struct comedi_subdevice *s,
* This is called from the interrupt service routine to handle a read
* scan on an 'INTERRUPT' subdevice.
*/
static int dio200_handle_read_intr(struct comedi_device *dev, struct comedi_subdevice *s)
static int dio200_handle_read_intr(struct comedi_device *dev,
struct comedi_subdevice *s)
{
struct dio200_subdev_intr *subpriv = s->private;
unsigned triggered;
......@@ -785,7 +791,8 @@ static int dio200_handle_read_intr(struct comedi_device *dev, struct comedi_subd
/*
* 'cancel' function for an 'INTERRUPT' subdevice.
*/
static int dio200_subdev_intr_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
static int dio200_subdev_intr_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{
struct dio200_subdev_intr *subpriv = s->private;
unsigned long flags;
......@@ -803,8 +810,8 @@ static int dio200_subdev_intr_cancel(struct comedi_device *dev, struct comedi_su
* 'do_cmdtest' function for an 'INTERRUPT' subdevice.
*/
static int
dio200_subdev_intr_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_cmd *cmd)
dio200_subdev_intr_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_cmd *cmd)
{
int err = 0;
unsigned int tmp;
......@@ -909,7 +916,8 @@ dio200_subdev_intr_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s
/*
* 'do_cmd' function for an 'INTERRUPT' subdevice.
*/
static int dio200_subdev_intr_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
static int dio200_subdev_intr_cmd(struct comedi_device *dev,
struct comedi_subdevice *s)
{
struct comedi_cmd *cmd = &s->async->cmd;
struct dio200_subdev_intr *subpriv = s->private;
......@@ -956,7 +964,8 @@ static int dio200_subdev_intr_cmd(struct comedi_device *dev, struct comedi_subde
*/
static int
dio200_subdev_intr_init(struct comedi_device *dev, struct comedi_subdevice *s,
unsigned long iobase, unsigned valid_isns, int has_int_sce)
unsigned long iobase, unsigned valid_isns,
int has_int_sce)
{
struct dio200_subdev_intr *subpriv;
......@@ -1000,7 +1009,8 @@ dio200_subdev_intr_init(struct comedi_device *dev, struct comedi_subdevice *s,
* This function cleans up an 'INTERRUPT' subdevice.
*/
static void
dio200_subdev_intr_cleanup(struct comedi_device *dev, struct comedi_subdevice *s)
dio200_subdev_intr_cleanup(struct comedi_device *dev,
struct comedi_subdevice *s)
{
struct dio200_subdev_intr *subpriv = s->private;
......@@ -1023,7 +1033,8 @@ static irqreturn_t dio200_interrupt(int irq, void *d)
if (devpriv->intr_sd >= 0) {
handled = dio200_handle_read_intr(dev,
dev->subdevices + devpriv->intr_sd);
dev->subdevices +
devpriv->intr_sd);
} else {
handled = 0;
}
......@@ -1065,8 +1076,8 @@ dio200_subdev_8254_write(struct comedi_device *dev, struct comedi_subdevice *s,
* Set gate source for an '8254' counter subdevice channel.
*/
static int
dio200_set_gate_src(struct dio200_subdev_8254 *subpriv, unsigned int counter_number,
unsigned int gate_src)
dio200_set_gate_src(struct dio200_subdev_8254 *subpriv,
unsigned int counter_number, unsigned int gate_src)
{
unsigned char byte;
......@@ -1088,7 +1099,8 @@ dio200_set_gate_src(struct dio200_subdev_8254 *subpriv, unsigned int counter_num
* Get gate source for an '8254' counter subdevice channel.
*/
static int
dio200_get_gate_src(struct dio200_subdev_8254 *subpriv, unsigned int counter_number)
dio200_get_gate_src(struct dio200_subdev_8254 *subpriv,
unsigned int counter_number)
{
if (!subpriv->has_clk_gat_sce)
return -1;
......@@ -1102,8 +1114,8 @@ dio200_get_gate_src(struct dio200_subdev_8254 *subpriv, unsigned int counter_num
* Set clock source for an '8254' counter subdevice channel.
*/
static int
dio200_set_clock_src(struct dio200_subdev_8254 *subpriv, unsigned int counter_number,
unsigned int clock_src)
dio200_set_clock_src(struct dio200_subdev_8254 *subpriv,
unsigned int counter_number, unsigned int clock_src)
{
unsigned char byte;
......@@ -1125,8 +1137,8 @@ dio200_set_clock_src(struct dio200_subdev_8254 *subpriv, unsigned int counter_nu
* Get clock source for an '8254' counter subdevice channel.
*/
static int
dio200_get_clock_src(struct dio200_subdev_8254 *subpriv, unsigned int counter_number,
unsigned int *period_ns)
dio200_get_clock_src(struct dio200_subdev_8254 *subpriv,
unsigned int counter_number, unsigned int *period_ns)
{
unsigned clock_src;
......@@ -1197,7 +1209,8 @@ dio200_subdev_8254_config(struct comedi_device *dev, struct comedi_subdevice *s,
*/
static int
dio200_subdev_8254_init(struct comedi_device *dev, struct comedi_subdevice *s,
unsigned long iobase, unsigned offset, int has_clk_gat_sce)
unsigned long iobase, unsigned offset,
int has_clk_gat_sce)
{
struct dio200_subdev_8254 *subpriv;
unsigned int chan;
......@@ -1249,7 +1262,8 @@ dio200_subdev_8254_init(struct comedi_device *dev, struct comedi_subdevice *s,
* This function cleans up an '8254' counter subdevice.
*/
static void
dio200_subdev_8254_cleanup(struct comedi_device *dev, struct comedi_subdevice *s)
dio200_subdev_8254_cleanup(struct comedi_device *dev,
struct comedi_subdevice *s)
{
struct dio200_subdev_intr *subpriv = s->private;
......@@ -1355,7 +1369,8 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
case sd_8254:
/* counter subdevice (8254) */
ret = dio200_subdev_8254_init(dev, s, iobase,
layout->sdinfo[n], layout->has_clk_gat_sce);
layout->sdinfo[n],
layout->has_clk_gat_sce);
if (ret < 0) {
return ret;
}
......@@ -1372,8 +1387,11 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
/* 'INTERRUPT' subdevice */
if (irq) {
ret = dio200_subdev_intr_init(dev, s,
iobase + DIO200_INT_SCE,
layout->sdinfo[n], layout->has_int_sce);
iobase +
DIO200_INT_SCE,
layout->sdinfo[n],
layout->
has_int_sce);
if (ret < 0) {
return ret;
}
......
......@@ -134,9 +134,10 @@ static const struct pc236_board pc236_boards[] = {
#ifdef CONFIG_COMEDI_PCI
static DEFINE_PCI_DEVICE_TABLE(pc236_pci_table) = {
{PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI236, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
{0}
{
PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI236,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
0}
};
MODULE_DEVICE_TABLE(pci, pc236_pci_table);
......@@ -190,12 +191,16 @@ static int pc236_request_region(unsigned minor, unsigned long from,
static void pc236_intr_disable(struct comedi_device *dev);
static void pc236_intr_enable(struct comedi_device *dev);
static int pc236_intr_check(struct comedi_device *dev);
static int pc236_intr_insn(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int pc236_intr_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
static int pc236_intr_insn(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn,
unsigned int *data);
static int pc236_intr_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd);
static int pc236_intr_cmd(struct comedi_device *dev, struct comedi_subdevice *s);
static int pc236_intr_cancel(struct comedi_device *dev, struct comedi_subdevice *s);
static int pc236_intr_cmd(struct comedi_device *dev,
struct comedi_subdevice *s);
static int pc236_intr_cancel(struct comedi_device *dev,
struct comedi_subdevice *s);
static irqreturn_t pc236_interrupt(int irq, void *d);
/*
......@@ -536,8 +541,9 @@ static int pc236_intr_check(struct comedi_device *dev)
* Input from subdevice 1.
* Copied from the comedi_parport driver.
*/
static int pc236_intr_insn(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
static int pc236_intr_insn(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn,
unsigned int *data)
{
data[1] = 0;
return 2;
......@@ -547,7 +553,8 @@ static int pc236_intr_insn(struct comedi_device *dev, struct comedi_subdevice *s
* Subdevice 1 command test.
* Copied from the comedi_parport driver.
*/
static int pc236_intr_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
static int pc236_intr_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{
int err = 0;
......@@ -635,7 +642,8 @@ static int pc236_intr_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
/*
* Subdevice 1 cancel command.
*/
static int pc236_intr_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
static int pc236_intr_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{
pc236_intr_disable(dev);
......
......@@ -101,9 +101,10 @@ static const struct pc263_board pc263_boards[] = {
#ifdef CONFIG_COMEDI_PCI
static DEFINE_PCI_DEVICE_TABLE(pc263_pci_table) = {
{PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI263, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
{0}
{
PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI263,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
0}
};
MODULE_DEVICE_TABLE(pci, pc263_pci_table);
......@@ -146,9 +147,11 @@ static struct comedi_driver driver_amplc_pc263 = {
static int pc263_request_region(unsigned minor, unsigned long from,
unsigned long extent);
static int pc263_dio_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s,
static int pc263_dio_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int pc263_dio_insn_config(struct comedi_device *dev, struct comedi_subdevice *s,
static int pc263_dio_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
/*
......@@ -391,7 +394,8 @@ static int pc263_request_region(unsigned minor, unsigned long from,
* useful to applications if you implement the insn_bits interface.
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
static int pc263_dio_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s,
static int pc263_dio_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
if (insn->n != 2)
......@@ -416,7 +420,8 @@ static int pc263_dio_insn_bits(struct comedi_device *dev, struct comedi_subdevic
return 2;
}
static int pc263_dio_insn_config(struct comedi_device *dev, struct comedi_subdevice *s,
static int pc263_dio_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
if (insn->n != 1)
......
......@@ -383,11 +383,12 @@ static const struct pci224_board pci224_boards[] = {
*/
static DEFINE_PCI_DEVICE_TABLE(pci224_pci_table) = {
{PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI224,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI234,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{0}
{
PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI224,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI234,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
0}
};
MODULE_DEVICE_TABLE(pci, pci224_pci_table);
......@@ -428,7 +429,8 @@ struct pci224_private {
* the board, and also about the kernel module that contains
* the device code.
*/
static int pci224_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static int pci224_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int pci224_detach(struct comedi_device *dev);
static struct comedi_driver driver_amplc_pci224 = {
.driver_name = DRIVER_NAME,
......@@ -446,7 +448,8 @@ COMEDI_PCI_INITCLEANUP(driver_amplc_pci224, pci224_pci_table);
* Called from the 'insn_write' function to perform a single write.
*/
static void
pci224_ao_set_data(struct comedi_device *dev, int chan, int range, unsigned int data)
pci224_ao_set_data(struct comedi_device *dev, int chan, int range,
unsigned int data)
{
unsigned short mangled;
......@@ -456,7 +459,8 @@ pci224_ao_set_data(struct comedi_device *dev, int chan, int range, unsigned int
outw(1 << chan, dev->iobase + PCI224_DACCEN);
/* Set range and reset FIFO. */
devpriv->daccon = COMBINE(devpriv->daccon, devpriv->hwrange[range],
(PCI224_DACCON_POLAR_MASK | PCI224_DACCON_VREF_MASK));
(PCI224_DACCON_POLAR_MASK |
PCI224_DACCON_VREF_MASK));
outw(devpriv->daccon | PCI224_DACCON_FIFORESET,
dev->iobase + PCI224_DACCON);
/*
......@@ -534,7 +538,8 @@ pci224_cascade_ns_to_timer(int osc_base, unsigned int *d1, unsigned int *d2,
/*
* Kills a command running on the AO subdevice.
*/
static void pci224_ao_stop(struct comedi_device *dev, struct comedi_subdevice *s)
static void pci224_ao_stop(struct comedi_device *dev,
struct comedi_subdevice *s)
{
unsigned long flags;
......@@ -565,8 +570,10 @@ static void pci224_ao_stop(struct comedi_device *dev, struct comedi_subdevice *s
/* Reconfigure DAC for insn_write usage. */
outw(0, dev->iobase + PCI224_DACCEN); /* Disable channels. */
devpriv->daccon = COMBINE(devpriv->daccon,
PCI224_DACCON_TRIG_SW | PCI224_DACCON_FIFOINTR_EMPTY,
PCI224_DACCON_TRIG_MASK | PCI224_DACCON_FIFOINTR_MASK);
PCI224_DACCON_TRIG_SW |
PCI224_DACCON_FIFOINTR_EMPTY,
PCI224_DACCON_TRIG_MASK |
PCI224_DACCON_FIFOINTR_MASK);
outw(devpriv->daccon | PCI224_DACCON_FIFORESET,
dev->iobase + PCI224_DACCON);
}
......@@ -574,7 +581,8 @@ static void pci224_ao_stop(struct comedi_device *dev, struct comedi_subdevice *s
/*
* Handles start of acquisition for the AO subdevice.
*/
static void pci224_ao_start(struct comedi_device *dev, struct comedi_subdevice *s)
static void pci224_ao_start(struct comedi_device *dev,
struct comedi_subdevice *s)
{
struct comedi_cmd *cmd = &s->async->cmd;
unsigned long flags;
......@@ -601,7 +609,8 @@ static void pci224_ao_start(struct comedi_device *dev, struct comedi_subdevice *
/*
* Handles interrupts from the DAC FIFO.
*/
static void pci224_ao_handle_fifo(struct comedi_device *dev, struct comedi_subdevice *s)
static void pci224_ao_handle_fifo(struct comedi_device *dev,
struct comedi_subdevice *s)
{
struct comedi_cmd *cmd = &s->async->cmd;
unsigned int num_scans;
......@@ -630,8 +639,7 @@ static void pci224_ao_handle_fifo(struct comedi_device *dev, struct comedi_subde
switch (dacstat & PCI224_DACCON_FIFOFL_MASK) {
case PCI224_DACCON_FIFOFL_EMPTY:
room = PCI224_FIFO_ROOM_EMPTY;
if (!devpriv->ao_stop_continuous
&& devpriv->ao_stop_count == 0) {
if (!devpriv->ao_stop_continuous && devpriv->ao_stop_count == 0) {
/* FIFO empty at end of counted acquisition. */
pci224_ao_stop(dev, s);
s->async->events |= COMEDI_CB_EOA;
......@@ -672,8 +680,7 @@ static void pci224_ao_handle_fifo(struct comedi_device *dev, struct comedi_subde
cfc_read_array_from_buffer(s, &devpriv->ao_scan_vals[0],
bytes_per_scan);
for (i = 0; i < cmd->chanlist_len; i++) {
outw(devpriv->ao_scan_vals[devpriv->
ao_scan_order[i]],
outw(devpriv->ao_scan_vals[devpriv->ao_scan_order[i]],
dev->iobase + PCI224_DACDATA);
}
}
......@@ -687,8 +694,7 @@ static void pci224_ao_handle_fifo(struct comedi_device *dev, struct comedi_subde
devpriv->daccon = COMBINE(devpriv->daccon,
PCI224_DACCON_FIFOINTR_EMPTY,
PCI224_DACCON_FIFOINTR_MASK);
outw(devpriv->daccon,
dev->iobase + PCI224_DACCON);
outw(devpriv->daccon, dev->iobase + PCI224_DACCON);
}
}
if ((devpriv->daccon & PCI224_DACCON_TRIG_MASK) ==
......@@ -750,7 +756,8 @@ pci224_ao_inttrig_start(struct comedi_device *dev, struct comedi_subdevice *s,
* 'do_cmdtest' function for AO subdevice.
*/
static int
pci224_ao_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_cmd *cmd)
pci224_ao_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{
int err = 0;
unsigned int tmp;
......@@ -866,7 +873,9 @@ pci224_ao_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s, struct
if ((cmd->scan_begin_arg & CR_FLAGS_MASK &
~(CR_EDGE | CR_INVERT)) != 0) {
cmd->scan_begin_arg = COMBINE(cmd->scan_begin_arg, 0,
CR_FLAGS_MASK & ~(CR_EDGE | CR_INVERT));
CR_FLAGS_MASK & ~(CR_EDGE
|
CR_INVERT));
err++;
}
break;
......@@ -951,7 +960,8 @@ pci224_ao_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s, struct
div1 = devpriv->cached_div1;
div2 = devpriv->cached_div2;
pci224_cascade_ns_to_timer(TIMEBASE_10MHZ, &div1, &div2,
&cmd->scan_begin_arg, round_mode);
&cmd->scan_begin_arg,
round_mode);
devpriv->cached_div1 = div1;
devpriv->cached_div2 = div2;
}
......@@ -1061,10 +1071,13 @@ static int pci224_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
* N.B. DAC FIFO interrupts are currently disabled.
*/
devpriv->daccon = COMBINE(devpriv->daccon,
(devpriv->hwrange[range] | PCI224_DACCON_TRIG_NONE |
(devpriv->
hwrange[range] | PCI224_DACCON_TRIG_NONE |
PCI224_DACCON_FIFOINTR_NHALF),
(PCI224_DACCON_POLAR_MASK | PCI224_DACCON_VREF_MASK |
PCI224_DACCON_TRIG_MASK | PCI224_DACCON_FIFOINTR_MASK));
(PCI224_DACCON_POLAR_MASK |
PCI224_DACCON_VREF_MASK |
PCI224_DACCON_TRIG_MASK |
PCI224_DACCON_FIFOINTR_MASK));
outw(devpriv->daccon | PCI224_DACCON_FIFORESET,
dev->iobase + PCI224_DACCON);
......@@ -1174,7 +1187,8 @@ static int pci224_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
/*
* 'cancel' function for AO subdevice.
*/
static int pci224_ao_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
static int pci224_ao_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{
pci224_ao_stop(dev, s);
return 0;
......@@ -1184,8 +1198,8 @@ static int pci224_ao_cancel(struct comedi_device *dev, struct comedi_subdevice *
* 'munge' data for AO command.
*/
static void
pci224_ao_munge(struct comedi_device *dev, struct comedi_subdevice *s, void *data,
unsigned int num_bytes, unsigned int chan_index)
pci224_ao_munge(struct comedi_device *dev, struct comedi_subdevice *s,
void *data, unsigned int num_bytes, unsigned int chan_index)
{
struct comedi_async *async = s->async;
short *array = data;
......@@ -1393,7 +1407,8 @@ static int pci224_attach(struct comedi_device *dev, struct comedi_devconfig *it)
outw(0, dev->iobase + PCI224_DACCEN);
outw(0, dev->iobase + PCI224_FIFOSIZ);
devpriv->daccon = (PCI224_DACCON_TRIG_SW | PCI224_DACCON_POLAR_BI |
PCI224_DACCON_FIFOENAB | PCI224_DACCON_FIFOINTR_EMPTY);
PCI224_DACCON_FIFOENAB |
PCI224_DACCON_FIFOINTR_EMPTY);
outw(devpriv->daccon | PCI224_DACCON_FIFORESET,
dev->iobase + PCI224_DACCON);
......@@ -1467,8 +1482,7 @@ static int pci224_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (it->options[2] != 0) {
printk(KERN_WARNING "comedi%d: %s: warning! "
"bad options[2]=%d\n",
dev->minor, DRIVER_NAME,
it->options[2]);
dev->minor, DRIVER_NAME, it->options[2]);
}
s->range_table = &range_pci224_internal;
devpriv->hwrange = hwrange_pci224_internal;
......
......@@ -97,7 +97,8 @@ union encvaluetype {
#define C6XDIGIO_TIME_OUT 20
static int c6xdigio_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static int c6xdigio_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int c6xdigio_detach(struct comedi_device *dev);
struct comedi_driver driver_c6xdigio = {
.driver_name = "c6xdigio",
......@@ -339,14 +340,17 @@ static void C6X_encResetAll(unsigned long baseAddr)
}
static int c6xdigio_pwmo_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
printk("c6xdigio_pwmo_insn_read %x\n", insn->n);
return insn->n;
}
static int c6xdigio_pwmo_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
......@@ -375,12 +379,13 @@ static int c6xdigio_pwmo_insn_write(struct comedi_device *dev,
/* { */
/* int i; */
/* int chan = CR_CHAN(insn->chanspec); */
/* *//* C6X_encResetAll( dev->iobase ); */
/* *//* return insn->n; */
/* *//* C6X_encResetAll( dev->iobase ); */
/* *//* return insn->n; */
/* } */
static int c6xdigio_ei_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
/* printk("c6xdigio_ei__insn_read %x\n", insn->n); */
int n;
......@@ -415,9 +420,9 @@ static void board_init(struct comedi_device *dev)
static const struct pnp_device_id c6xdigio_pnp_tbl[] = {
/* Standard LPT Printer Port */
{.id = "PNP0400", .driver_data = 0},
{.id = "PNP0400",.driver_data = 0},
/* ECP Printer Port */
{.id = "PNP0401", .driver_data = 0},
{.id = "PNP0401",.driver_data = 0},
{}
};
......@@ -426,7 +431,8 @@ static struct pnp_driver c6xdigio_pnp_driver = {
.id_table = c6xdigio_pnp_tbl,
};
static int c6xdigio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static int c6xdigio_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
int result = 0;
unsigned long iobase;
......
......@@ -62,7 +62,7 @@ struct das16cs_board {
};
static const struct das16cs_board das16cs_boards[] = {
{
.device_id = 0x0000,/* unknown */
.device_id = 0x0000, /* unknown */
.name = "PC-CARD DAS16/16",
.n_ao_chans = 0,
},
......@@ -90,7 +90,8 @@ struct das16cs_private {
};
#define devpriv ((struct das16cs_private *)dev->private)
static int das16cs_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static int das16cs_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int das16cs_detach(struct comedi_device *dev);
static struct comedi_driver driver_das16cs = {
.driver_name = "cb_das16_cs",
......@@ -110,23 +111,35 @@ static const struct comedi_lrange das16cs_ai_range = { 4, {
};
static irqreturn_t das16cs_interrupt(int irq, void *d);
static int das16cs_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
static int das16cs_ai_rinsn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int das16cs_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s);
static int das16cs_ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
static int das16cs_ai_cmd(struct comedi_device *dev,
struct comedi_subdevice *s);
static int das16cs_ai_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd);
static int das16cs_ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s,
static int das16cs_ao_winsn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int das16cs_ao_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
static int das16cs_ao_rinsn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int das16cs_dio_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int das16cs_dio_insn_config(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int das16cs_timer_insn_read(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int das16cs_timer_insn_config(struct comedi_device *dev, struct comedi_subdevice *s,
static int das16cs_dio_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
static int das16cs_dio_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data);
static int das16cs_timer_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data);
static int das16cs_timer_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data);
static int get_prodid(struct comedi_device *dev, struct pcmcia_device *link)
{
......@@ -147,7 +160,7 @@ static int get_prodid(struct comedi_device *dev, struct pcmcia_device *link)
return prodid;
}
static const struct das16cs_board *das16cs_probe(struct comedi_device * dev,
static const struct das16cs_board *das16cs_probe(struct comedi_device *dev,
struct pcmcia_device *link)
{
int id;
......@@ -166,7 +179,8 @@ static const struct das16cs_board *das16cs_probe(struct comedi_device * dev,
return NULL;
}
static int das16cs_attach(struct comedi_device *dev, struct comedi_devconfig *it)
static int das16cs_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct pcmcia_device *link;
struct comedi_subdevice *s;
......@@ -287,7 +301,8 @@ static irqreturn_t das16cs_interrupt(int irq, void *d)
* "instructions" read/write data in "one-shot" or "software-triggered"
* mode.
*/
static int das16cs_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
static int das16cs_ai_rinsn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int i;
......@@ -334,7 +349,8 @@ static int das16cs_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
return -EINVAL;
}
static int das16cs_ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
static int das16cs_ai_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{
int err = 0;
......@@ -463,7 +479,8 @@ static int das16cs_ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice
tmp = cmd->scan_begin_arg;
i8253_cascade_ns_to_timer(100, &div1, &div2,
&cmd->scan_begin_arg, cmd->flags & TRIG_ROUND_MASK);
&cmd->scan_begin_arg,
cmd->flags & TRIG_ROUND_MASK);
if (tmp != cmd->scan_begin_arg)
err++;
}
......@@ -472,7 +489,8 @@ static int das16cs_ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice
tmp = cmd->convert_arg;
i8253_cascade_ns_to_timer(100, &div1, &div2,
&cmd->scan_begin_arg, cmd->flags & TRIG_ROUND_MASK);
&cmd->scan_begin_arg,
cmd->flags & TRIG_ROUND_MASK);
if (tmp != cmd->convert_arg)
err++;
if (cmd->scan_begin_src == TRIG_TIMER &&
......@@ -490,7 +508,8 @@ static int das16cs_ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice
return 0;
}
static int das16cs_ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s,
static int das16cs_ao_winsn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int i;
......@@ -536,7 +555,8 @@ static int das16cs_ao_winsn(struct comedi_device *dev, struct comedi_subdevice *
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
static int das16cs_ao_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
static int das16cs_ao_rinsn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int i;
......@@ -553,7 +573,8 @@ static int das16cs_ao_rinsn(struct comedi_device *dev, struct comedi_subdevice *
* useful to applications if you implement the insn_bits interface.
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
static int das16cs_dio_insn_bits(struct comedi_device *dev, struct comedi_subdevice *s,
static int das16cs_dio_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
if (insn->n != 2)
......@@ -573,7 +594,8 @@ static int das16cs_dio_insn_bits(struct comedi_device *dev, struct comedi_subdev
return 2;
}
static int das16cs_dio_insn_config(struct comedi_device *dev, struct comedi_subdevice *s,
static int das16cs_dio_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
int chan = CR_CHAN(insn->chanspec);
......@@ -593,8 +615,7 @@ static int das16cs_dio_insn_config(struct comedi_device *dev, struct comedi_subd
break;
case INSN_CONFIG_DIO_QUERY:
data[1] =
(s->
io_bits & (1 << chan)) ? COMEDI_OUTPUT : COMEDI_INPUT;
(s->io_bits & (1 << chan)) ? COMEDI_OUTPUT : COMEDI_INPUT;
return insn->n;
break;
default:
......@@ -611,14 +632,17 @@ static int das16cs_dio_insn_config(struct comedi_device *dev, struct comedi_subd
return insn->n;
}
static int das16cs_timer_insn_read(struct comedi_device *dev, struct comedi_subdevice *s,
static int das16cs_timer_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
return -EINVAL;
}
static int das16cs_timer_insn_config(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
static int das16cs_timer_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{
return -EINVAL;
}
......@@ -739,7 +763,7 @@ static void das16cs_pcmcia_detach(struct pcmcia_device *link)
DEBUG(0, "das16cs_pcmcia_detach(0x%p)\n", link);
if (link->dev_node) {
((struct local_info_t *) link->priv)->stop = 1;
((struct local_info_t *)link->priv)->stop = 1;
das16cs_pcmcia_release(link);
}
/* This points to the parent struct local_info_t struct */
......@@ -853,7 +877,7 @@ static void das16cs_pcmcia_config(struct pcmcia_device *link)
/* If we got this far, we're cool! */
break;
next_entry:
next_entry:
last_fn = GetNextTuple;
last_ret = pcmcia_get_next_tuple(link, &tuple);
......@@ -906,7 +930,7 @@ static void das16cs_pcmcia_config(struct pcmcia_device *link)
return;
cs_failed:
cs_failed:
cs_error(link, last_fn, last_ret);
das16cs_pcmcia_release(link);
} /* das16cs_pcmcia_config */
......
This diff is collapsed.
This diff is collapsed.
......@@ -87,10 +87,11 @@ static const struct pcidio_board pcidio_boards[] = {
/* Please add your PCI vendor ID to comedidev.h, and it will be forwarded
* upstream. */
static DEFINE_PCI_DEVICE_TABLE(pcidio_pci_table) = {
{PCI_VENDOR_ID_CB, 0x0028, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_CB, 0x0014, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_CB, 0x000b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{0}
{
PCI_VENDOR_ID_CB, 0x0028, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
PCI_VENDOR_ID_CB, 0x0014, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
PCI_VENDOR_ID_CB, 0x000b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {
0}
};
MODULE_DEVICE_TABLE(pci, pcidio_pci_table);
......@@ -127,7 +128,8 @@ struct pcidio_private {
* the board, and also about the kernel module that contains
* the device code.
*/
static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static int pcidio_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int pcidio_detach(struct comedi_device *dev);
static struct comedi_driver driver_cb_pcidio = {
.driver_name = "cb_pcidio",
......@@ -203,9 +205,7 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (pcidev->vendor != PCI_VENDOR_ID_CB)
continue;
/* loop through cards supported by this driver */
for (index = 0;
index < ARRAY_SIZE(pcidio_boards);
index++) {
for (index = 0; index < ARRAY_SIZE(pcidio_boards); index++) {
if (pcidio_pci_table[index].device != pcidev->device)
continue;
......@@ -213,8 +213,7 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (it->options[0] || it->options[1]) {
/* are we on the wrong bus/slot? */
if (pcidev->bus->number != it->options[0] ||
PCI_SLOT(pcidev->devfn) !=
it->options[1]) {
PCI_SLOT(pcidev->devfn) != it->options[1]) {
continue;
}
}
......@@ -227,7 +226,7 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
"requested position\n");
return -EIO;
found:
found:
/*
* Initialize dev->board_name. Note that we can use the "thisboard"
......@@ -240,7 +239,8 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
devpriv->pci_dev->bus->number,
PCI_SLOT(devpriv->pci_dev->devfn));
if (comedi_pci_enable(pcidev, thisboard->name)) {
printk("cb_pcidio: failed to enable PCI device and request regions\n");
printk
("cb_pcidio: failed to enable PCI device and request regions\n");
return -EIO;
}
devpriv->dio_reg_base
......
This diff is collapsed.
......@@ -143,9 +143,10 @@ static const struct board_struct boards[] = {
/* Please add your PCI vendor ID to comedidev.h, and it will be forwarded
* upstream. */
static DEFINE_PCI_DEVICE_TABLE(pci_table) = {
{PCI_VENDOR_ID_COMPUTERBOARDS, PCI_ID_PCIM_DDA06_16, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0},
{0}
{
PCI_VENDOR_ID_COMPUTERBOARDS, PCI_ID_PCIM_DDA06_16, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0}, {
0}
};
MODULE_DEVICE_TABLE(pci, pci_table);
......@@ -207,7 +208,7 @@ static int ao_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
/* returns a maxdata value for a given n_bits */
static inline unsigned int figure_out_maxdata(int bits)
{
return ((unsigned int) 1 << bits) - 1;
return ((unsigned int)1 << bits) - 1;
}
/*
......@@ -444,8 +445,7 @@ static int probe(struct comedi_device *dev, const struct comedi_devconfig *it)
if (it->options[0] || it->options[1]) {
/* are we on the wrong bus/slot? */
if (pcidev->bus->number != it->options[0] ||
PCI_SLOT(pcidev->devfn) !=
it->options[1]) {
PCI_SLOT(pcidev->devfn) != it->options[1]) {
continue;
}
}
......@@ -454,7 +454,8 @@ static int probe(struct comedi_device *dev, const struct comedi_devconfig *it)
devpriv->pci_dev = pcidev;
dev->board_ptr = boards + index;
if (comedi_pci_enable(pcidev, thisboard->name)) {
printk("cb_pcimdda: Failed to enable PCI device and request regions\n");
printk
("cb_pcimdda: Failed to enable PCI device and request regions\n");
return -EIO;
}
registers =
......
This diff is collapsed.
......@@ -40,8 +40,8 @@ static inline unsigned int cfc_write_to_buffer(struct comedi_subdevice *subd,
return cfc_write_array_to_buffer(subd, &data, sizeof(data));
};
static inline unsigned int cfc_write_long_to_buffer(struct comedi_subdevice *subd,
unsigned int data)
static inline unsigned int cfc_write_long_to_buffer(struct comedi_subdevice
*subd, unsigned int data)
{
return cfc_write_array_to_buffer(subd, &data, sizeof(data));
};
......
This diff is collapsed.
......@@ -28,7 +28,8 @@ enum das08_bustype { isa, pci, pcmcia, pc104 };
/* different ways ai data is encoded in first two registers */
enum das08_ai_encoding { das08_encode12, das08_encode16, das08_pcm_encode12 };
enum das08_lrange { das08_pg_none, das08_bipolar5, das08_pgh, das08_pgl,
das08_pgm };
das08_pgm
};
struct das08_board_struct {
const char *name;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -30,7 +30,8 @@
enum labpc_bustype { isa_bustype, pci_bustype, pcmcia_bustype };
enum labpc_register_layout { labpc_plus_layout, labpc_1200_layout };
enum transfer_type { fifo_not_empty_transfer, fifo_half_full_transfer,
isa_dma_transfer };
isa_dma_transfer
};
struct labpc_board_struct {
const char *name;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -20,7 +20,8 @@ Devices: [Advantech] PCL-725 (pcl725)
#define PCL725_DO 0
#define PCL725_DI 1
static int pcl725_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static int pcl725_attach(struct comedi_device *dev,
struct comedi_devconfig *it);
static int pcl725_detach(struct comedi_device *dev);
static struct comedi_driver driver_pcl725 = {
.driver_name = "pcl725",
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment