Commit e473e912 authored by Bill Pemberton's avatar Bill Pemberton Committed by Greg Kroah-Hartman

Staging: comedi: Change "foo * bar" to "foo *bar"

Removes checkpatch.pl errors
Signed-off-by: default avatarBill Pemberton <wfp5p@virginia.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b6c77757
...@@ -47,13 +47,13 @@ ...@@ -47,13 +47,13 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/system.h> #include <asm/system.h>
static int postconfig(comedi_device * dev); static int postconfig(comedi_device *dev);
static int insn_rw_emulate_bits(comedi_device * dev, comedi_subdevice * s, static int insn_rw_emulate_bits(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data); comedi_insn *insn, lsampl_t *data);
static void *comedi_recognize(comedi_driver * driv, const char *name); static void *comedi_recognize(comedi_driver * driv, const char *name);
static void comedi_report_boards(comedi_driver * driv); static void comedi_report_boards(comedi_driver *driv);
static int poll_invalid(comedi_device * dev, comedi_subdevice * s); static int poll_invalid(comedi_device *dev, comedi_subdevice *s);
int comedi_buf_alloc(comedi_device * dev, comedi_subdevice * s, int comedi_buf_alloc(comedi_device *dev, comedi_subdevice *s,
unsigned long new_size); unsigned long new_size);
comedi_driver *comedi_drivers; comedi_driver *comedi_drivers;
...@@ -63,7 +63,7 @@ int comedi_modprobe(int minor) ...@@ -63,7 +63,7 @@ int comedi_modprobe(int minor)
return -EINVAL; return -EINVAL;
} }
static void cleanup_device(comedi_device * dev) static void cleanup_device(comedi_device *dev)
{ {
int i; int i;
comedi_subdevice *s; comedi_subdevice *s;
...@@ -97,7 +97,7 @@ static void cleanup_device(comedi_device * dev) ...@@ -97,7 +97,7 @@ static void cleanup_device(comedi_device * dev)
comedi_set_hw_dev(dev, NULL); comedi_set_hw_dev(dev, NULL);
} }
static void __comedi_device_detach(comedi_device * dev) static void __comedi_device_detach(comedi_device *dev)
{ {
dev->attached = 0; dev->attached = 0;
if (dev->driver) { if (dev->driver) {
...@@ -108,14 +108,14 @@ static void __comedi_device_detach(comedi_device * dev) ...@@ -108,14 +108,14 @@ static void __comedi_device_detach(comedi_device * dev)
cleanup_device(dev); cleanup_device(dev);
} }
void comedi_device_detach(comedi_device * dev) void comedi_device_detach(comedi_device *dev)
{ {
if (!dev->attached) if (!dev->attached)
return; return;
__comedi_device_detach(dev); __comedi_device_detach(dev);
} }
int comedi_device_attach(comedi_device * dev, comedi_devconfig * it) int comedi_device_attach(comedi_device *dev, comedi_devconfig *it)
{ {
comedi_driver *driv; comedi_driver *driv;
int ret; int ret;
...@@ -182,7 +182,7 @@ attached: ...@@ -182,7 +182,7 @@ attached:
return 0; return 0;
} }
int comedi_driver_register(comedi_driver * driver) int comedi_driver_register(comedi_driver *driver)
{ {
driver->next = comedi_drivers; driver->next = comedi_drivers;
comedi_drivers = driver; comedi_drivers = driver;
...@@ -190,7 +190,7 @@ int comedi_driver_register(comedi_driver * driver) ...@@ -190,7 +190,7 @@ int comedi_driver_register(comedi_driver * driver)
return 0; return 0;
} }
int comedi_driver_unregister(comedi_driver * driver) int comedi_driver_unregister(comedi_driver *driver)
{ {
comedi_driver *prev; comedi_driver *prev;
int i; int i;
...@@ -226,7 +226,7 @@ int comedi_driver_unregister(comedi_driver * driver) ...@@ -226,7 +226,7 @@ int comedi_driver_unregister(comedi_driver * driver)
return -EINVAL; return -EINVAL;
} }
static int postconfig(comedi_device * dev) static int postconfig(comedi_device *dev)
{ {
int i; int i;
comedi_subdevice *s; comedi_subdevice *s;
...@@ -315,7 +315,7 @@ void *comedi_recognize(comedi_driver * driv, const char *name) ...@@ -315,7 +315,7 @@ void *comedi_recognize(comedi_driver * driv, const char *name)
return NULL; return NULL;
} }
void comedi_report_boards(comedi_driver * driv) void comedi_report_boards(comedi_driver *driv)
{ {
unsigned int i; unsigned int i;
const char *const *name_ptr; const char *const *name_ptr;
...@@ -333,19 +333,19 @@ void comedi_report_boards(comedi_driver * driv) ...@@ -333,19 +333,19 @@ void comedi_report_boards(comedi_driver * driv)
printk(" %s\n", driv->driver_name); printk(" %s\n", driv->driver_name);
} }
static int poll_invalid(comedi_device * dev, comedi_subdevice * s) static int poll_invalid(comedi_device *dev, comedi_subdevice *s)
{ {
return -EINVAL; return -EINVAL;
} }
int insn_inval(comedi_device * dev, comedi_subdevice * s, int insn_inval(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
return -EINVAL; return -EINVAL;
} }
static int insn_rw_emulate_bits(comedi_device * dev, comedi_subdevice * s, static int insn_rw_emulate_bits(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
comedi_insn new_insn; comedi_insn new_insn;
int ret; int ret;
...@@ -381,7 +381,7 @@ static int insn_rw_emulate_bits(comedi_device * dev, comedi_subdevice * s, ...@@ -381,7 +381,7 @@ static int insn_rw_emulate_bits(comedi_device * dev, comedi_subdevice * s,
return 1; return 1;
} }
static inline unsigned long uvirt_to_kva(pgd_t * pgd, unsigned long adr) static inline unsigned long uvirt_to_kva(pgd_t *pgd, unsigned long adr)
{ {
unsigned long ret = 0UL; unsigned long ret = 0UL;
pmd_t *pmd; pmd_t *pmd;
...@@ -414,7 +414,7 @@ static inline unsigned long kvirt_to_kva(unsigned long adr) ...@@ -414,7 +414,7 @@ static inline unsigned long kvirt_to_kva(unsigned long adr)
return kva; return kva;
} }
int comedi_buf_alloc(comedi_device * dev, comedi_subdevice * s, int comedi_buf_alloc(comedi_device *dev, comedi_subdevice *s,
unsigned long new_size) unsigned long new_size)
{ {
comedi_async *async = s->async; comedi_async *async = s->async;
...@@ -538,7 +538,7 @@ int comedi_buf_alloc(comedi_device * dev, comedi_subdevice * s, ...@@ -538,7 +538,7 @@ int comedi_buf_alloc(comedi_device * dev, comedi_subdevice * s,
/* munging is applied to data by core as it passes between user /* munging is applied to data by core as it passes between user
* and kernel space */ * and kernel space */
unsigned int comedi_buf_munge(comedi_async * async, unsigned int num_bytes) unsigned int comedi_buf_munge(comedi_async *async, unsigned int num_bytes)
{ {
comedi_subdevice *s = async->subdevice; comedi_subdevice *s = async->subdevice;
unsigned int count = 0; unsigned int count = 0;
...@@ -582,7 +582,7 @@ unsigned int comedi_buf_munge(comedi_async * async, unsigned int num_bytes) ...@@ -582,7 +582,7 @@ unsigned int comedi_buf_munge(comedi_async * async, unsigned int num_bytes)
return count; return count;
} }
unsigned int comedi_buf_write_n_available(comedi_async * async) unsigned int comedi_buf_write_n_available(comedi_async *async)
{ {
unsigned int free_end; unsigned int free_end;
unsigned int nbytes; unsigned int nbytes;
...@@ -602,7 +602,7 @@ unsigned int comedi_buf_write_n_available(comedi_async * async) ...@@ -602,7 +602,7 @@ unsigned int comedi_buf_write_n_available(comedi_async * async)
} }
/* allocates chunk for the writer from free buffer space */ /* allocates chunk for the writer from free buffer space */
unsigned int comedi_buf_write_alloc(comedi_async * async, unsigned int nbytes) unsigned int comedi_buf_write_alloc(comedi_async *async, unsigned int nbytes)
{ {
unsigned int free_end = async->buf_read_count + async->prealloc_bufsz; unsigned int free_end = async->buf_read_count + async->prealloc_bufsz;
...@@ -617,7 +617,7 @@ unsigned int comedi_buf_write_alloc(comedi_async * async, unsigned int nbytes) ...@@ -617,7 +617,7 @@ unsigned int comedi_buf_write_alloc(comedi_async * async, unsigned int nbytes)
} }
/* allocates nothing unless it can completely fulfill the request */ /* allocates nothing unless it can completely fulfill the request */
unsigned int comedi_buf_write_alloc_strict(comedi_async * async, unsigned int comedi_buf_write_alloc_strict(comedi_async *async,
unsigned int nbytes) unsigned int nbytes)
{ {
unsigned int free_end = async->buf_read_count + async->prealloc_bufsz; unsigned int free_end = async->buf_read_count + async->prealloc_bufsz;
...@@ -633,7 +633,7 @@ unsigned int comedi_buf_write_alloc_strict(comedi_async * async, ...@@ -633,7 +633,7 @@ unsigned int comedi_buf_write_alloc_strict(comedi_async * async,
} }
/* transfers a chunk from writer to filled buffer space */ /* transfers a chunk from writer to filled buffer space */
unsigned comedi_buf_write_free(comedi_async * async, unsigned int nbytes) unsigned comedi_buf_write_free(comedi_async *async, unsigned int nbytes)
{ {
if ((int)(async->buf_write_count + nbytes - if ((int)(async->buf_write_count + nbytes -
async->buf_write_alloc_count) > 0) { async->buf_write_alloc_count) > 0) {
...@@ -651,7 +651,7 @@ unsigned comedi_buf_write_free(comedi_async * async, unsigned int nbytes) ...@@ -651,7 +651,7 @@ unsigned comedi_buf_write_free(comedi_async * async, unsigned int nbytes)
} }
/* allocates a chunk for the reader from filled (and munged) buffer space */ /* allocates a chunk for the reader from filled (and munged) buffer space */
unsigned comedi_buf_read_alloc(comedi_async * async, unsigned nbytes) unsigned comedi_buf_read_alloc(comedi_async *async, unsigned nbytes)
{ {
if ((int)(async->buf_read_alloc_count + nbytes - async->munge_count) > if ((int)(async->buf_read_alloc_count + nbytes - async->munge_count) >
0) { 0) {
...@@ -665,7 +665,7 @@ unsigned comedi_buf_read_alloc(comedi_async * async, unsigned nbytes) ...@@ -665,7 +665,7 @@ unsigned comedi_buf_read_alloc(comedi_async * async, unsigned nbytes)
} }
/* transfers control of a chunk from reader to free buffer space */ /* transfers control of a chunk from reader to free buffer space */
unsigned comedi_buf_read_free(comedi_async * async, unsigned int nbytes) unsigned comedi_buf_read_free(comedi_async *async, unsigned int nbytes)
{ {
/* barrier insures data has been read out of buffer before read count is incremented */ /* barrier insures data has been read out of buffer before read count is incremented */
smp_mb(); smp_mb();
...@@ -681,7 +681,7 @@ unsigned comedi_buf_read_free(comedi_async * async, unsigned int nbytes) ...@@ -681,7 +681,7 @@ unsigned comedi_buf_read_free(comedi_async * async, unsigned int nbytes)
return nbytes; return nbytes;
} }
void comedi_buf_memcpy_to(comedi_async * async, unsigned int offset, void comedi_buf_memcpy_to(comedi_async *async, unsigned int offset,
const void *data, unsigned int num_bytes) const void *data, unsigned int num_bytes)
{ {
unsigned int write_ptr = async->buf_write_ptr + offset; unsigned int write_ptr = async->buf_write_ptr + offset;
...@@ -706,7 +706,7 @@ void comedi_buf_memcpy_to(comedi_async * async, unsigned int offset, ...@@ -706,7 +706,7 @@ void comedi_buf_memcpy_to(comedi_async * async, unsigned int offset,
} }
} }
void comedi_buf_memcpy_from(comedi_async * async, unsigned int offset, void comedi_buf_memcpy_from(comedi_async *async, unsigned int offset,
void *dest, unsigned int nbytes) void *dest, unsigned int nbytes)
{ {
void *src; void *src;
...@@ -732,7 +732,7 @@ void comedi_buf_memcpy_from(comedi_async * async, unsigned int offset, ...@@ -732,7 +732,7 @@ void comedi_buf_memcpy_from(comedi_async * async, unsigned int offset,
} }
} }
unsigned int comedi_buf_read_n_available(comedi_async * async) unsigned int comedi_buf_read_n_available(comedi_async *async)
{ {
unsigned num_bytes; unsigned num_bytes;
...@@ -747,7 +747,7 @@ unsigned int comedi_buf_read_n_available(comedi_async * async) ...@@ -747,7 +747,7 @@ unsigned int comedi_buf_read_n_available(comedi_async * async)
return num_bytes; return num_bytes;
} }
int comedi_buf_get(comedi_async * async, sampl_t * x) int comedi_buf_get(comedi_async *async, sampl_t *x)
{ {
unsigned int n = comedi_buf_read_n_available(async); unsigned int n = comedi_buf_read_n_available(async);
...@@ -759,7 +759,7 @@ int comedi_buf_get(comedi_async * async, sampl_t * x) ...@@ -759,7 +759,7 @@ int comedi_buf_get(comedi_async * async, sampl_t * x)
return 1; return 1;
} }
int comedi_buf_put(comedi_async * async, sampl_t x) int comedi_buf_put(comedi_async *async, sampl_t x)
{ {
unsigned int n = comedi_buf_write_alloc_strict(async, sizeof(sampl_t)); unsigned int n = comedi_buf_write_alloc_strict(async, sizeof(sampl_t));
...@@ -772,7 +772,7 @@ int comedi_buf_put(comedi_async * async, sampl_t x) ...@@ -772,7 +772,7 @@ int comedi_buf_put(comedi_async * async, sampl_t x)
return 1; return 1;
} }
void comedi_reset_async_buf(comedi_async * async) void comedi_reset_async_buf(comedi_async *async)
{ {
async->buf_write_alloc_count = 0; async->buf_write_alloc_count = 0;
async->buf_write_count = 0; async->buf_write_count = 0;
......
...@@ -123,8 +123,8 @@ static const char range_codes_analog[] = { 0x00, 0x20, 0x10, 0x30 }; ...@@ -123,8 +123,8 @@ static const char range_codes_analog[] = { 0x00, 0x20, 0x10, 0x30 };
Forward declarations Forward declarations
============================================================================== ==============================================================================
*/ */
static int icp_multi_attach(comedi_device * dev, comedi_devconfig * it); static int icp_multi_attach(comedi_device *dev, comedi_devconfig *it);
static int icp_multi_detach(comedi_device * dev); static int icp_multi_detach(comedi_device *dev);
/* /*
============================================================================== ==============================================================================
...@@ -214,12 +214,12 @@ typedef struct { ...@@ -214,12 +214,12 @@ typedef struct {
*/ */
#if 0 #if 0
static int check_channel_list(comedi_device * dev, comedi_subdevice * s, static int check_channel_list(comedi_device *dev, comedi_subdevice *s,
unsigned int *chanlist, unsigned int n_chan); unsigned int *chanlist, unsigned int n_chan);
#endif #endif
static void setup_channel_list(comedi_device * dev, comedi_subdevice * s, static void setup_channel_list(comedi_device *dev, comedi_subdevice *s,
unsigned int *chanlist, unsigned int n_chan); unsigned int *chanlist, unsigned int n_chan);
static int icp_multi_reset(comedi_device * dev); static int icp_multi_reset(comedi_device *dev);
/* /*
============================================================================== ==============================================================================
...@@ -245,8 +245,8 @@ static int icp_multi_reset(comedi_device * dev); ...@@ -245,8 +245,8 @@ static int icp_multi_reset(comedi_device * dev);
============================================================================== ==============================================================================
*/ */
static int icp_multi_insn_read_ai(comedi_device * dev, comedi_subdevice * s, static int icp_multi_insn_read_ai(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
int n, timeout; int n, timeout;
...@@ -364,8 +364,8 @@ static int icp_multi_insn_read_ai(comedi_device * dev, comedi_subdevice * s, ...@@ -364,8 +364,8 @@ static int icp_multi_insn_read_ai(comedi_device * dev, comedi_subdevice * s,
============================================================================== ==============================================================================
*/ */
static int icp_multi_insn_write_ao(comedi_device * dev, comedi_subdevice * s, static int icp_multi_insn_write_ao(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
int n, chan, range, timeout; int n, chan, range, timeout;
...@@ -472,8 +472,8 @@ static int icp_multi_insn_write_ao(comedi_device * dev, comedi_subdevice * s, ...@@ -472,8 +472,8 @@ static int icp_multi_insn_write_ao(comedi_device * dev, comedi_subdevice * s,
============================================================================== ==============================================================================
*/ */
static int icp_multi_insn_read_ao(comedi_device * dev, comedi_subdevice * s, static int icp_multi_insn_read_ao(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
int n, chan; int n, chan;
...@@ -505,8 +505,8 @@ static int icp_multi_insn_read_ao(comedi_device * dev, comedi_subdevice * s, ...@@ -505,8 +505,8 @@ static int icp_multi_insn_read_ao(comedi_device * dev, comedi_subdevice * s,
============================================================================== ==============================================================================
*/ */
static int icp_multi_insn_bits_di(comedi_device * dev, comedi_subdevice * s, static int icp_multi_insn_bits_di(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
data[1] = readw(devpriv->io_addr + ICP_MULTI_DI); data[1] = readw(devpriv->io_addr + ICP_MULTI_DI);
...@@ -531,8 +531,8 @@ static int icp_multi_insn_bits_di(comedi_device * dev, comedi_subdevice * s, ...@@ -531,8 +531,8 @@ static int icp_multi_insn_bits_di(comedi_device * dev, comedi_subdevice * s,
============================================================================== ==============================================================================
*/ */
static int icp_multi_insn_bits_do(comedi_device * dev, comedi_subdevice * s, static int icp_multi_insn_bits_do(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
#ifdef ICP_MULTI_EXTDEBUG #ifdef ICP_MULTI_EXTDEBUG
printk("icp multi EDBG: BGN: icp_multi_insn_bits_do(...)\n"); printk("icp multi EDBG: BGN: icp_multi_insn_bits_do(...)\n");
...@@ -573,8 +573,8 @@ static int icp_multi_insn_bits_do(comedi_device * dev, comedi_subdevice * s, ...@@ -573,8 +573,8 @@ static int icp_multi_insn_bits_do(comedi_device * dev, comedi_subdevice * s,
============================================================================== ==============================================================================
*/ */
static int icp_multi_insn_read_ctr(comedi_device * dev, comedi_subdevice * s, static int icp_multi_insn_read_ctr(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
return 0; return 0;
} }
...@@ -597,8 +597,8 @@ static int icp_multi_insn_read_ctr(comedi_device * dev, comedi_subdevice * s, ...@@ -597,8 +597,8 @@ static int icp_multi_insn_read_ctr(comedi_device * dev, comedi_subdevice * s,
============================================================================== ==============================================================================
*/ */
static int icp_multi_insn_write_ctr(comedi_device * dev, comedi_subdevice * s, static int icp_multi_insn_write_ctr(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
return 0; return 0;
} }
...@@ -689,7 +689,7 @@ static irqreturn_t interrupt_service_icp_multi(int irq, void *d PT_REGS_ARG) ...@@ -689,7 +689,7 @@ static irqreturn_t interrupt_service_icp_multi(int irq, void *d PT_REGS_ARG)
============================================================================== ==============================================================================
*/ */
static int check_channel_list(comedi_device * dev, comedi_subdevice * s, static int check_channel_list(comedi_device *dev, comedi_subdevice *s,
unsigned int *chanlist, unsigned int n_chan) unsigned int *chanlist, unsigned int n_chan)
{ {
unsigned int i; unsigned int i;
...@@ -743,7 +743,7 @@ static int check_channel_list(comedi_device * dev, comedi_subdevice * s, ...@@ -743,7 +743,7 @@ static int check_channel_list(comedi_device * dev, comedi_subdevice * s,
============================================================================== ==============================================================================
*/ */
static void setup_channel_list(comedi_device * dev, comedi_subdevice * s, static void setup_channel_list(comedi_device *dev, comedi_subdevice *s,
unsigned int *chanlist, unsigned int n_chan) unsigned int *chanlist, unsigned int n_chan)
{ {
unsigned int i, range, chanprog; unsigned int i, range, chanprog;
...@@ -812,7 +812,7 @@ static void setup_channel_list(comedi_device * dev, comedi_subdevice * s, ...@@ -812,7 +812,7 @@ static void setup_channel_list(comedi_device * dev, comedi_subdevice * s,
============================================================================== ==============================================================================
*/ */
static int icp_multi_reset(comedi_device * dev) static int icp_multi_reset(comedi_device *dev)
{ {
unsigned int i; unsigned int i;
...@@ -870,7 +870,7 @@ static int icp_multi_reset(comedi_device * dev) ...@@ -870,7 +870,7 @@ static int icp_multi_reset(comedi_device * dev)
============================================================================== ==============================================================================
*/ */
static int icp_multi_attach(comedi_device * dev, comedi_devconfig * it) static int icp_multi_attach(comedi_device *dev, comedi_devconfig *it)
{ {
comedi_subdevice *s; comedi_subdevice *s;
int ret, subdev, n_subdevices; int ret, subdev, n_subdevices;
...@@ -1061,7 +1061,7 @@ static int icp_multi_attach(comedi_device * dev, comedi_devconfig * it) ...@@ -1061,7 +1061,7 @@ static int icp_multi_attach(comedi_device * dev, comedi_devconfig * it)
============================================================================== ==============================================================================
*/ */
static int icp_multi_detach(comedi_device * dev) static int icp_multi_detach(comedi_device *dev)
{ {
if (dev->private) if (dev->private)
......
...@@ -118,8 +118,8 @@ static const me4000_board_t me4000_boards[] = { ...@@ -118,8 +118,8 @@ static const me4000_board_t me4000_boards[] = {
/*----------------------------------------------------------------------------- /*-----------------------------------------------------------------------------
Comedi function prototypes Comedi function prototypes
---------------------------------------------------------------------------*/ ---------------------------------------------------------------------------*/
static int me4000_attach(comedi_device * dev, comedi_devconfig * it); static int me4000_attach(comedi_device *dev, comedi_devconfig *it);
static int me4000_detach(comedi_device * dev); static int me4000_detach(comedi_device *dev);
static comedi_driver driver_me4000 = { static comedi_driver driver_me4000 = {
driver_name:"me4000", driver_name:"me4000",
module:THIS_MODULE, module:THIS_MODULE,
...@@ -130,91 +130,91 @@ static comedi_driver driver_me4000 = { ...@@ -130,91 +130,91 @@ static comedi_driver driver_me4000 = {
/*----------------------------------------------------------------------------- /*-----------------------------------------------------------------------------
Meilhaus function prototypes Meilhaus function prototypes
---------------------------------------------------------------------------*/ ---------------------------------------------------------------------------*/
static int me4000_probe(comedi_device * dev, comedi_devconfig * it); static int me4000_probe(comedi_device *dev, comedi_devconfig *it);
static int get_registers(comedi_device * dev, struct pci_dev *pci_dev_p); static int get_registers(comedi_device *dev, struct pci_dev *pci_dev_p);
static int init_board_info(comedi_device * dev, struct pci_dev *pci_dev_p); static int init_board_info(comedi_device *dev, struct pci_dev *pci_dev_p);
static int init_ao_context(comedi_device * dev); static int init_ao_context(comedi_device *dev);
static int init_ai_context(comedi_device * dev); static int init_ai_context(comedi_device *dev);
static int init_dio_context(comedi_device * dev); static int init_dio_context(comedi_device *dev);
static int init_cnt_context(comedi_device * dev); static int init_cnt_context(comedi_device *dev);
static int xilinx_download(comedi_device * dev); static int xilinx_download(comedi_device *dev);
static int reset_board(comedi_device * dev); static int reset_board(comedi_device *dev);
static int me4000_dio_insn_bits(comedi_device * dev, static int me4000_dio_insn_bits(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data); comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
static int me4000_dio_insn_config(comedi_device * dev, static int me4000_dio_insn_config(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data); comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
static int cnt_reset(comedi_device * dev, unsigned int channel); static int cnt_reset(comedi_device *dev, unsigned int channel);
static int cnt_config(comedi_device * dev, static int cnt_config(comedi_device *dev,
unsigned int channel, unsigned int mode); unsigned int channel, unsigned int mode);
static int me4000_cnt_insn_config(comedi_device * dev, static int me4000_cnt_insn_config(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data); comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
static int me4000_cnt_insn_write(comedi_device * dev, static int me4000_cnt_insn_write(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data); comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
static int me4000_cnt_insn_read(comedi_device * dev, static int me4000_cnt_insn_read(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data); comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
static int me4000_ai_insn_read(comedi_device * dev, static int me4000_ai_insn_read(comedi_device *dev,
comedi_subdevice * subdevice, comedi_insn * insn, lsampl_t * data); comedi_subdevice *subdevice, comedi_insn *insn, lsampl_t *data);
static int me4000_ai_cancel(comedi_device * dev, comedi_subdevice * s); static int me4000_ai_cancel(comedi_device *dev, comedi_subdevice *s);
static int ai_check_chanlist(comedi_device * dev, static int ai_check_chanlist(comedi_device *dev,
comedi_subdevice * s, comedi_cmd * cmd); comedi_subdevice *s, comedi_cmd *cmd);
static int ai_round_cmd_args(comedi_device * dev, static int ai_round_cmd_args(comedi_device *dev,
comedi_subdevice * s, comedi_subdevice *s,
comedi_cmd * cmd, comedi_cmd *cmd,
unsigned int *init_ticks, unsigned int *init_ticks,
unsigned int *scan_ticks, unsigned int *chan_ticks); unsigned int *scan_ticks, unsigned int *chan_ticks);
static int ai_prepare(comedi_device * dev, static int ai_prepare(comedi_device *dev,
comedi_subdevice * s, comedi_subdevice *s,
comedi_cmd * cmd, comedi_cmd *cmd,
unsigned int init_ticks, unsigned int init_ticks,
unsigned int scan_ticks, unsigned int chan_ticks); unsigned int scan_ticks, unsigned int chan_ticks);
static int ai_write_chanlist(comedi_device * dev, static int ai_write_chanlist(comedi_device *dev,
comedi_subdevice * s, comedi_cmd * cmd); comedi_subdevice *s, comedi_cmd *cmd);
static irqreturn_t me4000_ai_isr(int irq, void *dev_id PT_REGS_ARG); static irqreturn_t me4000_ai_isr(int irq, void *dev_id PT_REGS_ARG);
static int me4000_ai_do_cmd_test(comedi_device * dev, static int me4000_ai_do_cmd_test(comedi_device *dev,
comedi_subdevice * s, comedi_cmd * cmd); comedi_subdevice *s, comedi_cmd *cmd);
static int me4000_ai_do_cmd(comedi_device * dev, comedi_subdevice * s); static int me4000_ai_do_cmd(comedi_device *dev, comedi_subdevice *s);
static int me4000_ao_insn_write(comedi_device * dev, static int me4000_ao_insn_write(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data); comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
static int me4000_ao_insn_read(comedi_device * dev, static int me4000_ao_insn_read(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data); comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
/*----------------------------------------------------------------------------- /*-----------------------------------------------------------------------------
Meilhaus inline functions Meilhaus inline functions
---------------------------------------------------------------------------*/ ---------------------------------------------------------------------------*/
static inline void me4000_outb(comedi_device * dev, unsigned char value, static inline void me4000_outb(comedi_device *dev, unsigned char value,
unsigned long port) unsigned long port)
{ {
PORT_PDEBUG("--> 0x%02X port 0x%04lX\n", value, port); PORT_PDEBUG("--> 0x%02X port 0x%04lX\n", value, port);
outb(value, port); outb(value, port);
} }
static inline void me4000_outl(comedi_device * dev, unsigned long value, static inline void me4000_outl(comedi_device *dev, unsigned long value,
unsigned long port) unsigned long port)
{ {
PORT_PDEBUG("--> 0x%08lX port 0x%04lX\n", value, port); PORT_PDEBUG("--> 0x%08lX port 0x%04lX\n", value, port);
outl(value, port); outl(value, port);
} }
static inline unsigned long me4000_inl(comedi_device * dev, unsigned long port) static inline unsigned long me4000_inl(comedi_device *dev, unsigned long port)
{ {
unsigned long value; unsigned long value;
value = inl(port); value = inl(port);
...@@ -222,7 +222,7 @@ static inline unsigned long me4000_inl(comedi_device * dev, unsigned long port) ...@@ -222,7 +222,7 @@ static inline unsigned long me4000_inl(comedi_device * dev, unsigned long port)
return value; return value;
} }
static inline unsigned char me4000_inb(comedi_device * dev, unsigned long port) static inline unsigned char me4000_inb(comedi_device *dev, unsigned long port)
{ {
unsigned char value; unsigned char value;
value = inb(port); value = inb(port);
...@@ -247,7 +247,7 @@ static const comedi_lrange me4000_ao_range = { ...@@ -247,7 +247,7 @@ static const comedi_lrange me4000_ao_range = {
} }
}; };
static int me4000_attach(comedi_device * dev, comedi_devconfig * it) static int me4000_attach(comedi_device *dev, comedi_devconfig *it)
{ {
comedi_subdevice *s; comedi_subdevice *s;
int result; int result;
...@@ -369,7 +369,7 @@ static int me4000_attach(comedi_device * dev, comedi_devconfig * it) ...@@ -369,7 +369,7 @@ static int me4000_attach(comedi_device * dev, comedi_devconfig * it)
return 0; return 0;
} }
static int me4000_probe(comedi_device * dev, comedi_devconfig * it) static int me4000_probe(comedi_device *dev, comedi_devconfig *it)
{ {
struct pci_dev *pci_device; struct pci_dev *pci_device;
int result, i; int result, i;
...@@ -512,7 +512,7 @@ static int me4000_probe(comedi_device * dev, comedi_devconfig * it) ...@@ -512,7 +512,7 @@ static int me4000_probe(comedi_device * dev, comedi_devconfig * it)
return 0; return 0;
} }
static int get_registers(comedi_device * dev, struct pci_dev *pci_dev_p) static int get_registers(comedi_device *dev, struct pci_dev *pci_dev_p)
{ {
CALL_PDEBUG("In get_registers()\n"); CALL_PDEBUG("In get_registers()\n");
...@@ -564,7 +564,7 @@ static int get_registers(comedi_device * dev, struct pci_dev *pci_dev_p) ...@@ -564,7 +564,7 @@ static int get_registers(comedi_device * dev, struct pci_dev *pci_dev_p)
return 0; return 0;
} }
static int init_board_info(comedi_device * dev, struct pci_dev *pci_dev_p) static int init_board_info(comedi_device *dev, struct pci_dev *pci_dev_p)
{ {
int result; int result;
...@@ -598,7 +598,7 @@ static int init_board_info(comedi_device * dev, struct pci_dev *pci_dev_p) ...@@ -598,7 +598,7 @@ static int init_board_info(comedi_device * dev, struct pci_dev *pci_dev_p)
return 0; return 0;
} }
static int init_ao_context(comedi_device * dev) static int init_ao_context(comedi_device *dev)
{ {
int i; int i;
...@@ -681,7 +681,7 @@ static int init_ao_context(comedi_device * dev) ...@@ -681,7 +681,7 @@ static int init_ao_context(comedi_device * dev)
return 0; return 0;
} }
static int init_ai_context(comedi_device * dev) static int init_ai_context(comedi_device *dev)
{ {
CALL_PDEBUG("In init_ai_context()\n"); CALL_PDEBUG("In init_ai_context()\n");
...@@ -715,7 +715,7 @@ static int init_ai_context(comedi_device * dev) ...@@ -715,7 +715,7 @@ static int init_ai_context(comedi_device * dev)
return 0; return 0;
} }
static int init_dio_context(comedi_device * dev) static int init_dio_context(comedi_device *dev)
{ {
CALL_PDEBUG("In init_dio_context()\n"); CALL_PDEBUG("In init_dio_context()\n");
...@@ -734,7 +734,7 @@ static int init_dio_context(comedi_device * dev) ...@@ -734,7 +734,7 @@ static int init_dio_context(comedi_device * dev)
return 0; return 0;
} }
static int init_cnt_context(comedi_device * dev) static int init_cnt_context(comedi_device *dev)
{ {
CALL_PDEBUG("In init_cnt_context()\n"); CALL_PDEBUG("In init_cnt_context()\n");
...@@ -755,7 +755,7 @@ static int init_cnt_context(comedi_device * dev) ...@@ -755,7 +755,7 @@ static int init_cnt_context(comedi_device * dev)
extern unsigned char *xilinx_firm; extern unsigned char *xilinx_firm;
#endif #endif
static int xilinx_download(comedi_device * dev) static int xilinx_download(comedi_device *dev)
{ {
u32 value = 0; u32 value = 0;
wait_queue_head_t queue; wait_queue_head_t queue;
...@@ -837,7 +837,7 @@ static int xilinx_download(comedi_device * dev) ...@@ -837,7 +837,7 @@ static int xilinx_download(comedi_device * dev)
return 0; return 0;
} }
static int reset_board(comedi_device * dev) static int reset_board(comedi_device *dev)
{ {
unsigned long icr; unsigned long icr;
...@@ -895,7 +895,7 @@ static int reset_board(comedi_device * dev) ...@@ -895,7 +895,7 @@ static int reset_board(comedi_device * dev)
return 0; return 0;
} }
static int me4000_detach(comedi_device * dev) static int me4000_detach(comedi_device *dev)
{ {
CALL_PDEBUG("In me4000_detach()\n"); CALL_PDEBUG("In me4000_detach()\n");
...@@ -916,8 +916,8 @@ static int me4000_detach(comedi_device * dev) ...@@ -916,8 +916,8 @@ static int me4000_detach(comedi_device * dev)
Analog input section Analog input section
===========================================================================*/ ===========================================================================*/
static int me4000_ai_insn_read(comedi_device * dev, static int me4000_ai_insn_read(comedi_device *dev,
comedi_subdevice * subdevice, comedi_insn * insn, lsampl_t * data) comedi_subdevice *subdevice, comedi_insn *insn, lsampl_t *data)
{ {
int chan = CR_CHAN(insn->chanspec); int chan = CR_CHAN(insn->chanspec);
...@@ -1040,7 +1040,7 @@ static int me4000_ai_insn_read(comedi_device * dev, ...@@ -1040,7 +1040,7 @@ static int me4000_ai_insn_read(comedi_device * dev,
return 1; return 1;
} }
static int me4000_ai_cancel(comedi_device * dev, comedi_subdevice * s) static int me4000_ai_cancel(comedi_device *dev, comedi_subdevice *s)
{ {
unsigned long tmp; unsigned long tmp;
...@@ -1057,8 +1057,8 @@ static int me4000_ai_cancel(comedi_device * dev, comedi_subdevice * s) ...@@ -1057,8 +1057,8 @@ static int me4000_ai_cancel(comedi_device * dev, comedi_subdevice * s)
return 0; return 0;
} }
static int ai_check_chanlist(comedi_device * dev, static int ai_check_chanlist(comedi_device *dev,
comedi_subdevice * s, comedi_cmd * cmd) comedi_subdevice *s, comedi_cmd *cmd)
{ {
int aref; int aref;
int i; int i;
...@@ -1138,9 +1138,9 @@ static int ai_check_chanlist(comedi_device * dev, ...@@ -1138,9 +1138,9 @@ static int ai_check_chanlist(comedi_device * dev,
return 0; return 0;
} }
static int ai_round_cmd_args(comedi_device * dev, static int ai_round_cmd_args(comedi_device *dev,
comedi_subdevice * s, comedi_subdevice *s,
comedi_cmd * cmd, comedi_cmd *cmd,
unsigned int *init_ticks, unsigned int *init_ticks,
unsigned int *scan_ticks, unsigned int *chan_ticks) unsigned int *scan_ticks, unsigned int *chan_ticks)
{ {
...@@ -1207,7 +1207,7 @@ static int ai_round_cmd_args(comedi_device * dev, ...@@ -1207,7 +1207,7 @@ static int ai_round_cmd_args(comedi_device * dev,
return 0; return 0;
} }
static void ai_write_timer(comedi_device * dev, static void ai_write_timer(comedi_device *dev,
unsigned int init_ticks, unsigned int init_ticks,
unsigned int scan_ticks, unsigned int chan_ticks) unsigned int scan_ticks, unsigned int chan_ticks)
{ {
...@@ -1228,9 +1228,9 @@ static void ai_write_timer(comedi_device * dev, ...@@ -1228,9 +1228,9 @@ static void ai_write_timer(comedi_device * dev,
me4000_outl(dev, chan_ticks - 1, info->ai_context.chan_timer_reg); me4000_outl(dev, chan_ticks - 1, info->ai_context.chan_timer_reg);
} }
static int ai_prepare(comedi_device * dev, static int ai_prepare(comedi_device *dev,
comedi_subdevice * s, comedi_subdevice *s,
comedi_cmd * cmd, comedi_cmd *cmd,
unsigned int init_ticks, unsigned int init_ticks,
unsigned int scan_ticks, unsigned int chan_ticks) unsigned int scan_ticks, unsigned int chan_ticks)
{ {
...@@ -1297,8 +1297,8 @@ static int ai_prepare(comedi_device * dev, ...@@ -1297,8 +1297,8 @@ static int ai_prepare(comedi_device * dev,
return 0; return 0;
} }
static int ai_write_chanlist(comedi_device * dev, static int ai_write_chanlist(comedi_device *dev,
comedi_subdevice * s, comedi_cmd * cmd) comedi_subdevice *s, comedi_cmd *cmd)
{ {
unsigned int entry; unsigned int entry;
unsigned int chan; unsigned int chan;
...@@ -1337,7 +1337,7 @@ static int ai_write_chanlist(comedi_device * dev, ...@@ -1337,7 +1337,7 @@ static int ai_write_chanlist(comedi_device * dev,
return 0; return 0;
} }
static int me4000_ai_do_cmd(comedi_device * dev, comedi_subdevice * s) static int me4000_ai_do_cmd(comedi_device *dev, comedi_subdevice *s)
{ {
int err; int err;
unsigned int init_ticks = 0; unsigned int init_ticks = 0;
...@@ -1381,8 +1381,8 @@ static int me4000_ai_do_cmd(comedi_device * dev, comedi_subdevice * s) ...@@ -1381,8 +1381,8 @@ static int me4000_ai_do_cmd(comedi_device * dev, comedi_subdevice * s)
* - invalid chanlist * - invalid chanlist
* So I tried to adopt this scheme. * So I tried to adopt this scheme.
*/ */
static int me4000_ai_do_cmd_test(comedi_device * dev, static int me4000_ai_do_cmd_test(comedi_device *dev,
comedi_subdevice * s, comedi_cmd * cmd) comedi_subdevice *s, comedi_cmd *cmd)
{ {
unsigned int init_ticks; unsigned int init_ticks;
...@@ -1911,8 +1911,8 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id PT_REGS_ARG) ...@@ -1911,8 +1911,8 @@ static irqreturn_t me4000_ai_isr(int irq, void *dev_id PT_REGS_ARG)
Analog output section Analog output section
===========================================================================*/ ===========================================================================*/
static int me4000_ao_insn_write(comedi_device * dev, static int me4000_ao_insn_write(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data) comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{ {
int chan = CR_CHAN(insn->chanspec); int chan = CR_CHAN(insn->chanspec);
...@@ -1969,8 +1969,8 @@ static int me4000_ao_insn_write(comedi_device * dev, ...@@ -1969,8 +1969,8 @@ static int me4000_ao_insn_write(comedi_device * dev,
return 1; return 1;
} }
static int me4000_ao_insn_read(comedi_device * dev, static int me4000_ao_insn_read(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data) comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{ {
int chan = CR_CHAN(insn->chanspec); int chan = CR_CHAN(insn->chanspec);
...@@ -1990,8 +1990,8 @@ static int me4000_ao_insn_read(comedi_device * dev, ...@@ -1990,8 +1990,8 @@ static int me4000_ao_insn_read(comedi_device * dev,
Digital I/O section Digital I/O section
===========================================================================*/ ===========================================================================*/
static int me4000_dio_insn_bits(comedi_device * dev, static int me4000_dio_insn_bits(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data) comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{ {
CALL_PDEBUG("In me4000_dio_insn_bits()\n"); CALL_PDEBUG("In me4000_dio_insn_bits()\n");
...@@ -2041,8 +2041,8 @@ static int me4000_dio_insn_bits(comedi_device * dev, ...@@ -2041,8 +2041,8 @@ static int me4000_dio_insn_bits(comedi_device * dev,
return 2; return 2;
} }
static int me4000_dio_insn_config(comedi_device * dev, static int me4000_dio_insn_config(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data) comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{ {
unsigned long tmp; unsigned long tmp;
int chan = CR_CHAN(insn->chanspec); int chan = CR_CHAN(insn->chanspec);
...@@ -2135,7 +2135,7 @@ static int me4000_dio_insn_config(comedi_device * dev, ...@@ -2135,7 +2135,7 @@ static int me4000_dio_insn_config(comedi_device * dev,
Counter section Counter section
===========================================================================*/ ===========================================================================*/
static int cnt_reset(comedi_device * dev, unsigned int channel) static int cnt_reset(comedi_device *dev, unsigned int channel)
{ {
CALL_PDEBUG("In cnt_reset()\n"); CALL_PDEBUG("In cnt_reset()\n");
...@@ -2166,7 +2166,7 @@ static int cnt_reset(comedi_device * dev, unsigned int channel) ...@@ -2166,7 +2166,7 @@ static int cnt_reset(comedi_device * dev, unsigned int channel)
return 0; return 0;
} }
static int cnt_config(comedi_device * dev, unsigned int channel, static int cnt_config(comedi_device *dev, unsigned int channel,
unsigned int mode) unsigned int mode)
{ {
int tmp = 0; int tmp = 0;
...@@ -2223,8 +2223,8 @@ static int cnt_config(comedi_device * dev, unsigned int channel, ...@@ -2223,8 +2223,8 @@ static int cnt_config(comedi_device * dev, unsigned int channel,
return 0; return 0;
} }
static int me4000_cnt_insn_config(comedi_device * dev, static int me4000_cnt_insn_config(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data) comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{ {
int err; int err;
...@@ -2266,8 +2266,8 @@ static int me4000_cnt_insn_config(comedi_device * dev, ...@@ -2266,8 +2266,8 @@ static int me4000_cnt_insn_config(comedi_device * dev,
return 2; return 2;
} }
static int me4000_cnt_insn_read(comedi_device * dev, static int me4000_cnt_insn_read(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data) comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{ {
unsigned short tmp; unsigned short tmp;
...@@ -2313,8 +2313,8 @@ static int me4000_cnt_insn_read(comedi_device * dev, ...@@ -2313,8 +2313,8 @@ static int me4000_cnt_insn_read(comedi_device * dev,
return 1; return 1;
} }
static int me4000_cnt_insn_write(comedi_device * dev, static int me4000_cnt_insn_write(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data) comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{ {
unsigned short tmp; unsigned short tmp;
......
...@@ -103,7 +103,7 @@ static void dump_chip_signature(u32 csigr_bits) ...@@ -103,7 +103,7 @@ static void dump_chip_signature(u32 csigr_bits)
printk("mite: num channels = %i, write post fifo depth = %i, wins = %i, iowins = %i\n", mite_csigr_dmac(csigr_bits), mite_csigr_wpdep(csigr_bits), mite_csigr_wins(csigr_bits), mite_csigr_iowins(csigr_bits)); printk("mite: num channels = %i, write post fifo depth = %i, wins = %i, iowins = %i\n", mite_csigr_dmac(csigr_bits), mite_csigr_wpdep(csigr_bits), mite_csigr_wins(csigr_bits), mite_csigr_iowins(csigr_bits));
} }
unsigned mite_fifo_size(struct mite_struct * mite, unsigned channel) unsigned mite_fifo_size(struct mite_struct *mite, unsigned channel)
{ {
unsigned fcr_bits = readl(mite->mite_io_addr + unsigned fcr_bits = readl(mite->mite_io_addr +
MITE_FCR(channel)); MITE_FCR(channel));
...@@ -459,7 +459,7 @@ u32 mite_device_bytes_transferred(struct mite_channel *mite_chan) ...@@ -459,7 +459,7 @@ u32 mite_device_bytes_transferred(struct mite_channel *mite_chan)
return readl(mite->mite_io_addr + MITE_DAR(mite_chan->channel)); return readl(mite->mite_io_addr + MITE_DAR(mite_chan->channel));
} }
u32 mite_bytes_in_transit(struct mite_channel * mite_chan) u32 mite_bytes_in_transit(struct mite_channel *mite_chan)
{ {
struct mite_struct *mite = mite_chan->mite; struct mite_struct *mite = mite_chan->mite;
return readl(mite->mite_io_addr + return readl(mite->mite_io_addr +
...@@ -467,7 +467,7 @@ u32 mite_bytes_in_transit(struct mite_channel * mite_chan) ...@@ -467,7 +467,7 @@ u32 mite_bytes_in_transit(struct mite_channel * mite_chan)
} }
/* returns lower bound for number of bytes transferred from device to memory */ /* returns lower bound for number of bytes transferred from device to memory */
u32 mite_bytes_written_to_memory_lb(struct mite_channel * mite_chan) u32 mite_bytes_written_to_memory_lb(struct mite_channel *mite_chan)
{ {
u32 device_byte_count; u32 device_byte_count;
...@@ -476,7 +476,7 @@ u32 mite_bytes_written_to_memory_lb(struct mite_channel * mite_chan) ...@@ -476,7 +476,7 @@ u32 mite_bytes_written_to_memory_lb(struct mite_channel * mite_chan)
} }
/* returns upper bound for number of bytes transferred from device to memory */ /* returns upper bound for number of bytes transferred from device to memory */
u32 mite_bytes_written_to_memory_ub(struct mite_channel * mite_chan) u32 mite_bytes_written_to_memory_ub(struct mite_channel *mite_chan)
{ {
u32 in_transit_count; u32 in_transit_count;
...@@ -485,7 +485,7 @@ u32 mite_bytes_written_to_memory_ub(struct mite_channel * mite_chan) ...@@ -485,7 +485,7 @@ u32 mite_bytes_written_to_memory_ub(struct mite_channel * mite_chan)
} }
/* returns lower bound for number of bytes read from memory for transfer to device */ /* returns lower bound for number of bytes read from memory for transfer to device */
u32 mite_bytes_read_from_memory_lb(struct mite_channel * mite_chan) u32 mite_bytes_read_from_memory_lb(struct mite_channel *mite_chan)
{ {
u32 device_byte_count; u32 device_byte_count;
...@@ -494,7 +494,7 @@ u32 mite_bytes_read_from_memory_lb(struct mite_channel * mite_chan) ...@@ -494,7 +494,7 @@ u32 mite_bytes_read_from_memory_lb(struct mite_channel * mite_chan)
} }
/* returns upper bound for number of bytes read from memory for transfer to device */ /* returns upper bound for number of bytes read from memory for transfer to device */
u32 mite_bytes_read_from_memory_ub(struct mite_channel * mite_chan) u32 mite_bytes_read_from_memory_ub(struct mite_channel *mite_chan)
{ {
u32 in_transit_count; u32 in_transit_count;
......
...@@ -162,7 +162,7 @@ void mite_setregs(struct mite_struct *mite, unsigned long ll_start, int chan, ...@@ -162,7 +162,7 @@ void mite_setregs(struct mite_struct *mite, unsigned long ll_start, int chan,
void mite_prep_dma(struct mite_channel *mite_chan, void mite_prep_dma(struct mite_channel *mite_chan,
unsigned int num_device_bits, unsigned int num_memory_bits); unsigned int num_device_bits, unsigned int num_memory_bits);
int mite_buf_change(struct mite_dma_descriptor_ring *ring, int mite_buf_change(struct mite_dma_descriptor_ring *ring,
comedi_async * async); comedi_async *async);
#ifdef DEBUG_MITE #ifdef DEBUG_MITE
void mite_print_chsr(unsigned int chsr); void mite_print_chsr(unsigned int chsr);
......
...@@ -680,8 +680,8 @@ typedef struct { ...@@ -680,8 +680,8 @@ typedef struct {
* the board, and also about the kernel module that contains * the board, and also about the kernel module that contains
* the device code. * the device code.
*/ */
static int rtd_attach(comedi_device * dev, comedi_devconfig * it); static int rtd_attach(comedi_device *dev, comedi_devconfig *it);
static int rtd_detach(comedi_device * dev); static int rtd_detach(comedi_device *dev);
static comedi_driver rtd520Driver = { static comedi_driver rtd520Driver = {
driver_name: DRV_NAME, driver_name: DRV_NAME,
...@@ -690,20 +690,20 @@ static comedi_driver rtd520Driver = { ...@@ -690,20 +690,20 @@ static comedi_driver rtd520Driver = {
detach:rtd_detach, detach:rtd_detach,
}; };
static int rtd_ai_rinsn(comedi_device * dev, comedi_subdevice * s, static int rtd_ai_rinsn(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data); comedi_insn *insn, lsampl_t *data);
static int rtd_ao_winsn(comedi_device * dev, comedi_subdevice * s, static int rtd_ao_winsn(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data); comedi_insn *insn, lsampl_t *data);
static int rtd_ao_rinsn(comedi_device * dev, comedi_subdevice * s, static int rtd_ao_rinsn(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data); comedi_insn *insn, lsampl_t *data);
static int rtd_dio_insn_bits(comedi_device * dev, comedi_subdevice * s, static int rtd_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data); comedi_insn *insn, lsampl_t *data);
static int rtd_dio_insn_config(comedi_device * dev, comedi_subdevice * s, static int rtd_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data); comedi_insn *insn, lsampl_t *data);
static int rtd_ai_cmdtest(comedi_device * dev, comedi_subdevice * s, static int rtd_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
comedi_cmd * cmd); comedi_cmd *cmd);
static int rtd_ai_cmd(comedi_device * dev, comedi_subdevice * s); static int rtd_ai_cmd(comedi_device *dev, comedi_subdevice *s);
static int rtd_ai_cancel(comedi_device * dev, comedi_subdevice * s); static int rtd_ai_cancel(comedi_device *dev, comedi_subdevice *s);
/* static int rtd_ai_poll (comedi_device *dev,comedi_subdevice *s); */ /* static int rtd_ai_poll (comedi_device *dev,comedi_subdevice *s); */
static int rtd_ns_to_timer(unsigned int *ns, int roundMode); static int rtd_ns_to_timer(unsigned int *ns, int roundMode);
static irqreturn_t rtd_interrupt(int irq, void *d PT_REGS_ARG); static irqreturn_t rtd_interrupt(int irq, void *d PT_REGS_ARG);
...@@ -715,7 +715,7 @@ static int rtd520_probe_fifo_depth(comedi_device *dev); ...@@ -715,7 +715,7 @@ static int rtd520_probe_fifo_depth(comedi_device *dev);
* in the driver structure, dev->board_ptr contains that * in the driver structure, dev->board_ptr contains that
* address. * address.
*/ */
static int rtd_attach(comedi_device * dev, comedi_devconfig * it) static int rtd_attach(comedi_device *dev, comedi_devconfig *it)
{ /* board name and options flags */ { /* board name and options flags */
comedi_subdevice *s; comedi_subdevice *s;
struct pci_dev *pcidev; struct pci_dev *pcidev;
...@@ -1057,7 +1057,7 @@ static int rtd_attach(comedi_device * dev, comedi_devconfig * it) ...@@ -1057,7 +1057,7 @@ static int rtd_attach(comedi_device * dev, comedi_devconfig * it)
* allocated by _attach(). dev->private and dev->subdevices are * allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core. * deallocated automatically by the core.
*/ */
static int rtd_detach(comedi_device * dev) static int rtd_detach(comedi_device *dev)
{ {
#ifdef USE_DMA #ifdef USE_DMA
int index; int index;
...@@ -1137,7 +1137,7 @@ static int rtd_detach(comedi_device * dev) ...@@ -1137,7 +1137,7 @@ static int rtd_detach(comedi_device * dev)
/* /*
Convert a single comedi channel-gain entry to a RTD520 table entry Convert a single comedi channel-gain entry to a RTD520 table entry
*/ */
static unsigned short rtdConvertChanGain(comedi_device * dev, static unsigned short rtdConvertChanGain(comedi_device *dev,
unsigned int comediChan, int chanIndex) unsigned int comediChan, int chanIndex)
{ /* index in channel list */ { /* index in channel list */
unsigned int chan, range, aref; unsigned int chan, range, aref;
...@@ -1187,7 +1187,7 @@ static unsigned short rtdConvertChanGain(comedi_device * dev, ...@@ -1187,7 +1187,7 @@ static unsigned short rtdConvertChanGain(comedi_device * dev,
/* /*
Setup the channel-gain table from a comedi list Setup the channel-gain table from a comedi list
*/ */
static void rtd_load_channelgain_list(comedi_device * dev, static void rtd_load_channelgain_list(comedi_device *dev,
unsigned int n_chan, unsigned int *list) unsigned int n_chan, unsigned int *list)
{ {
if (n_chan > 1) { /* setup channel gain table */ if (n_chan > 1) { /* setup channel gain table */
...@@ -1251,8 +1251,8 @@ static int rtd520_probe_fifo_depth(comedi_device *dev) ...@@ -1251,8 +1251,8 @@ static int rtd520_probe_fifo_depth(comedi_device *dev)
Note, we don't do any settling delays. Use a instruction list to Note, we don't do any settling delays. Use a instruction list to
select, delay, then read. select, delay, then read.
*/ */
static int rtd_ai_rinsn(comedi_device * dev, static int rtd_ai_rinsn(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data) comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{ {
int n, ii; int n, ii;
int stat; int stat;
...@@ -1304,7 +1304,7 @@ static int rtd_ai_rinsn(comedi_device * dev, ...@@ -1304,7 +1304,7 @@ static int rtd_ai_rinsn(comedi_device * dev,
The manual claims that we can do a lword read, but it doesn't work here. The manual claims that we can do a lword read, but it doesn't work here.
*/ */
static int ai_read_n(comedi_device * dev, comedi_subdevice * s, int count) static int ai_read_n(comedi_device *dev, comedi_subdevice *s, int count)
{ {
int ii; int ii;
...@@ -1343,7 +1343,7 @@ static int ai_read_n(comedi_device * dev, comedi_subdevice * s, int count) ...@@ -1343,7 +1343,7 @@ static int ai_read_n(comedi_device * dev, comedi_subdevice * s, int count)
/* /*
unknown amout of data is waiting in fifo. unknown amout of data is waiting in fifo.
*/ */
static int ai_read_dregs(comedi_device * dev, comedi_subdevice * s) static int ai_read_dregs(comedi_device *dev, comedi_subdevice *s)
{ {
while (RtdFifoStatus(dev) & FS_ADC_NOT_EMPTY) { /* 1 -> not empty */ while (RtdFifoStatus(dev) & FS_ADC_NOT_EMPTY) { /* 1 -> not empty */
sampl_t sample; sampl_t sample;
...@@ -1372,7 +1372,7 @@ static int ai_read_dregs(comedi_device * dev, comedi_subdevice * s) ...@@ -1372,7 +1372,7 @@ static int ai_read_dregs(comedi_device * dev, comedi_subdevice * s)
/* /*
Terminate a DMA transfer and wait for everything to quiet down Terminate a DMA transfer and wait for everything to quiet down
*/ */
void abort_dma(comedi_device * dev, unsigned int channel) void abort_dma(comedi_device *dev, unsigned int channel)
{ /* DMA channel 0, 1 */ { /* DMA channel 0, 1 */
unsigned long dma_cs_addr; /* the control/status register */ unsigned long dma_cs_addr; /* the control/status register */
uint8_t status; uint8_t status;
...@@ -1431,7 +1431,7 @@ void abort_dma(comedi_device * dev, unsigned int channel) ...@@ -1431,7 +1431,7 @@ void abort_dma(comedi_device * dev, unsigned int channel)
Process what is in the DMA transfer buffer and pass to comedi Process what is in the DMA transfer buffer and pass to comedi
Note: this is not re-entrant Note: this is not re-entrant
*/ */
static int ai_process_dma(comedi_device * dev, comedi_subdevice * s) static int ai_process_dma(comedi_device *dev, comedi_subdevice *s)
{ {
int ii, n; int ii, n;
s16 *dp; s16 *dp;
...@@ -1645,7 +1645,7 @@ static irqreturn_t rtd_interrupt(int irq, /* interrupt number (ignored) */ ...@@ -1645,7 +1645,7 @@ static irqreturn_t rtd_interrupt(int irq, /* interrupt number (ignored) */
/* /*
return the number of samples available return the number of samples available
*/ */
static int rtd_ai_poll(comedi_device * dev, comedi_subdevice * s) static int rtd_ai_poll(comedi_device *dev, comedi_subdevice *s)
{ {
/* TODO: This needs to mask interrupts, read_dregs, and then re-enable */ /* TODO: This needs to mask interrupts, read_dregs, and then re-enable */
/* Not sure what to do if DMA is active */ /* Not sure what to do if DMA is active */
...@@ -1662,8 +1662,8 @@ static int rtd_ai_poll(comedi_device * dev, comedi_subdevice * s) ...@@ -1662,8 +1662,8 @@ static int rtd_ai_poll(comedi_device * dev, comedi_subdevice * s)
the command passes. the command passes.
*/ */
static int rtd_ai_cmdtest(comedi_device * dev, static int rtd_ai_cmdtest(comedi_device *dev,
comedi_subdevice * s, comedi_cmd * cmd) comedi_subdevice *s, comedi_cmd *cmd)
{ {
int err = 0; int err = 0;
int tmp; int tmp;
...@@ -1867,7 +1867,7 @@ static int rtd_ai_cmdtest(comedi_device * dev, ...@@ -1867,7 +1867,7 @@ static int rtd_ai_cmdtest(comedi_device * dev,
This is usually done by an interrupt handler. This is usually done by an interrupt handler.
Userland gets to the data using read calls. Userland gets to the data using read calls.
*/ */
static int rtd_ai_cmd(comedi_device * dev, comedi_subdevice * s) static int rtd_ai_cmd(comedi_device *dev, comedi_subdevice *s)
{ {
comedi_cmd *cmd = &s->async->cmd; comedi_cmd *cmd = &s->async->cmd;
int timer; int timer;
...@@ -2064,7 +2064,7 @@ static int rtd_ai_cmd(comedi_device * dev, comedi_subdevice * s) ...@@ -2064,7 +2064,7 @@ static int rtd_ai_cmd(comedi_device * dev, comedi_subdevice * s)
/* /*
Stop a running data aquisition. Stop a running data aquisition.
*/ */
static int rtd_ai_cancel(comedi_device * dev, comedi_subdevice * s) static int rtd_ai_cancel(comedi_device *dev, comedi_subdevice *s)
{ {
u16 status; u16 status;
...@@ -2132,8 +2132,8 @@ static int rtd_ns_to_timer(unsigned int *ns, int round_mode) ...@@ -2132,8 +2132,8 @@ static int rtd_ns_to_timer(unsigned int *ns, int round_mode)
/* /*
Output one (or more) analog values to a single port as fast as possible. Output one (or more) analog values to a single port as fast as possible.
*/ */
static int rtd_ao_winsn(comedi_device * dev, static int rtd_ao_winsn(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data) comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{ {
int i; int i;
int chan = CR_CHAN(insn->chanspec); int chan = CR_CHAN(insn->chanspec);
...@@ -2187,8 +2187,8 @@ static int rtd_ao_winsn(comedi_device * dev, ...@@ -2187,8 +2187,8 @@ static int rtd_ao_winsn(comedi_device * dev,
/* AO subdevices should have a read insn as well as a write insn. /* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */ * Usually this means copying a value stored in devpriv. */
static int rtd_ao_rinsn(comedi_device * dev, static int rtd_ao_rinsn(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data) comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{ {
int i; int i;
int chan = CR_CHAN(insn->chanspec); int chan = CR_CHAN(insn->chanspec);
...@@ -2210,8 +2210,8 @@ static int rtd_ao_rinsn(comedi_device * dev, ...@@ -2210,8 +2210,8 @@ static int rtd_ao_rinsn(comedi_device * dev,
* This allows packed reading/writing of the DIO channels. The * This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write * comedi core can convert between insn_bits and insn_read/write
*/ */
static int rtd_dio_insn_bits(comedi_device * dev, static int rtd_dio_insn_bits(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data) comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{ {
if (insn->n != 2) if (insn->n != 2)
return -EINVAL; return -EINVAL;
...@@ -2237,8 +2237,8 @@ static int rtd_dio_insn_bits(comedi_device * dev, ...@@ -2237,8 +2237,8 @@ static int rtd_dio_insn_bits(comedi_device * dev,
/* /*
Configure one bit on a IO port as Input or Output (hence the name :-). Configure one bit on a IO port as Input or Output (hence the name :-).
*/ */
static int rtd_dio_insn_config(comedi_device * dev, static int rtd_dio_insn_config(comedi_device *dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data) comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{ {
int chan = CR_CHAN(insn->chanspec); int chan = CR_CHAN(insn->chanspec);
......
...@@ -118,8 +118,8 @@ static DEFINE_PCI_DEVICE_TABLE(s626_pci_table) = { ...@@ -118,8 +118,8 @@ static DEFINE_PCI_DEVICE_TABLE(s626_pci_table) = {
MODULE_DEVICE_TABLE(pci, s626_pci_table); MODULE_DEVICE_TABLE(pci, s626_pci_table);
static int s626_attach(comedi_device * dev, comedi_devconfig * it); static int s626_attach(comedi_device *dev, comedi_devconfig *it);
static int s626_detach(comedi_device * dev); static int s626_detach(comedi_device *dev);
static comedi_driver driver_s626 = { static comedi_driver driver_s626 = {
driver_name:"s626", driver_name:"s626",
...@@ -222,36 +222,36 @@ static dio_private *dio_private_word[]={ ...@@ -222,36 +222,36 @@ static dio_private *dio_private_word[]={
COMEDI_PCI_INITCLEANUP_NOMODULE(driver_s626, s626_pci_table); COMEDI_PCI_INITCLEANUP_NOMODULE(driver_s626, s626_pci_table);
/* ioctl routines */ /* ioctl routines */
static int s626_ai_insn_config(comedi_device * dev, comedi_subdevice * s, static int s626_ai_insn_config(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data); comedi_insn *insn, lsampl_t *data);
/* static int s626_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,lsampl_t *data); */ /* static int s626_ai_rinsn(comedi_device *dev,comedi_subdevice *s,comedi_insn *insn,lsampl_t *data); */
static int s626_ai_insn_read(comedi_device * dev, comedi_subdevice * s, static int s626_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data); comedi_insn *insn, lsampl_t *data);
static int s626_ai_cmd(comedi_device * dev, comedi_subdevice * s); static int s626_ai_cmd(comedi_device *dev, comedi_subdevice *s);
static int s626_ai_cmdtest(comedi_device * dev, comedi_subdevice * s, static int s626_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
comedi_cmd * cmd); comedi_cmd *cmd);
static int s626_ai_cancel(comedi_device * dev, comedi_subdevice * s); static int s626_ai_cancel(comedi_device *dev, comedi_subdevice *s);
static int s626_ao_winsn(comedi_device * dev, comedi_subdevice * s, static int s626_ao_winsn(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data); comedi_insn *insn, lsampl_t *data);
static int s626_ao_rinsn(comedi_device * dev, comedi_subdevice * s, static int s626_ao_rinsn(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data); comedi_insn *insn, lsampl_t *data);
static int s626_dio_insn_bits(comedi_device * dev, comedi_subdevice * s, static int s626_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data); comedi_insn *insn, lsampl_t *data);
static int s626_dio_insn_config(comedi_device * dev, comedi_subdevice * s, static int s626_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data); comedi_insn *insn, lsampl_t *data);
static int s626_dio_set_irq(comedi_device * dev, unsigned int chan); static int s626_dio_set_irq(comedi_device *dev, unsigned int chan);
static int s626_dio_reset_irq(comedi_device * dev, unsigned int gruop, static int s626_dio_reset_irq(comedi_device *dev, unsigned int gruop,
unsigned int mask); unsigned int mask);
static int s626_dio_clear_irq(comedi_device * dev); static int s626_dio_clear_irq(comedi_device *dev);
static int s626_enc_insn_config(comedi_device * dev, comedi_subdevice * s, static int s626_enc_insn_config(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data); comedi_insn *insn, lsampl_t *data);
static int s626_enc_insn_read(comedi_device * dev, comedi_subdevice * s, static int s626_enc_insn_read(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data); comedi_insn *insn, lsampl_t *data);
static int s626_enc_insn_write(comedi_device * dev, comedi_subdevice * s, static int s626_enc_insn_write(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data); comedi_insn *insn, lsampl_t *data);
static int s626_ns_to_timer(int *nanosec, int round_mode); static int s626_ns_to_timer(int *nanosec, int round_mode);
static int s626_ai_load_polllist(uint8_t * ppl, comedi_cmd * cmd); static int s626_ai_load_polllist(uint8_t *ppl, comedi_cmd *cmd);
static int s626_ai_inttrig(comedi_device * dev, comedi_subdevice * s, static int s626_ai_inttrig(comedi_device *dev, comedi_subdevice *s,
unsigned int trignum); unsigned int trignum);
static irqreturn_t s626_irq_handler(int irq, void *d PT_REGS_ARG); static irqreturn_t s626_irq_handler(int irq, void *d PT_REGS_ARG);
static lsampl_t s626_ai_reg_to_uint(int data); static lsampl_t s626_ai_reg_to_uint(int data);
...@@ -260,36 +260,36 @@ static lsampl_t s626_ai_reg_to_uint(int data); ...@@ -260,36 +260,36 @@ static lsampl_t s626_ai_reg_to_uint(int data);
/* end ioctl routines */ /* end ioctl routines */
/* internal routines */ /* internal routines */
static void s626_dio_init(comedi_device * dev); static void s626_dio_init(comedi_device *dev);
static void ResetADC(comedi_device * dev, uint8_t * ppl); static void ResetADC(comedi_device *dev, uint8_t *ppl);
static void LoadTrimDACs(comedi_device * dev); static void LoadTrimDACs(comedi_device *dev);
static void WriteTrimDAC(comedi_device * dev, uint8_t LogicalChan, static void WriteTrimDAC(comedi_device *dev, uint8_t LogicalChan,
uint8_t DacData); uint8_t DacData);
static uint8_t I2Cread(comedi_device * dev, uint8_t addr); static uint8_t I2Cread(comedi_device *dev, uint8_t addr);
static uint32_t I2Chandshake(comedi_device * dev, uint32_t val); static uint32_t I2Chandshake(comedi_device *dev, uint32_t val);
static void SetDAC(comedi_device * dev, uint16_t chan, short dacdata); static void SetDAC(comedi_device *dev, uint16_t chan, short dacdata);
static void SendDAC(comedi_device * dev, uint32_t val); static void SendDAC(comedi_device *dev, uint32_t val);
static void WriteMISC2(comedi_device * dev, uint16_t NewImage); static void WriteMISC2(comedi_device *dev, uint16_t NewImage);
static void DEBItransfer(comedi_device * dev); static void DEBItransfer(comedi_device *dev);
static uint16_t DEBIread(comedi_device * dev, uint16_t addr); static uint16_t DEBIread(comedi_device *dev, uint16_t addr);
static void DEBIwrite(comedi_device * dev, uint16_t addr, uint16_t wdata); static void DEBIwrite(comedi_device *dev, uint16_t addr, uint16_t wdata);
static void DEBIreplace(comedi_device * dev, uint16_t addr, uint16_t mask, static void DEBIreplace(comedi_device *dev, uint16_t addr, uint16_t mask,
uint16_t wdata); uint16_t wdata);
static void CloseDMAB(comedi_device * dev, DMABUF * pdma, size_t bsize); static void CloseDMAB(comedi_device *dev, DMABUF *pdma, size_t bsize);
/* COUNTER OBJECT ------------------------------------------------ */ /* COUNTER OBJECT ------------------------------------------------ */
typedef struct enc_private_struct { typedef struct enc_private_struct {
/* Pointers to functions that differ for A and B counters: */ /* Pointers to functions that differ for A and B counters: */
uint16_t(*GetEnable) (comedi_device * dev, struct enc_private_struct *); /* Return clock enable. */ uint16_t(*GetEnable) (comedi_device *dev, struct enc_private_struct *); /* Return clock enable. */
uint16_t(*GetIntSrc) (comedi_device * dev, struct enc_private_struct *); /* Return interrupt source. */ uint16_t(*GetIntSrc) (comedi_device *dev, struct enc_private_struct *); /* Return interrupt source. */
uint16_t(*GetLoadTrig) (comedi_device * dev, struct enc_private_struct *); /* Return preload trigger source. */ uint16_t(*GetLoadTrig) (comedi_device *dev, struct enc_private_struct *); /* Return preload trigger source. */
uint16_t(*GetMode) (comedi_device * dev, struct enc_private_struct *); /* Return standardized operating mode. */ uint16_t(*GetMode) (comedi_device *dev, struct enc_private_struct *); /* Return standardized operating mode. */
void (*PulseIndex) (comedi_device * dev, struct enc_private_struct *); /* Generate soft index strobe. */ void (*PulseIndex) (comedi_device *dev, struct enc_private_struct *); /* Generate soft index strobe. */
void (*SetEnable) (comedi_device * dev, struct enc_private_struct *, uint16_t enab); /* Program clock enable. */ void (*SetEnable) (comedi_device *dev, struct enc_private_struct *, uint16_t enab); /* Program clock enable. */
void (*SetIntSrc) (comedi_device * dev, struct enc_private_struct *, uint16_t IntSource); /* Program interrupt source. */ void (*SetIntSrc) (comedi_device *dev, struct enc_private_struct *, uint16_t IntSource); /* Program interrupt source. */
void (*SetLoadTrig) (comedi_device * dev, struct enc_private_struct *, uint16_t Trig); /* Program preload trigger source. */ void (*SetLoadTrig) (comedi_device *dev, struct enc_private_struct *, uint16_t Trig); /* Program preload trigger source. */
void (*SetMode) (comedi_device * dev, struct enc_private_struct *, uint16_t Setup, uint16_t DisableIntSrc); /* Program standardized operating mode. */ void (*SetMode) (comedi_device *dev, struct enc_private_struct *, uint16_t Setup, uint16_t DisableIntSrc); /* Program standardized operating mode. */
void (*ResetCapFlags) (comedi_device * dev, struct enc_private_struct *); /* Reset event capture flags. */ void (*ResetCapFlags) (comedi_device *dev, struct enc_private_struct *); /* Reset event capture flags. */
uint16_t MyCRA; /* Address of CRA register. */ uint16_t MyCRA; /* Address of CRA register. */
uint16_t MyCRB; /* Address of CRB register. */ uint16_t MyCRB; /* Address of CRB register. */
...@@ -301,33 +301,33 @@ typedef struct enc_private_struct { ...@@ -301,33 +301,33 @@ typedef struct enc_private_struct {
#define encpriv ((enc_private *)(dev->subdevices+5)->private) #define encpriv ((enc_private *)(dev->subdevices+5)->private)
/* counters routines */ /* counters routines */
static void s626_timer_load(comedi_device * dev, enc_private * k, int tick); static void s626_timer_load(comedi_device *dev, enc_private *k, int tick);
static uint32_t ReadLatch(comedi_device * dev, enc_private * k); static uint32_t ReadLatch(comedi_device *dev, enc_private *k);
static void ResetCapFlags_A(comedi_device * dev, enc_private * k); static void ResetCapFlags_A(comedi_device *dev, enc_private *k);
static void ResetCapFlags_B(comedi_device * dev, enc_private * k); static void ResetCapFlags_B(comedi_device *dev, enc_private *k);
static uint16_t GetMode_A(comedi_device * dev, enc_private * k); static uint16_t GetMode_A(comedi_device *dev, enc_private *k);
static uint16_t GetMode_B(comedi_device * dev, enc_private * k); static uint16_t GetMode_B(comedi_device *dev, enc_private *k);
static void SetMode_A(comedi_device * dev, enc_private * k, uint16_t Setup, static void SetMode_A(comedi_device *dev, enc_private *k, uint16_t Setup,
uint16_t DisableIntSrc); uint16_t DisableIntSrc);
static void SetMode_B(comedi_device * dev, enc_private * k, uint16_t Setup, static void SetMode_B(comedi_device *dev, enc_private *k, uint16_t Setup,
uint16_t DisableIntSrc); uint16_t DisableIntSrc);
static void SetEnable_A(comedi_device * dev, enc_private * k, uint16_t enab); static void SetEnable_A(comedi_device *dev, enc_private *k, uint16_t enab);
static void SetEnable_B(comedi_device * dev, enc_private * k, uint16_t enab); static void SetEnable_B(comedi_device *dev, enc_private *k, uint16_t enab);
static uint16_t GetEnable_A(comedi_device * dev, enc_private * k); static uint16_t GetEnable_A(comedi_device *dev, enc_private *k);
static uint16_t GetEnable_B(comedi_device * dev, enc_private * k); static uint16_t GetEnable_B(comedi_device *dev, enc_private *k);
static void SetLatchSource(comedi_device * dev, enc_private * k, static void SetLatchSource(comedi_device *dev, enc_private *k,
uint16_t value); uint16_t value);
/* static uint16_t GetLatchSource(comedi_device *dev, enc_private *k ); */ /* static uint16_t GetLatchSource(comedi_device *dev, enc_private *k ); */
static void SetLoadTrig_A(comedi_device * dev, enc_private * k, uint16_t Trig); static void SetLoadTrig_A(comedi_device *dev, enc_private *k, uint16_t Trig);
static void SetLoadTrig_B(comedi_device * dev, enc_private * k, uint16_t Trig); static void SetLoadTrig_B(comedi_device *dev, enc_private *k, uint16_t Trig);
static uint16_t GetLoadTrig_A(comedi_device * dev, enc_private * k); static uint16_t GetLoadTrig_A(comedi_device *dev, enc_private *k);
static uint16_t GetLoadTrig_B(comedi_device * dev, enc_private * k); static uint16_t GetLoadTrig_B(comedi_device *dev, enc_private *k);
static void SetIntSrc_B(comedi_device * dev, enc_private * k, static void SetIntSrc_B(comedi_device *dev, enc_private *k,
uint16_t IntSource); uint16_t IntSource);
static void SetIntSrc_A(comedi_device * dev, enc_private * k, static void SetIntSrc_A(comedi_device *dev, enc_private *k,
uint16_t IntSource); uint16_t IntSource);
static uint16_t GetIntSrc_A(comedi_device * dev, enc_private * k); static uint16_t GetIntSrc_A(comedi_device *dev, enc_private *k);
static uint16_t GetIntSrc_B(comedi_device * dev, enc_private * k); static uint16_t GetIntSrc_B(comedi_device *dev, enc_private *k);
/* static void SetClkMult(comedi_device *dev, enc_private *k, uint16_t value ) ; */ /* static void SetClkMult(comedi_device *dev, enc_private *k, uint16_t value ) ; */
/* static uint16_t GetClkMult(comedi_device *dev, enc_private *k ) ; */ /* static uint16_t GetClkMult(comedi_device *dev, enc_private *k ) ; */
/* static void SetIndexPol(comedi_device *dev, enc_private *k, uint16_t value ); */ /* static void SetIndexPol(comedi_device *dev, enc_private *k, uint16_t value ); */
...@@ -336,10 +336,10 @@ static uint16_t GetIntSrc_B(comedi_device * dev, enc_private * k); ...@@ -336,10 +336,10 @@ static uint16_t GetIntSrc_B(comedi_device * dev, enc_private * k);
/* static uint16_t GetClkSrc( comedi_device *dev,enc_private *k ); */ /* static uint16_t GetClkSrc( comedi_device *dev,enc_private *k ); */
/* static void SetIndexSrc( comedi_device *dev,enc_private *k, uint16_t value ); */ /* static void SetIndexSrc( comedi_device *dev,enc_private *k, uint16_t value ); */
/* static uint16_t GetIndexSrc( comedi_device *dev,enc_private *k ); */ /* static uint16_t GetIndexSrc( comedi_device *dev,enc_private *k ); */
static void PulseIndex_A(comedi_device * dev, enc_private * k); static void PulseIndex_A(comedi_device *dev, enc_private *k);
static void PulseIndex_B(comedi_device * dev, enc_private * k); static void PulseIndex_B(comedi_device *dev, enc_private *k);
static void Preload(comedi_device * dev, enc_private * k, uint32_t value); static void Preload(comedi_device *dev, enc_private *k, uint32_t value);
static void CountersInit(comedi_device * dev); static void CountersInit(comedi_device *dev);
/* end internal routines */ /* end internal routines */
/* Counter objects constructor. */ /* Counter objects constructor. */
...@@ -485,7 +485,7 @@ static const comedi_lrange s626_range_table = { 2, { ...@@ -485,7 +485,7 @@ static const comedi_lrange s626_range_table = { 2, {
} }
}; };
static int s626_attach(comedi_device * dev, comedi_devconfig * it) static int s626_attach(comedi_device *dev, comedi_devconfig *it)
{ {
/* uint8_t PollList; */ /* uint8_t PollList; */
/* uint16_t AdcData; */ /* uint16_t AdcData; */
...@@ -1261,7 +1261,7 @@ static irqreturn_t s626_irq_handler(int irq, void *d PT_REGS_ARG) ...@@ -1261,7 +1261,7 @@ static irqreturn_t s626_irq_handler(int irq, void *d PT_REGS_ARG)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
static int s626_detach(comedi_device * dev) static int s626_detach(comedi_device *dev)
{ {
if (devpriv) { if (devpriv) {
/* stop ai_command */ /* stop ai_command */
...@@ -1307,7 +1307,7 @@ static int s626_detach(comedi_device * dev) ...@@ -1307,7 +1307,7 @@ static int s626_detach(comedi_device * dev)
/* /*
* this functions build the RPS program for hardware driven acquistion * this functions build the RPS program for hardware driven acquistion
*/ */
void ResetADC(comedi_device * dev, uint8_t * ppl) void ResetADC(comedi_device *dev, uint8_t *ppl)
{ {
register uint32_t *pRPS; register uint32_t *pRPS;
uint32_t JmpAdrs; uint32_t JmpAdrs;
...@@ -1499,8 +1499,8 @@ void ResetADC(comedi_device * dev, uint8_t * ppl) ...@@ -1499,8 +1499,8 @@ void ResetADC(comedi_device * dev, uint8_t * ppl)
} }
/* TO COMPLETE, IF NECESSARY */ /* TO COMPLETE, IF NECESSARY */
static int s626_ai_insn_config(comedi_device * dev, comedi_subdevice * s, static int s626_ai_insn_config(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
return -EINVAL; return -EINVAL;
...@@ -1536,8 +1536,8 @@ static int s626_ai_insn_config(comedi_device * dev, comedi_subdevice * s, ...@@ -1536,8 +1536,8 @@ static int s626_ai_insn_config(comedi_device * dev, comedi_subdevice * s,
/* return i; */ /* return i; */
/* } */ /* } */
static int s626_ai_insn_read(comedi_device * dev, comedi_subdevice * s, static int s626_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
uint16_t chan = CR_CHAN(insn->chanspec); uint16_t chan = CR_CHAN(insn->chanspec);
uint16_t range = CR_RANGE(insn->chanspec); uint16_t range = CR_RANGE(insn->chanspec);
...@@ -1632,7 +1632,7 @@ static int s626_ai_insn_read(comedi_device * dev, comedi_subdevice * s, ...@@ -1632,7 +1632,7 @@ static int s626_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
return n; return n;
} }
static int s626_ai_load_polllist(uint8_t * ppl, comedi_cmd * cmd) static int s626_ai_load_polllist(uint8_t *ppl, comedi_cmd *cmd)
{ {
int n; int n;
...@@ -1648,7 +1648,7 @@ static int s626_ai_load_polllist(uint8_t * ppl, comedi_cmd * cmd) ...@@ -1648,7 +1648,7 @@ static int s626_ai_load_polllist(uint8_t * ppl, comedi_cmd * cmd)
return n; return n;
} }
static int s626_ai_inttrig(comedi_device * dev, comedi_subdevice * s, static int s626_ai_inttrig(comedi_device *dev, comedi_subdevice *s,
unsigned int trignum) unsigned int trignum)
{ {
if (trignum != 0) if (trignum != 0)
...@@ -1667,7 +1667,7 @@ static int s626_ai_inttrig(comedi_device * dev, comedi_subdevice * s, ...@@ -1667,7 +1667,7 @@ static int s626_ai_inttrig(comedi_device * dev, comedi_subdevice * s,
} }
/* TO COMPLETE */ /* TO COMPLETE */
static int s626_ai_cmd(comedi_device * dev, comedi_subdevice * s) static int s626_ai_cmd(comedi_device *dev, comedi_subdevice *s)
{ {
uint8_t ppl[16]; uint8_t ppl[16];
...@@ -1813,8 +1813,8 @@ static int s626_ai_cmd(comedi_device * dev, comedi_subdevice * s) ...@@ -1813,8 +1813,8 @@ static int s626_ai_cmd(comedi_device * dev, comedi_subdevice * s)
return 0; return 0;
} }
static int s626_ai_cmdtest(comedi_device * dev, comedi_subdevice * s, static int s626_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
comedi_cmd * cmd) comedi_cmd *cmd)
{ {
int err = 0; int err = 0;
int tmp; int tmp;
...@@ -1998,7 +1998,7 @@ static int s626_ai_cmdtest(comedi_device * dev, comedi_subdevice * s, ...@@ -1998,7 +1998,7 @@ static int s626_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
return 0; return 0;
} }
static int s626_ai_cancel(comedi_device * dev, comedi_subdevice * s) static int s626_ai_cancel(comedi_device *dev, comedi_subdevice *s)
{ {
/* Stop RPS program in case it is currently running. */ /* Stop RPS program in case it is currently running. */
MC_DISABLE(P_MC1, MC1_ERPS1); MC_DISABLE(P_MC1, MC1_ERPS1);
...@@ -2039,8 +2039,8 @@ static int s626_ns_to_timer(int *nanosec, int round_mode) ...@@ -2039,8 +2039,8 @@ static int s626_ns_to_timer(int *nanosec, int round_mode)
return divider - 1; return divider - 1;
} }
static int s626_ao_winsn(comedi_device * dev, comedi_subdevice * s, static int s626_ao_winsn(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
int i; int i;
...@@ -2058,8 +2058,8 @@ static int s626_ao_winsn(comedi_device * dev, comedi_subdevice * s, ...@@ -2058,8 +2058,8 @@ static int s626_ao_winsn(comedi_device * dev, comedi_subdevice * s,
return i; return i;
} }
static int s626_ao_rinsn(comedi_device * dev, comedi_subdevice * s, static int s626_ao_rinsn(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
int i; int i;
...@@ -2076,7 +2076,7 @@ static int s626_ao_rinsn(comedi_device * dev, comedi_subdevice * s, ...@@ -2076,7 +2076,7 @@ static int s626_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
* ports A, B and C, respectively. * ports A, B and C, respectively.
*/ */
static void s626_dio_init(comedi_device * dev) static void s626_dio_init(comedi_device *dev)
{ {
uint16_t group; uint16_t group;
comedi_subdevice *s; comedi_subdevice *s;
...@@ -2105,8 +2105,8 @@ static void s626_dio_init(comedi_device * dev) ...@@ -2105,8 +2105,8 @@ static void s626_dio_init(comedi_device * dev)
* This allows packed reading/writing of the DIO channels. The comedi * This allows packed reading/writing of the DIO channels. The comedi
* core can convert between insn_bits and insn_read/write */ * core can convert between insn_bits and insn_read/write */
static int s626_dio_insn_bits(comedi_device * dev, comedi_subdevice * s, static int s626_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
/* Length of data must be 2 (mask and new data, see below) */ /* Length of data must be 2 (mask and new data, see below) */
...@@ -2141,8 +2141,8 @@ static int s626_dio_insn_bits(comedi_device * dev, comedi_subdevice * s, ...@@ -2141,8 +2141,8 @@ static int s626_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
return 2; return 2;
} }
static int s626_dio_insn_config(comedi_device * dev, comedi_subdevice * s, static int s626_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
switch (data[0]) { switch (data[0]) {
...@@ -2168,7 +2168,7 @@ static int s626_dio_insn_config(comedi_device * dev, comedi_subdevice * s, ...@@ -2168,7 +2168,7 @@ static int s626_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
return 1; return 1;
} }
static int s626_dio_set_irq(comedi_device * dev, unsigned int chan) static int s626_dio_set_irq(comedi_device *dev, unsigned int chan)
{ {
unsigned int group; unsigned int group;
unsigned int bitmask; unsigned int bitmask;
...@@ -2210,7 +2210,7 @@ static int s626_dio_set_irq(comedi_device * dev, unsigned int chan) ...@@ -2210,7 +2210,7 @@ static int s626_dio_set_irq(comedi_device * dev, unsigned int chan)
return 0; return 0;
} }
static int s626_dio_reset_irq(comedi_device * dev, unsigned int group, static int s626_dio_reset_irq(comedi_device *dev, unsigned int group,
unsigned int mask) unsigned int mask)
{ {
DEBUG("s626_dio_reset_irq: disable interrupt on dio channel %d group %d\n", mask, group); DEBUG("s626_dio_reset_irq: disable interrupt on dio channel %d group %d\n", mask, group);
...@@ -2226,7 +2226,7 @@ static int s626_dio_reset_irq(comedi_device * dev, unsigned int group, ...@@ -2226,7 +2226,7 @@ static int s626_dio_reset_irq(comedi_device * dev, unsigned int group,
return 0; return 0;
} }
static int s626_dio_clear_irq(comedi_device * dev) static int s626_dio_clear_irq(comedi_device *dev)
{ {
unsigned int group; unsigned int group;
...@@ -2246,8 +2246,8 @@ static int s626_dio_clear_irq(comedi_device * dev) ...@@ -2246,8 +2246,8 @@ static int s626_dio_clear_irq(comedi_device * dev)
/* Now this function initializes the value of the counter (data[0]) /* Now this function initializes the value of the counter (data[0])
and set the subdevice. To complete with trigger and interrupt and set the subdevice. To complete with trigger and interrupt
configuration */ configuration */
static int s626_enc_insn_config(comedi_device * dev, comedi_subdevice * s, static int s626_enc_insn_config(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
uint16_t Setup = (LOADSRC_INDX << BF_LOADSRC) | /* Preload upon */ uint16_t Setup = (LOADSRC_INDX << BF_LOADSRC) | /* Preload upon */
/* index. */ /* index. */
...@@ -2276,8 +2276,8 @@ static int s626_enc_insn_config(comedi_device * dev, comedi_subdevice * s, ...@@ -2276,8 +2276,8 @@ static int s626_enc_insn_config(comedi_device * dev, comedi_subdevice * s,
return insn->n; return insn->n;
} }
static int s626_enc_insn_read(comedi_device * dev, comedi_subdevice * s, static int s626_enc_insn_read(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
int n; int n;
...@@ -2294,8 +2294,8 @@ static int s626_enc_insn_read(comedi_device * dev, comedi_subdevice * s, ...@@ -2294,8 +2294,8 @@ static int s626_enc_insn_read(comedi_device * dev, comedi_subdevice * s,
return n; return n;
} }
static int s626_enc_insn_write(comedi_device * dev, comedi_subdevice * s, static int s626_enc_insn_write(comedi_device *dev, comedi_subdevice *s,
comedi_insn * insn, lsampl_t * data) comedi_insn *insn, lsampl_t *data)
{ {
enc_private *k = &encpriv[CR_CHAN(insn->chanspec)]; enc_private *k = &encpriv[CR_CHAN(insn->chanspec)];
...@@ -2317,7 +2317,7 @@ static int s626_enc_insn_write(comedi_device * dev, comedi_subdevice * s, ...@@ -2317,7 +2317,7 @@ static int s626_enc_insn_write(comedi_device * dev, comedi_subdevice * s,
return 1; return 1;
} }
static void s626_timer_load(comedi_device * dev, enc_private * k, int tick) static void s626_timer_load(comedi_device *dev, enc_private *k, int tick)
{ {
uint16_t Setup = (LOADSRC_INDX << BF_LOADSRC) | /* Preload upon */ uint16_t Setup = (LOADSRC_INDX << BF_LOADSRC) | /* Preload upon */
/* index. */ /* index. */
...@@ -2363,7 +2363,7 @@ static uint8_t trimchan[] = { 10, 9, 8, 3, 2, 7, 6, 1, 0, 5, 4 }; ...@@ -2363,7 +2363,7 @@ static uint8_t trimchan[] = { 10, 9, 8, 3, 2, 7, 6, 1, 0, 5, 4 };
static uint8_t trimadrs[] = static uint8_t trimadrs[] =
{ 0x40, 0x41, 0x42, 0x50, 0x51, 0x52, 0x53, 0x60, 0x61, 0x62, 0x63 }; { 0x40, 0x41, 0x42, 0x50, 0x51, 0x52, 0x53, 0x60, 0x61, 0x62, 0x63 };
static void LoadTrimDACs(comedi_device * dev) static void LoadTrimDACs(comedi_device *dev)
{ {
register uint8_t i; register uint8_t i;
...@@ -2372,7 +2372,7 @@ static void LoadTrimDACs(comedi_device * dev) ...@@ -2372,7 +2372,7 @@ static void LoadTrimDACs(comedi_device * dev)
WriteTrimDAC(dev, i, I2Cread(dev, trimadrs[i])); WriteTrimDAC(dev, i, I2Cread(dev, trimadrs[i]));
} }
static void WriteTrimDAC(comedi_device * dev, uint8_t LogicalChan, static void WriteTrimDAC(comedi_device *dev, uint8_t LogicalChan,
uint8_t DacData) uint8_t DacData)
{ {
uint32_t chan; uint32_t chan;
...@@ -2413,7 +2413,7 @@ static void WriteTrimDAC(comedi_device * dev, uint8_t LogicalChan, ...@@ -2413,7 +2413,7 @@ static void WriteTrimDAC(comedi_device * dev, uint8_t LogicalChan,
/* ************** EEPROM ACCESS FUNCTIONS ************** */ /* ************** EEPROM ACCESS FUNCTIONS ************** */
/* Read uint8_t from EEPROM. */ /* Read uint8_t from EEPROM. */
static uint8_t I2Cread(comedi_device * dev, uint8_t addr) static uint8_t I2Cread(comedi_device *dev, uint8_t addr)
{ {
uint8_t rtnval; uint8_t rtnval;
...@@ -2448,7 +2448,7 @@ static uint8_t I2Cread(comedi_device * dev, uint8_t addr) ...@@ -2448,7 +2448,7 @@ static uint8_t I2Cread(comedi_device * dev, uint8_t addr)
return rtnval; return rtnval;
} }
static uint32_t I2Chandshake(comedi_device * dev, uint32_t val) static uint32_t I2Chandshake(comedi_device *dev, uint32_t val)
{ {
/* Write I2C command to I2C Transfer Control shadow register. */ /* Write I2C command to I2C Transfer Control shadow register. */
WR7146(P_I2CCTRL, val); WR7146(P_I2CCTRL, val);
...@@ -2469,7 +2469,7 @@ static uint32_t I2Chandshake(comedi_device * dev, uint32_t val) ...@@ -2469,7 +2469,7 @@ static uint32_t I2Chandshake(comedi_device * dev, uint32_t val)
/* Private helper function: Write setpoint to an application DAC channel. */ /* Private helper function: Write setpoint to an application DAC channel. */
static void SetDAC(comedi_device * dev, uint16_t chan, short dacdata) static void SetDAC(comedi_device *dev, uint16_t chan, short dacdata)
{ {
register uint16_t signmask; register uint16_t signmask;
register uint32_t WSImage; register uint32_t WSImage;
...@@ -2530,7 +2530,7 @@ static void SetDAC(comedi_device * dev, uint16_t chan, short dacdata) ...@@ -2530,7 +2530,7 @@ static void SetDAC(comedi_device * dev, uint16_t chan, short dacdata)
* Dacpol contains valid target image. * Dacpol contains valid target image.
*/ */
static void SendDAC(comedi_device * dev, uint32_t val) static void SendDAC(comedi_device *dev, uint32_t val)
{ {
/* START THE SERIAL CLOCK RUNNING ------------- */ /* START THE SERIAL CLOCK RUNNING ------------- */
...@@ -2646,7 +2646,7 @@ static void SendDAC(comedi_device * dev, uint32_t val) ...@@ -2646,7 +2646,7 @@ static void SendDAC(comedi_device * dev, uint32_t val)
while ((RR7146(P_FB_BUFFER2) & 0xFF000000) == 0) ; while ((RR7146(P_FB_BUFFER2) & 0xFF000000) == 0) ;
} }
static void WriteMISC2(comedi_device * dev, uint16_t NewImage) static void WriteMISC2(comedi_device *dev, uint16_t NewImage)
{ {
DEBIwrite(dev, LP_MISC1, MISC1_WENABLE); /* enab writes to */ DEBIwrite(dev, LP_MISC1, MISC1_WENABLE); /* enab writes to */
/* MISC2 register. */ /* MISC2 register. */
...@@ -2656,7 +2656,7 @@ static void WriteMISC2(comedi_device * dev, uint16_t NewImage) ...@@ -2656,7 +2656,7 @@ static void WriteMISC2(comedi_device * dev, uint16_t NewImage)
/* Initialize the DEBI interface for all transfers. */ /* Initialize the DEBI interface for all transfers. */
static uint16_t DEBIread(comedi_device * dev, uint16_t addr) static uint16_t DEBIread(comedi_device *dev, uint16_t addr)
{ {
uint16_t retval; uint16_t retval;
...@@ -2675,7 +2675,7 @@ static uint16_t DEBIread(comedi_device * dev, uint16_t addr) ...@@ -2675,7 +2675,7 @@ static uint16_t DEBIread(comedi_device * dev, uint16_t addr)
/* Execute a DEBI transfer. This must be called from within a */ /* Execute a DEBI transfer. This must be called from within a */
/* critical section. */ /* critical section. */
static void DEBItransfer(comedi_device * dev) static void DEBItransfer(comedi_device *dev)
{ {
/* Initiate upload of shadow RAM to DEBI control register. */ /* Initiate upload of shadow RAM to DEBI control register. */
MC_ENABLE(P_MC2, MC2_UPLD_DEBI); MC_ENABLE(P_MC2, MC2_UPLD_DEBI);
...@@ -2689,7 +2689,7 @@ static void DEBItransfer(comedi_device * dev) ...@@ -2689,7 +2689,7 @@ static void DEBItransfer(comedi_device * dev)
} }
/* Write a value to a gate array register. */ /* Write a value to a gate array register. */
static void DEBIwrite(comedi_device * dev, uint16_t addr, uint16_t wdata) static void DEBIwrite(comedi_device *dev, uint16_t addr, uint16_t wdata)
{ {
/* Set up DEBI control register value in shadow RAM. */ /* Set up DEBI control register value in shadow RAM. */
...@@ -2704,7 +2704,7 @@ static void DEBIwrite(comedi_device * dev, uint16_t addr, uint16_t wdata) ...@@ -2704,7 +2704,7 @@ static void DEBIwrite(comedi_device * dev, uint16_t addr, uint16_t wdata)
* specifies bits that are to be preserved, wdata is new value to be * specifies bits that are to be preserved, wdata is new value to be
* or'd with the masked original. * or'd with the masked original.
*/ */
static void DEBIreplace(comedi_device * dev, uint16_t addr, uint16_t mask, static void DEBIreplace(comedi_device *dev, uint16_t addr, uint16_t mask,
uint16_t wdata) uint16_t wdata)
{ {
...@@ -2722,7 +2722,7 @@ static void DEBIreplace(comedi_device * dev, uint16_t addr, uint16_t mask, ...@@ -2722,7 +2722,7 @@ static void DEBIreplace(comedi_device * dev, uint16_t addr, uint16_t mask,
DEBItransfer(dev); /* Execute the DEBI Write transfer. */ DEBItransfer(dev); /* Execute the DEBI Write transfer. */
} }
static void CloseDMAB(comedi_device * dev, DMABUF * pdma, size_t bsize) static void CloseDMAB(comedi_device *dev, DMABUF *pdma, size_t bsize)
{ {
void *vbptr; void *vbptr;
dma_addr_t vpptr; dma_addr_t vpptr;
...@@ -2757,7 +2757,7 @@ static void CloseDMAB(comedi_device * dev, DMABUF * pdma, size_t bsize) ...@@ -2757,7 +2757,7 @@ static void CloseDMAB(comedi_device * dev, DMABUF * pdma, size_t bsize)
/* Read a counter's output latch. */ /* Read a counter's output latch. */
static uint32_t ReadLatch(comedi_device * dev, enc_private * k) static uint32_t ReadLatch(comedi_device *dev, enc_private *k)
{ {
register uint32_t value; register uint32_t value;
/* DEBUG FIXME DEBUG("ReadLatch: Read Latch enter\n"); */ /* DEBUG FIXME DEBUG("ReadLatch: Read Latch enter\n"); */
...@@ -2776,13 +2776,13 @@ static uint32_t ReadLatch(comedi_device * dev, enc_private * k) ...@@ -2776,13 +2776,13 @@ static uint32_t ReadLatch(comedi_device * dev, enc_private * k)
/* Reset a counter's index and overflow event capture flags. */ /* Reset a counter's index and overflow event capture flags. */
static void ResetCapFlags_A(comedi_device * dev, enc_private * k) static void ResetCapFlags_A(comedi_device *dev, enc_private *k)
{ {
DEBIreplace(dev, k->MyCRB, (uint16_t) (~CRBMSK_INTCTRL), DEBIreplace(dev, k->MyCRB, (uint16_t) (~CRBMSK_INTCTRL),
CRBMSK_INTRESETCMD | CRBMSK_INTRESET_A); CRBMSK_INTRESETCMD | CRBMSK_INTRESET_A);
} }
static void ResetCapFlags_B(comedi_device * dev, enc_private * k) static void ResetCapFlags_B(comedi_device *dev, enc_private *k)
{ {
DEBIreplace(dev, k->MyCRB, (uint16_t) (~CRBMSK_INTCTRL), DEBIreplace(dev, k->MyCRB, (uint16_t) (~CRBMSK_INTCTRL),
CRBMSK_INTRESETCMD | CRBMSK_INTRESET_B); CRBMSK_INTRESETCMD | CRBMSK_INTRESET_B);
...@@ -2791,7 +2791,7 @@ static void ResetCapFlags_B(comedi_device * dev, enc_private * k) ...@@ -2791,7 +2791,7 @@ static void ResetCapFlags_B(comedi_device * dev, enc_private * k)
/* Return counter setup in a format (COUNTER_SETUP) that is consistent */ /* Return counter setup in a format (COUNTER_SETUP) that is consistent */
/* for both A and B counters. */ /* for both A and B counters. */
static uint16_t GetMode_A(comedi_device * dev, enc_private * k) static uint16_t GetMode_A(comedi_device *dev, enc_private *k)
{ {
register uint16_t cra; register uint16_t cra;
register uint16_t crb; register uint16_t crb;
...@@ -2829,7 +2829,7 @@ static uint16_t GetMode_A(comedi_device * dev, enc_private * k) ...@@ -2829,7 +2829,7 @@ static uint16_t GetMode_A(comedi_device * dev, enc_private * k)
return setup; return setup;
} }
static uint16_t GetMode_B(comedi_device * dev, enc_private * k) static uint16_t GetMode_B(comedi_device *dev, enc_private *k)
{ {
register uint16_t cra; register uint16_t cra;
register uint16_t crb; register uint16_t crb;
...@@ -2875,7 +2875,7 @@ static uint16_t GetMode_B(comedi_device * dev, enc_private * k) ...@@ -2875,7 +2875,7 @@ static uint16_t GetMode_B(comedi_device * dev, enc_private * k)
* ClkPol, ClkEnab, IndexSrc, IndexPol, LoadSrc. * ClkPol, ClkEnab, IndexSrc, IndexPol, LoadSrc.
*/ */
static void SetMode_A(comedi_device * dev, enc_private * k, uint16_t Setup, static void SetMode_A(comedi_device *dev, enc_private *k, uint16_t Setup,
uint16_t DisableIntSrc) uint16_t DisableIntSrc)
{ {
register uint16_t cra; register uint16_t cra;
...@@ -2933,7 +2933,7 @@ static void SetMode_A(comedi_device * dev, enc_private * k, uint16_t Setup, ...@@ -2933,7 +2933,7 @@ static void SetMode_A(comedi_device * dev, enc_private * k, uint16_t Setup,
(uint16_t) (~(CRBMSK_INTCTRL | CRBMSK_CLKENAB_A)), crb); (uint16_t) (~(CRBMSK_INTCTRL | CRBMSK_CLKENAB_A)), crb);
} }
static void SetMode_B(comedi_device * dev, enc_private * k, uint16_t Setup, static void SetMode_B(comedi_device *dev, enc_private *k, uint16_t Setup,
uint16_t DisableIntSrc) uint16_t DisableIntSrc)
{ {
register uint16_t cra; register uint16_t cra;
...@@ -2997,7 +2997,7 @@ static void SetMode_B(comedi_device * dev, enc_private * k, uint16_t Setup, ...@@ -2997,7 +2997,7 @@ static void SetMode_B(comedi_device * dev, enc_private * k, uint16_t Setup,
/* Return/set a counter's enable. enab: 0=always enabled, 1=enabled by index. */ /* Return/set a counter's enable. enab: 0=always enabled, 1=enabled by index. */
static void SetEnable_A(comedi_device * dev, enc_private * k, uint16_t enab) static void SetEnable_A(comedi_device *dev, enc_private *k, uint16_t enab)
{ {
DEBUG("SetEnable_A: SetEnable_A enter 3541\n"); DEBUG("SetEnable_A: SetEnable_A enter 3541\n");
DEBIreplace(dev, k->MyCRB, DEBIreplace(dev, k->MyCRB,
...@@ -3005,19 +3005,19 @@ static void SetEnable_A(comedi_device * dev, enc_private * k, uint16_t enab) ...@@ -3005,19 +3005,19 @@ static void SetEnable_A(comedi_device * dev, enc_private * k, uint16_t enab)
(uint16_t) (enab << CRBBIT_CLKENAB_A)); (uint16_t) (enab << CRBBIT_CLKENAB_A));
} }
static void SetEnable_B(comedi_device * dev, enc_private * k, uint16_t enab) static void SetEnable_B(comedi_device *dev, enc_private *k, uint16_t enab)
{ {
DEBIreplace(dev, k->MyCRB, DEBIreplace(dev, k->MyCRB,
(uint16_t) (~(CRBMSK_INTCTRL | CRBMSK_CLKENAB_B)), (uint16_t) (~(CRBMSK_INTCTRL | CRBMSK_CLKENAB_B)),
(uint16_t) (enab << CRBBIT_CLKENAB_B)); (uint16_t) (enab << CRBBIT_CLKENAB_B));
} }
static uint16_t GetEnable_A(comedi_device * dev, enc_private * k) static uint16_t GetEnable_A(comedi_device *dev, enc_private *k)
{ {
return (DEBIread(dev, k->MyCRB) >> CRBBIT_CLKENAB_A) & 1; return (DEBIread(dev, k->MyCRB) >> CRBBIT_CLKENAB_A) & 1;
} }
static uint16_t GetEnable_B(comedi_device * dev, enc_private * k) static uint16_t GetEnable_B(comedi_device *dev, enc_private *k)
{ {
return (DEBIread(dev, k->MyCRB) >> CRBBIT_CLKENAB_B) & 1; return (DEBIread(dev, k->MyCRB) >> CRBBIT_CLKENAB_B) & 1;
} }
...@@ -3027,7 +3027,7 @@ static uint16_t GetEnable_B(comedi_device * dev, enc_private * k) ...@@ -3027,7 +3027,7 @@ static uint16_t GetEnable_B(comedi_device * dev, enc_private * k)
* latches B. * latches B.
*/ */
static void SetLatchSource(comedi_device * dev, enc_private * k, uint16_t value) static void SetLatchSource(comedi_device *dev, enc_private *k, uint16_t value)
{ {
DEBUG("SetLatchSource: SetLatchSource enter 3550 \n"); DEBUG("SetLatchSource: SetLatchSource enter 3550 \n");
DEBIreplace(dev, k->MyCRB, DEBIreplace(dev, k->MyCRB,
...@@ -3050,25 +3050,25 @@ static void SetLatchSource(comedi_device * dev, enc_private * k, uint16_t value) ...@@ -3050,25 +3050,25 @@ static void SetLatchSource(comedi_device * dev, enc_private * k, uint16_t value)
* 2=OverflowA (B counters only), 3=disabled. * 2=OverflowA (B counters only), 3=disabled.
*/ */
static void SetLoadTrig_A(comedi_device * dev, enc_private * k, uint16_t Trig) static void SetLoadTrig_A(comedi_device *dev, enc_private *k, uint16_t Trig)
{ {
DEBIreplace(dev, k->MyCRA, (uint16_t) (~CRAMSK_LOADSRC_A), DEBIreplace(dev, k->MyCRA, (uint16_t) (~CRAMSK_LOADSRC_A),
(uint16_t) (Trig << CRABIT_LOADSRC_A)); (uint16_t) (Trig << CRABIT_LOADSRC_A));
} }
static void SetLoadTrig_B(comedi_device * dev, enc_private * k, uint16_t Trig) static void SetLoadTrig_B(comedi_device *dev, enc_private *k, uint16_t Trig)
{ {
DEBIreplace(dev, k->MyCRB, DEBIreplace(dev, k->MyCRB,
(uint16_t) (~(CRBMSK_LOADSRC_B | CRBMSK_INTCTRL)), (uint16_t) (~(CRBMSK_LOADSRC_B | CRBMSK_INTCTRL)),
(uint16_t) (Trig << CRBBIT_LOADSRC_B)); (uint16_t) (Trig << CRBBIT_LOADSRC_B));
} }
static uint16_t GetLoadTrig_A(comedi_device * dev, enc_private * k) static uint16_t GetLoadTrig_A(comedi_device *dev, enc_private *k)
{ {
return (DEBIread(dev, k->MyCRA) >> CRABIT_LOADSRC_A) & 3; return (DEBIread(dev, k->MyCRA) >> CRABIT_LOADSRC_A) & 3;
} }
static uint16_t GetLoadTrig_B(comedi_device * dev, enc_private * k) static uint16_t GetLoadTrig_B(comedi_device *dev, enc_private *k)
{ {
return (DEBIread(dev, k->MyCRB) >> CRBBIT_LOADSRC_B) & 3; return (DEBIread(dev, k->MyCRB) >> CRBBIT_LOADSRC_B) & 3;
} }
...@@ -3078,7 +3078,7 @@ static uint16_t GetLoadTrig_B(comedi_device * dev, enc_private * k) ...@@ -3078,7 +3078,7 @@ static uint16_t GetLoadTrig_B(comedi_device * dev, enc_private * k)
* 2=IndexOnly, 3=IndexAndOverflow. * 2=IndexOnly, 3=IndexAndOverflow.
*/ */
static void SetIntSrc_A(comedi_device * dev, enc_private * k, static void SetIntSrc_A(comedi_device *dev, enc_private *k,
uint16_t IntSource) uint16_t IntSource)
{ {
/* Reset any pending counter overflow or index captures. */ /* Reset any pending counter overflow or index captures. */
...@@ -3095,7 +3095,7 @@ static void SetIntSrc_A(comedi_device * dev, enc_private * k, ...@@ -3095,7 +3095,7 @@ static void SetIntSrc_A(comedi_device * dev, enc_private * k,
MyEventBits[IntSource]; MyEventBits[IntSource];
} }
static void SetIntSrc_B(comedi_device * dev, enc_private * k, static void SetIntSrc_B(comedi_device *dev, enc_private *k,
uint16_t IntSource) uint16_t IntSource)
{ {
uint16_t crb; uint16_t crb;
...@@ -3118,12 +3118,12 @@ static void SetIntSrc_B(comedi_device * dev, enc_private * k, ...@@ -3118,12 +3118,12 @@ static void SetIntSrc_B(comedi_device * dev, enc_private * k,
MyEventBits[IntSource]; MyEventBits[IntSource];
} }
static uint16_t GetIntSrc_A(comedi_device * dev, enc_private * k) static uint16_t GetIntSrc_A(comedi_device *dev, enc_private *k)
{ {
return (DEBIread(dev, k->MyCRA) >> CRABIT_INTSRC_A) & 3; return (DEBIread(dev, k->MyCRA) >> CRABIT_INTSRC_A) & 3;
} }
static uint16_t GetIntSrc_B(comedi_device * dev, enc_private * k) static uint16_t GetIntSrc_B(comedi_device *dev, enc_private *k)
{ {
return (DEBIread(dev, k->MyCRB) >> CRBBIT_INTSRC_B) & 3; return (DEBIread(dev, k->MyCRB) >> CRBBIT_INTSRC_B) & 3;
} }
...@@ -3191,7 +3191,7 @@ static uint16_t GetIntSrc_B(comedi_device * dev, enc_private * k) ...@@ -3191,7 +3191,7 @@ static uint16_t GetIntSrc_B(comedi_device * dev, enc_private * k)
/* Generate an index pulse. */ /* Generate an index pulse. */
static void PulseIndex_A(comedi_device * dev, enc_private * k) static void PulseIndex_A(comedi_device *dev, enc_private *k)
{ {
register uint16_t cra; register uint16_t cra;
...@@ -3203,7 +3203,7 @@ static void PulseIndex_A(comedi_device * dev, enc_private * k) ...@@ -3203,7 +3203,7 @@ static void PulseIndex_A(comedi_device * dev, enc_private * k)
DEBIwrite(dev, k->MyCRA, cra); DEBIwrite(dev, k->MyCRA, cra);
} }
static void PulseIndex_B(comedi_device * dev, enc_private * k) static void PulseIndex_B(comedi_device *dev, enc_private *k)
{ {
register uint16_t crb; register uint16_t crb;
...@@ -3214,7 +3214,7 @@ static void PulseIndex_B(comedi_device * dev, enc_private * k) ...@@ -3214,7 +3214,7 @@ static void PulseIndex_B(comedi_device * dev, enc_private * k)
/* Write value into counter preload register. */ /* Write value into counter preload register. */
static void Preload(comedi_device * dev, enc_private * k, uint32_t value) static void Preload(comedi_device *dev, enc_private *k, uint32_t value)
{ {
DEBUG("Preload: preload enter\n"); DEBUG("Preload: preload enter\n");
DEBIwrite(dev, (uint16_t) (k->MyLatchLsw), (uint16_t) value); /* Write value to preload register. */ DEBIwrite(dev, (uint16_t) (k->MyLatchLsw), (uint16_t) value); /* Write value to preload register. */
...@@ -3223,7 +3223,7 @@ static void Preload(comedi_device * dev, enc_private * k, uint32_t value) ...@@ -3223,7 +3223,7 @@ static void Preload(comedi_device * dev, enc_private * k, uint32_t value)
(uint16_t) (value >> 16)); (uint16_t) (value >> 16));
} }
static void CountersInit(comedi_device * dev) static void CountersInit(comedi_device *dev)
{ {
int chan; int chan;
enc_private *k; enc_private *k;
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <linux/string.h> #include <linux/string.h>
int comedi_data_write(comedi_t * dev, unsigned int subdev, unsigned int chan, int comedi_data_write(comedi_t *dev, unsigned int subdev, unsigned int chan,
unsigned int range, unsigned int aref, lsampl_t data) unsigned int range, unsigned int aref, lsampl_t data)
{ {
comedi_insn insn; comedi_insn insn;
...@@ -42,8 +42,8 @@ int comedi_data_write(comedi_t * dev, unsigned int subdev, unsigned int chan, ...@@ -42,8 +42,8 @@ int comedi_data_write(comedi_t * dev, unsigned int subdev, unsigned int chan,
return comedi_do_insn(dev, &insn); return comedi_do_insn(dev, &insn);
} }
int comedi_data_read(comedi_t * dev, unsigned int subdev, unsigned int chan, int comedi_data_read(comedi_t *dev, unsigned int subdev, unsigned int chan,
unsigned int range, unsigned int aref, lsampl_t * data) unsigned int range, unsigned int aref, lsampl_t *data)
{ {
comedi_insn insn; comedi_insn insn;
...@@ -57,7 +57,7 @@ int comedi_data_read(comedi_t * dev, unsigned int subdev, unsigned int chan, ...@@ -57,7 +57,7 @@ int comedi_data_read(comedi_t * dev, unsigned int subdev, unsigned int chan,
return comedi_do_insn(dev, &insn); return comedi_do_insn(dev, &insn);
} }
int comedi_data_read_hint(comedi_t * dev, unsigned int subdev, int comedi_data_read_hint(comedi_t *dev, unsigned int subdev,
unsigned int chan, unsigned int range, unsigned int aref) unsigned int chan, unsigned int range, unsigned int aref)
{ {
comedi_insn insn; comedi_insn insn;
...@@ -73,9 +73,9 @@ int comedi_data_read_hint(comedi_t * dev, unsigned int subdev, ...@@ -73,9 +73,9 @@ int comedi_data_read_hint(comedi_t * dev, unsigned int subdev,
return comedi_do_insn(dev, &insn); return comedi_do_insn(dev, &insn);
} }
int comedi_data_read_delayed(comedi_t * dev, unsigned int subdev, int comedi_data_read_delayed(comedi_t *dev, unsigned int subdev,
unsigned int chan, unsigned int range, unsigned int aref, unsigned int chan, unsigned int range, unsigned int aref,
lsampl_t * data, unsigned int nano_sec) lsampl_t *data, unsigned int nano_sec)
{ {
int retval; int retval;
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include <linux/string.h> #include <linux/string.h>
int comedi_dio_config(comedi_t * dev, unsigned int subdev, unsigned int chan, int comedi_dio_config(comedi_t *dev, unsigned int subdev, unsigned int chan,
unsigned int io) unsigned int io)
{ {
comedi_insn insn; comedi_insn insn;
...@@ -41,7 +41,7 @@ int comedi_dio_config(comedi_t * dev, unsigned int subdev, unsigned int chan, ...@@ -41,7 +41,7 @@ int comedi_dio_config(comedi_t * dev, unsigned int subdev, unsigned int chan,
return comedi_do_insn(dev, &insn); return comedi_do_insn(dev, &insn);
} }
int comedi_dio_read(comedi_t * dev, unsigned int subdev, unsigned int chan, int comedi_dio_read(comedi_t *dev, unsigned int subdev, unsigned int chan,
unsigned int *val) unsigned int *val)
{ {
comedi_insn insn; comedi_insn insn;
...@@ -56,7 +56,7 @@ int comedi_dio_read(comedi_t * dev, unsigned int subdev, unsigned int chan, ...@@ -56,7 +56,7 @@ int comedi_dio_read(comedi_t * dev, unsigned int subdev, unsigned int chan,
return comedi_do_insn(dev, &insn); return comedi_do_insn(dev, &insn);
} }
int comedi_dio_write(comedi_t * dev, unsigned int subdev, unsigned int chan, int comedi_dio_write(comedi_t *dev, unsigned int subdev, unsigned int chan,
unsigned int val) unsigned int val)
{ {
comedi_insn insn; comedi_insn insn;
...@@ -71,7 +71,7 @@ int comedi_dio_write(comedi_t * dev, unsigned int subdev, unsigned int chan, ...@@ -71,7 +71,7 @@ int comedi_dio_write(comedi_t * dev, unsigned int subdev, unsigned int chan,
return comedi_do_insn(dev, &insn); return comedi_do_insn(dev, &insn);
} }
int comedi_dio_bitfield(comedi_t * dev, unsigned int subdev, unsigned int mask, int comedi_dio_bitfield(comedi_t *dev, unsigned int subdev, unsigned int mask,
unsigned int *bits) unsigned int *bits)
{ {
comedi_insn insn; comedi_insn insn;
......
...@@ -26,14 +26,14 @@ ...@@ -26,14 +26,14 @@
#include "../comedilib.h" #include "../comedilib.h"
#include "../comedidev.h" #include "../comedidev.h"
int comedi_get_n_subdevices(comedi_t * d) int comedi_get_n_subdevices(comedi_t *d)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
return dev->n_subdevices; return dev->n_subdevices;
} }
int comedi_get_version_code(comedi_t * d) int comedi_get_version_code(comedi_t *d)
{ {
return COMEDI_VERSION_CODE; return COMEDI_VERSION_CODE;
} }
...@@ -52,7 +52,7 @@ const char *comedi_get_board_name(comedi_t * d) ...@@ -52,7 +52,7 @@ const char *comedi_get_board_name(comedi_t * d)
return dev->board_name; return dev->board_name;
} }
int comedi_get_subdevice_type(comedi_t * d, unsigned int subdevice) int comedi_get_subdevice_type(comedi_t *d, unsigned int subdevice)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice; comedi_subdevice *s = dev->subdevices + subdevice;
...@@ -60,7 +60,7 @@ int comedi_get_subdevice_type(comedi_t * d, unsigned int subdevice) ...@@ -60,7 +60,7 @@ int comedi_get_subdevice_type(comedi_t * d, unsigned int subdevice)
return s->type; return s->type;
} }
unsigned int comedi_get_subdevice_flags(comedi_t * d, unsigned int subdevice) unsigned int comedi_get_subdevice_flags(comedi_t *d, unsigned int subdevice)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice; comedi_subdevice *s = dev->subdevices + subdevice;
...@@ -68,7 +68,7 @@ unsigned int comedi_get_subdevice_flags(comedi_t * d, unsigned int subdevice) ...@@ -68,7 +68,7 @@ unsigned int comedi_get_subdevice_flags(comedi_t * d, unsigned int subdevice)
return s->subdev_flags; return s->subdev_flags;
} }
int comedi_find_subdevice_by_type(comedi_t * d, int type, unsigned int subd) int comedi_find_subdevice_by_type(comedi_t *d, int type, unsigned int subd)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
...@@ -82,7 +82,7 @@ int comedi_find_subdevice_by_type(comedi_t * d, int type, unsigned int subd) ...@@ -82,7 +82,7 @@ int comedi_find_subdevice_by_type(comedi_t * d, int type, unsigned int subd)
return -1; return -1;
} }
int comedi_get_n_channels(comedi_t * d, unsigned int subdevice) int comedi_get_n_channels(comedi_t *d, unsigned int subdevice)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice; comedi_subdevice *s = dev->subdevices + subdevice;
...@@ -90,7 +90,7 @@ int comedi_get_n_channels(comedi_t * d, unsigned int subdevice) ...@@ -90,7 +90,7 @@ int comedi_get_n_channels(comedi_t * d, unsigned int subdevice)
return s->n_chan; return s->n_chan;
} }
int comedi_get_len_chanlist(comedi_t * d, unsigned int subdevice) int comedi_get_len_chanlist(comedi_t *d, unsigned int subdevice)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice; comedi_subdevice *s = dev->subdevices + subdevice;
...@@ -98,7 +98,7 @@ int comedi_get_len_chanlist(comedi_t * d, unsigned int subdevice) ...@@ -98,7 +98,7 @@ int comedi_get_len_chanlist(comedi_t * d, unsigned int subdevice)
return s->len_chanlist; return s->len_chanlist;
} }
lsampl_t comedi_get_maxdata(comedi_t * d, unsigned int subdevice, lsampl_t comedi_get_maxdata(comedi_t *d, unsigned int subdevice,
unsigned int chan) unsigned int chan)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
...@@ -111,7 +111,7 @@ lsampl_t comedi_get_maxdata(comedi_t * d, unsigned int subdevice, ...@@ -111,7 +111,7 @@ lsampl_t comedi_get_maxdata(comedi_t * d, unsigned int subdevice,
} }
#ifdef KCOMEDILIB_DEPRECATED #ifdef KCOMEDILIB_DEPRECATED
int comedi_get_rangetype(comedi_t * d, unsigned int subdevice, int comedi_get_rangetype(comedi_t *d, unsigned int subdevice,
unsigned int chan) unsigned int chan)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
...@@ -130,7 +130,7 @@ int comedi_get_rangetype(comedi_t * d, unsigned int subdevice, ...@@ -130,7 +130,7 @@ int comedi_get_rangetype(comedi_t * d, unsigned int subdevice,
} }
#endif #endif
int comedi_get_n_ranges(comedi_t * d, unsigned int subdevice, unsigned int chan) int comedi_get_n_ranges(comedi_t *d, unsigned int subdevice, unsigned int chan)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice; comedi_subdevice *s = dev->subdevices + subdevice;
...@@ -148,8 +148,8 @@ int comedi_get_n_ranges(comedi_t * d, unsigned int subdevice, unsigned int chan) ...@@ -148,8 +148,8 @@ int comedi_get_n_ranges(comedi_t * d, unsigned int subdevice, unsigned int chan)
/* /*
* ALPHA (non-portable) * ALPHA (non-portable)
*/ */
int comedi_get_krange(comedi_t * d, unsigned int subdevice, unsigned int chan, int comedi_get_krange(comedi_t *d, unsigned int subdevice, unsigned int chan,
unsigned int range, comedi_krange * krange) unsigned int range, comedi_krange *krange)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice; comedi_subdevice *s = dev->subdevices + subdevice;
...@@ -171,7 +171,7 @@ int comedi_get_krange(comedi_t * d, unsigned int subdevice, unsigned int chan, ...@@ -171,7 +171,7 @@ int comedi_get_krange(comedi_t * d, unsigned int subdevice, unsigned int chan,
/* /*
* ALPHA (may be renamed) * ALPHA (may be renamed)
*/ */
unsigned int comedi_get_buf_head_pos(comedi_t * d, unsigned int subdevice) unsigned int comedi_get_buf_head_pos(comedi_t *d, unsigned int subdevice)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice; comedi_subdevice *s = dev->subdevices + subdevice;
...@@ -184,7 +184,7 @@ unsigned int comedi_get_buf_head_pos(comedi_t * d, unsigned int subdevice) ...@@ -184,7 +184,7 @@ unsigned int comedi_get_buf_head_pos(comedi_t * d, unsigned int subdevice)
return async->buf_write_count; return async->buf_write_count;
} }
int comedi_get_buffer_contents(comedi_t * d, unsigned int subdevice) int comedi_get_buffer_contents(comedi_t *d, unsigned int subdevice)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice; comedi_subdevice *s = dev->subdevices + subdevice;
...@@ -203,7 +203,7 @@ int comedi_get_buffer_contents(comedi_t * d, unsigned int subdevice) ...@@ -203,7 +203,7 @@ int comedi_get_buffer_contents(comedi_t * d, unsigned int subdevice)
/* /*
* ALPHA * ALPHA
*/ */
int comedi_set_user_int_count(comedi_t * d, unsigned int subdevice, int comedi_set_user_int_count(comedi_t *d, unsigned int subdevice,
unsigned int buf_user_count) unsigned int buf_user_count)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
...@@ -224,7 +224,7 @@ int comedi_set_user_int_count(comedi_t * d, unsigned int subdevice, ...@@ -224,7 +224,7 @@ int comedi_set_user_int_count(comedi_t * d, unsigned int subdevice,
return 0; return 0;
} }
int comedi_mark_buffer_read(comedi_t * d, unsigned int subdevice, int comedi_mark_buffer_read(comedi_t *d, unsigned int subdevice,
unsigned int num_bytes) unsigned int num_bytes)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
...@@ -243,7 +243,7 @@ int comedi_mark_buffer_read(comedi_t * d, unsigned int subdevice, ...@@ -243,7 +243,7 @@ int comedi_mark_buffer_read(comedi_t * d, unsigned int subdevice,
return 0; return 0;
} }
int comedi_mark_buffer_written(comedi_t * d, unsigned int subdevice, int comedi_mark_buffer_written(comedi_t *d, unsigned int subdevice,
unsigned int num_bytes) unsigned int num_bytes)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
...@@ -263,7 +263,7 @@ int comedi_mark_buffer_written(comedi_t * d, unsigned int subdevice, ...@@ -263,7 +263,7 @@ int comedi_mark_buffer_written(comedi_t * d, unsigned int subdevice,
return 0; return 0;
} }
int comedi_get_buffer_size(comedi_t * d, unsigned int subdev) int comedi_get_buffer_size(comedi_t *d, unsigned int subdev)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdev; comedi_subdevice *s = dev->subdevices + subdev;
...@@ -278,7 +278,7 @@ int comedi_get_buffer_size(comedi_t * d, unsigned int subdev) ...@@ -278,7 +278,7 @@ int comedi_get_buffer_size(comedi_t * d, unsigned int subdev)
return async->prealloc_bufsz; return async->prealloc_bufsz;
} }
int comedi_get_buffer_offset(comedi_t * d, unsigned int subdevice) int comedi_get_buffer_offset(comedi_t *d, unsigned int subdevice)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice; comedi_subdevice *s = dev->subdevices + subdevice;
......
...@@ -89,7 +89,7 @@ comedi_t *comedi_open_old(unsigned int minor) ...@@ -89,7 +89,7 @@ comedi_t *comedi_open_old(unsigned int minor)
return (comedi_t *) dev; return (comedi_t *) dev;
} }
int comedi_close(comedi_t * d) int comedi_close(comedi_t *d)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
...@@ -113,7 +113,7 @@ char *comedi_strerror(int err) ...@@ -113,7 +113,7 @@ char *comedi_strerror(int err)
return "unknown error"; return "unknown error";
} }
int comedi_fileno(comedi_t * d) int comedi_fileno(comedi_t *d)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
...@@ -121,7 +121,7 @@ int comedi_fileno(comedi_t * d) ...@@ -121,7 +121,7 @@ int comedi_fileno(comedi_t * d)
return dev->minor; return dev->minor;
} }
int comedi_command(comedi_t * d, comedi_cmd * cmd) int comedi_command(comedi_t *d, comedi_cmd *cmd)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s; comedi_subdevice *s;
...@@ -161,7 +161,7 @@ int comedi_command(comedi_t * d, comedi_cmd * cmd) ...@@ -161,7 +161,7 @@ int comedi_command(comedi_t * d, comedi_cmd * cmd)
return s->do_cmd(dev, s); return s->do_cmd(dev, s);
} }
int comedi_command_test(comedi_t * d, comedi_cmd * cmd) int comedi_command_test(comedi_t *d, comedi_cmd *cmd)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s; comedi_subdevice *s;
...@@ -183,7 +183,7 @@ int comedi_command_test(comedi_t * d, comedi_cmd * cmd) ...@@ -183,7 +183,7 @@ int comedi_command_test(comedi_t * d, comedi_cmd * cmd)
* COMEDI_INSN * COMEDI_INSN
* perform an instruction * perform an instruction
*/ */
int comedi_do_insn(comedi_t * d, comedi_insn * insn) int comedi_do_insn(comedi_t *d, comedi_insn *insn)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s; comedi_subdevice *s;
...@@ -323,7 +323,7 @@ int comedi_do_insn(comedi_t * d, comedi_insn * insn) ...@@ -323,7 +323,7 @@ int comedi_do_insn(comedi_t * d, comedi_insn * insn)
- lock while subdevice being programmed - lock while subdevice being programmed
*/ */
int comedi_lock(comedi_t * d, unsigned int subdevice) int comedi_lock(comedi_t *d, unsigned int subdevice)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s; comedi_subdevice *s;
...@@ -366,7 +366,7 @@ int comedi_lock(comedi_t * d, unsigned int subdevice) ...@@ -366,7 +366,7 @@ int comedi_lock(comedi_t * d, unsigned int subdevice)
none none
*/ */
int comedi_unlock(comedi_t * d, unsigned int subdevice) int comedi_unlock(comedi_t *d, unsigned int subdevice)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s; comedi_subdevice *s;
...@@ -418,7 +418,7 @@ int comedi_unlock(comedi_t * d, unsigned int subdevice) ...@@ -418,7 +418,7 @@ int comedi_unlock(comedi_t * d, unsigned int subdevice)
nothing nothing
*/ */
int comedi_cancel(comedi_t * d, unsigned int subdevice) int comedi_cancel(comedi_t *d, unsigned int subdevice)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s; comedi_subdevice *s;
...@@ -461,7 +461,7 @@ int comedi_cancel(comedi_t * d, unsigned int subdevice) ...@@ -461,7 +461,7 @@ int comedi_cancel(comedi_t * d, unsigned int subdevice)
/* /*
registration of callback functions registration of callback functions
*/ */
int comedi_register_callback(comedi_t * d, unsigned int subdevice, int comedi_register_callback(comedi_t *d, unsigned int subdevice,
unsigned int mask, int (*cb) (unsigned int, void *), void *arg) unsigned int mask, int (*cb) (unsigned int, void *), void *arg)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
...@@ -498,7 +498,7 @@ int comedi_register_callback(comedi_t * d, unsigned int subdevice, ...@@ -498,7 +498,7 @@ int comedi_register_callback(comedi_t * d, unsigned int subdevice,
return 0; return 0;
} }
int comedi_poll(comedi_t * d, unsigned int subdevice) int comedi_poll(comedi_t *d, unsigned int subdevice)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s = dev->subdevices; comedi_subdevice *s = dev->subdevices;
...@@ -525,7 +525,7 @@ int comedi_poll(comedi_t * d, unsigned int subdevice) ...@@ -525,7 +525,7 @@ int comedi_poll(comedi_t * d, unsigned int subdevice)
} }
/* WARNING: not portable */ /* WARNING: not portable */
int comedi_map(comedi_t * d, unsigned int subdevice, void *ptr) int comedi_map(comedi_t *d, unsigned int subdevice, void *ptr)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s; comedi_subdevice *s;
...@@ -548,7 +548,7 @@ int comedi_map(comedi_t * d, unsigned int subdevice, void *ptr) ...@@ -548,7 +548,7 @@ int comedi_map(comedi_t * d, unsigned int subdevice, void *ptr)
} }
/* WARNING: not portable */ /* WARNING: not portable */
int comedi_unmap(comedi_t * d, unsigned int subdevice) int comedi_unmap(comedi_t *d, unsigned int subdevice)
{ {
comedi_device *dev = (comedi_device *) d; comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s; comedi_subdevice *s;
......
...@@ -44,7 +44,7 @@ const comedi_lrange range_unknown = { 1, {{0, 1000000, UNIT_none}} }; ...@@ -44,7 +44,7 @@ const comedi_lrange range_unknown = { 1, {{0, 1000000, UNIT_none}} };
writes: writes:
n comedi_krange structures to rangeinfo->range_ptr n comedi_krange structures to rangeinfo->range_ptr
*/ */
int do_rangeinfo_ioctl(comedi_device * dev, comedi_rangeinfo * arg) int do_rangeinfo_ioctl(comedi_device *dev, comedi_rangeinfo *arg)
{ {
comedi_rangeinfo it; comedi_rangeinfo it;
int subd, chan; int subd, chan;
...@@ -84,7 +84,7 @@ int do_rangeinfo_ioctl(comedi_device * dev, comedi_rangeinfo * arg) ...@@ -84,7 +84,7 @@ int do_rangeinfo_ioctl(comedi_device * dev, comedi_rangeinfo * arg)
return 0; return 0;
} }
static int aref_invalid(comedi_subdevice * s, unsigned int chanspec) static int aref_invalid(comedi_subdevice *s, unsigned int chanspec)
{ {
unsigned int aref; unsigned int aref;
...@@ -120,7 +120,7 @@ static int aref_invalid(comedi_subdevice * s, unsigned int chanspec) ...@@ -120,7 +120,7 @@ static int aref_invalid(comedi_subdevice * s, unsigned int chanspec)
This function checks each element in a channel/gain list to make This function checks each element in a channel/gain list to make
make sure it is valid. make sure it is valid.
*/ */
int check_chanlist(comedi_subdevice * s, int n, unsigned int *chanlist) int check_chanlist(comedi_subdevice *s, int n, unsigned int *chanlist)
{ {
int i; int i;
int chan; int chan;
......
...@@ -67,7 +67,7 @@ static struct comedi_irq_struct *comedi_irqs[NR_IRQS]; ...@@ -67,7 +67,7 @@ static struct comedi_irq_struct *comedi_irqs[NR_IRQS];
int comedi_request_irq(unsigned irq, irqreturn_t(*handler) (int, int comedi_request_irq(unsigned irq, irqreturn_t(*handler) (int,
void *PT_REGS_ARG), unsigned long flags, const char *device, void *PT_REGS_ARG), unsigned long flags, const char *device,
comedi_device * dev_id) comedi_device *dev_id)
{ {
struct comedi_irq_struct *it; struct comedi_irq_struct *it;
int ret; int ret;
...@@ -102,7 +102,7 @@ int comedi_request_irq(unsigned irq, irqreturn_t(*handler) (int, ...@@ -102,7 +102,7 @@ int comedi_request_irq(unsigned irq, irqreturn_t(*handler) (int,
return 0; return 0;
} }
void comedi_free_irq(unsigned int irq, comedi_device * dev_id) void comedi_free_irq(unsigned int irq, comedi_device *dev_id)
{ {
struct comedi_irq_struct *it; struct comedi_irq_struct *it;
...@@ -121,7 +121,7 @@ void comedi_free_irq(unsigned int irq, comedi_device * dev_id) ...@@ -121,7 +121,7 @@ void comedi_free_irq(unsigned int irq, comedi_device * dev_id)
comedi_irqs[irq] = NULL; comedi_irqs[irq] = NULL;
} }
int comedi_switch_to_rt(comedi_device * dev) int comedi_switch_to_rt(comedi_device *dev)
{ {
struct comedi_irq_struct *it; struct comedi_irq_struct *it;
unsigned long flags; unsigned long flags;
...@@ -145,7 +145,7 @@ int comedi_switch_to_rt(comedi_device * dev) ...@@ -145,7 +145,7 @@ int comedi_switch_to_rt(comedi_device * dev)
return 0; return 0;
} }
void comedi_switch_to_non_rt(comedi_device * dev) void comedi_switch_to_non_rt(comedi_device *dev)
{ {
struct comedi_irq_struct *it; struct comedi_irq_struct *it;
unsigned long flags; unsigned long flags;
...@@ -170,7 +170,7 @@ void wake_up_int_handler(int arg1, void *arg2) ...@@ -170,7 +170,7 @@ void wake_up_int_handler(int arg1, void *arg2)
wake_up_interruptible((wait_queue_head_t *) arg2); wake_up_interruptible((wait_queue_head_t *) arg2);
} }
void comedi_rt_pend_wakeup(wait_queue_head_t * q) void comedi_rt_pend_wakeup(wait_queue_head_t *q)
{ {
rt_pend_call(wake_up_int_handler, 0, q); rt_pend_call(wake_up_int_handler, 0, q);
} }
......
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