#include <asm/io.h>
#include <asm/system.h>
-static int postconfig(comedi_device * dev);
-static int insn_rw_emulate_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+static int postconfig(comedi_device *dev);
+static int insn_rw_emulate_bits(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data);
static void *comedi_recognize(comedi_driver * driv, const char *name);
-static void comedi_report_boards(comedi_driver * driv);
-static int poll_invalid(comedi_device * dev, comedi_subdevice * s);
-int comedi_buf_alloc(comedi_device * dev, comedi_subdevice * s,
+static void comedi_report_boards(comedi_driver *driv);
+static int poll_invalid(comedi_device *dev, comedi_subdevice *s);
+int comedi_buf_alloc(comedi_device *dev, comedi_subdevice *s,
unsigned long new_size);
comedi_driver *comedi_drivers;
return -EINVAL;
}
-static void cleanup_device(comedi_device * dev)
+static void cleanup_device(comedi_device *dev)
{
int i;
comedi_subdevice *s;
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;
if (dev->driver) {
cleanup_device(dev);
}
-void comedi_device_detach(comedi_device * dev)
+void comedi_device_detach(comedi_device *dev)
{
if (!dev->attached)
return;
__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;
int ret;
return 0;
}
-int comedi_driver_register(comedi_driver * driver)
+int comedi_driver_register(comedi_driver *driver)
{
driver->next = comedi_drivers;
comedi_drivers = driver;
return 0;
}
-int comedi_driver_unregister(comedi_driver * driver)
+int comedi_driver_unregister(comedi_driver *driver)
{
comedi_driver *prev;
int i;
return -EINVAL;
}
-static int postconfig(comedi_device * dev)
+static int postconfig(comedi_device *dev)
{
int i;
comedi_subdevice *s;
return NULL;
}
-void comedi_report_boards(comedi_driver * driv)
+void comedi_report_boards(comedi_driver *driv)
{
unsigned int i;
const char *const *name_ptr;
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;
}
-int insn_inval(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+int insn_inval(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
return -EINVAL;
}
-static int insn_rw_emulate_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int insn_rw_emulate_bits(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
comedi_insn new_insn;
int ret;
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;
pmd_t *pmd;
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)
{
comedi_async *async = s->async;
/* munging is applied to data by core as it passes between user
* 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;
unsigned int count = 0;
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 nbytes;
}
/* 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;
}
/* 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 free_end = async->buf_read_count + async->prealloc_bufsz;
}
/* 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 -
async->buf_write_alloc_count) > 0) {
}
/* 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) >
0) {
}
/* 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 */
smp_mb();
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)
{
unsigned int write_ptr = async->buf_write_ptr + 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 *src;
}
}
-unsigned int comedi_buf_read_n_available(comedi_async * async)
+unsigned int comedi_buf_read_n_available(comedi_async *async)
{
unsigned 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);
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));
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_count = 0;
Forward declarations
==============================================================================
*/
-static int icp_multi_attach(comedi_device * dev, comedi_devconfig * it);
-static int icp_multi_detach(comedi_device * dev);
+static int icp_multi_attach(comedi_device *dev, comedi_devconfig *it);
+static int icp_multi_detach(comedi_device *dev);
/*
==============================================================================
*/
#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);
#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);
-static int icp_multi_reset(comedi_device * dev);
+static int icp_multi_reset(comedi_device *dev);
/*
==============================================================================
==============================================================================
*/
-static int icp_multi_insn_read_ai(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int icp_multi_insn_read_ai(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
int n, timeout;
==============================================================================
*/
-static int icp_multi_insn_write_ao(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int icp_multi_insn_write_ao(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
int n, chan, range, timeout;
==============================================================================
*/
-static int icp_multi_insn_read_ao(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int icp_multi_insn_read_ao(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
int n, chan;
==============================================================================
*/
-static int icp_multi_insn_bits_di(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int icp_multi_insn_bits_di(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
data[1] = readw(devpriv->io_addr + ICP_MULTI_DI);
==============================================================================
*/
-static int icp_multi_insn_bits_do(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int icp_multi_insn_bits_do(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
#ifdef ICP_MULTI_EXTDEBUG
printk("icp multi EDBG: BGN: icp_multi_insn_bits_do(...)\n");
==============================================================================
*/
-static int icp_multi_insn_read_ctr(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int icp_multi_insn_read_ctr(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
return 0;
}
==============================================================================
*/
-static int icp_multi_insn_write_ctr(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int icp_multi_insn_write_ctr(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
return 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 i;
==============================================================================
*/
-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 i, range, chanprog;
==============================================================================
*/
-static int icp_multi_reset(comedi_device * dev)
+static int icp_multi_reset(comedi_device *dev)
{
unsigned int i;
==============================================================================
*/
-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;
int ret, subdev, n_subdevices;
==============================================================================
*/
-static int icp_multi_detach(comedi_device * dev)
+static int icp_multi_detach(comedi_device *dev)
{
if (dev->private)
/*-----------------------------------------------------------------------------
Comedi function prototypes
---------------------------------------------------------------------------*/
-static int me4000_attach(comedi_device * dev, comedi_devconfig * it);
-static int me4000_detach(comedi_device * dev);
+static int me4000_attach(comedi_device *dev, comedi_devconfig *it);
+static int me4000_detach(comedi_device *dev);
static comedi_driver driver_me4000 = {
driver_name:"me4000",
module:THIS_MODULE,
/*-----------------------------------------------------------------------------
Meilhaus function prototypes
---------------------------------------------------------------------------*/
-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 init_board_info(comedi_device * dev, struct pci_dev *pci_dev_p);
-static int init_ao_context(comedi_device * dev);
-static int init_ai_context(comedi_device * dev);
-static int init_dio_context(comedi_device * dev);
-static int init_cnt_context(comedi_device * dev);
-static int xilinx_download(comedi_device * dev);
-static int reset_board(comedi_device * dev);
+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 init_board_info(comedi_device *dev, struct pci_dev *pci_dev_p);
+static int init_ao_context(comedi_device *dev);
+static int init_ai_context(comedi_device *dev);
+static int init_dio_context(comedi_device *dev);
+static int init_cnt_context(comedi_device *dev);
+static int xilinx_download(comedi_device *dev);
+static int reset_board(comedi_device *dev);
-static int me4000_dio_insn_bits(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+static int me4000_dio_insn_bits(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
-static int me4000_dio_insn_config(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+static int me4000_dio_insn_config(comedi_device *dev,
+ 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);
-static int me4000_cnt_insn_config(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+static int me4000_cnt_insn_config(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
-static int me4000_cnt_insn_write(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+static int me4000_cnt_insn_write(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
-static int me4000_cnt_insn_read(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+static int me4000_cnt_insn_read(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
-static int me4000_ai_insn_read(comedi_device * dev,
- comedi_subdevice * subdevice, comedi_insn * insn, lsampl_t * data);
+static int me4000_ai_insn_read(comedi_device *dev,
+ 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,
- comedi_subdevice * s, comedi_cmd * cmd);
+static int ai_check_chanlist(comedi_device *dev,
+ comedi_subdevice *s, comedi_cmd *cmd);
-static int ai_round_cmd_args(comedi_device * dev,
- comedi_subdevice * s,
- comedi_cmd * cmd,
+static int ai_round_cmd_args(comedi_device *dev,
+ comedi_subdevice *s,
+ comedi_cmd *cmd,
unsigned int *init_ticks,
unsigned int *scan_ticks, unsigned int *chan_ticks);
-static int ai_prepare(comedi_device * dev,
- comedi_subdevice * s,
- comedi_cmd * cmd,
+static int ai_prepare(comedi_device *dev,
+ comedi_subdevice *s,
+ comedi_cmd *cmd,
unsigned int init_ticks,
unsigned int scan_ticks, unsigned int chan_ticks);
-static int ai_write_chanlist(comedi_device * dev,
- comedi_subdevice * s, comedi_cmd * cmd);
+static int ai_write_chanlist(comedi_device *dev,
+ comedi_subdevice *s, comedi_cmd *cmd);
static irqreturn_t me4000_ai_isr(int irq, void *dev_id PT_REGS_ARG);
-static int me4000_ai_do_cmd_test(comedi_device * dev,
- comedi_subdevice * s, comedi_cmd * cmd);
+static int me4000_ai_do_cmd_test(comedi_device *dev,
+ 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,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+static int me4000_ao_insn_write(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
-static int me4000_ao_insn_read(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data);
+static int me4000_ao_insn_read(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data);
/*-----------------------------------------------------------------------------
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)
{
PORT_PDEBUG("--> 0x%02X port 0x%04lX\n", 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)
{
PORT_PDEBUG("--> 0x%08lX port 0x%04lX\n", 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;
value = inl(port);
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;
value = inb(port);
}
};
-static int me4000_attach(comedi_device * dev, comedi_devconfig * it)
+static int me4000_attach(comedi_device *dev, comedi_devconfig *it)
{
comedi_subdevice *s;
int result;
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;
int result, i;
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");
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;
return 0;
}
-static int init_ao_context(comedi_device * dev)
+static int init_ao_context(comedi_device *dev)
{
int i;
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");
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");
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");
extern unsigned char *xilinx_firm;
#endif
-static int xilinx_download(comedi_device * dev)
+static int xilinx_download(comedi_device *dev)
{
u32 value = 0;
wait_queue_head_t queue;
return 0;
}
-static int reset_board(comedi_device * dev)
+static int reset_board(comedi_device *dev)
{
unsigned long icr;
return 0;
}
-static int me4000_detach(comedi_device * dev)
+static int me4000_detach(comedi_device *dev)
{
CALL_PDEBUG("In me4000_detach()\n");
Analog input section
===========================================================================*/
-static int me4000_ai_insn_read(comedi_device * dev,
- comedi_subdevice * subdevice, comedi_insn * insn, lsampl_t * data)
+static int me4000_ai_insn_read(comedi_device *dev,
+ comedi_subdevice *subdevice, comedi_insn *insn, lsampl_t *data)
{
int chan = CR_CHAN(insn->chanspec);
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;
return 0;
}
-static int ai_check_chanlist(comedi_device * dev,
- comedi_subdevice * s, comedi_cmd * cmd)
+static int ai_check_chanlist(comedi_device *dev,
+ comedi_subdevice *s, comedi_cmd *cmd)
{
int aref;
int i;
return 0;
}
-static int ai_round_cmd_args(comedi_device * dev,
- comedi_subdevice * s,
- comedi_cmd * cmd,
+static int ai_round_cmd_args(comedi_device *dev,
+ comedi_subdevice *s,
+ comedi_cmd *cmd,
unsigned int *init_ticks,
unsigned int *scan_ticks, unsigned int *chan_ticks)
{
return 0;
}
-static void ai_write_timer(comedi_device * dev,
+static void ai_write_timer(comedi_device *dev,
unsigned int init_ticks,
unsigned int scan_ticks, unsigned int chan_ticks)
{
me4000_outl(dev, chan_ticks - 1, info->ai_context.chan_timer_reg);
}
-static int ai_prepare(comedi_device * dev,
- comedi_subdevice * s,
- comedi_cmd * cmd,
+static int ai_prepare(comedi_device *dev,
+ comedi_subdevice *s,
+ comedi_cmd *cmd,
unsigned int init_ticks,
unsigned int scan_ticks, unsigned int chan_ticks)
{
return 0;
}
-static int ai_write_chanlist(comedi_device * dev,
- comedi_subdevice * s, comedi_cmd * cmd)
+static int ai_write_chanlist(comedi_device *dev,
+ comedi_subdevice *s, comedi_cmd *cmd)
{
unsigned int entry;
unsigned int chan;
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;
unsigned int init_ticks = 0;
* - invalid chanlist
* So I tried to adopt this scheme.
*/
-static int me4000_ai_do_cmd_test(comedi_device * dev,
- comedi_subdevice * s, comedi_cmd * cmd)
+static int me4000_ai_do_cmd_test(comedi_device *dev,
+ comedi_subdevice *s, comedi_cmd *cmd)
{
unsigned int init_ticks;
Analog output section
===========================================================================*/
-static int me4000_ao_insn_write(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+static int me4000_ao_insn_write(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{
int chan = CR_CHAN(insn->chanspec);
return 1;
}
-static int me4000_ao_insn_read(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+static int me4000_ao_insn_read(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{
int chan = CR_CHAN(insn->chanspec);
Digital I/O section
===========================================================================*/
-static int me4000_dio_insn_bits(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+static int me4000_dio_insn_bits(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{
CALL_PDEBUG("In me4000_dio_insn_bits()\n");
return 2;
}
-static int me4000_dio_insn_config(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+static int me4000_dio_insn_config(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{
unsigned long tmp;
int chan = CR_CHAN(insn->chanspec);
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");
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)
{
int tmp = 0;
return 0;
}
-static int me4000_cnt_insn_config(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+static int me4000_cnt_insn_config(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{
int err;
return 2;
}
-static int me4000_cnt_insn_read(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+static int me4000_cnt_insn_read(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{
unsigned short tmp;
return 1;
}
-static int me4000_cnt_insn_write(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+static int me4000_cnt_insn_write(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{
unsigned short tmp;
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 +
MITE_FCR(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;
return readl(mite->mite_io_addr +
}
/* 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;
}
/* 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;
}
/* 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;
}
/* 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;
void mite_prep_dma(struct mite_channel *mite_chan,
unsigned int num_device_bits, unsigned int num_memory_bits);
int mite_buf_change(struct mite_dma_descriptor_ring *ring,
- comedi_async * async);
+ comedi_async *async);
#ifdef DEBUG_MITE
void mite_print_chsr(unsigned int chsr);
* the board, and also about the kernel module that contains
* the device code.
*/
-static int rtd_attach(comedi_device * dev, comedi_devconfig * it);
-static int rtd_detach(comedi_device * dev);
+static int rtd_attach(comedi_device *dev, comedi_devconfig *it);
+static int rtd_detach(comedi_device *dev);
static comedi_driver rtd520Driver = {
driver_name: DRV_NAME,
detach:rtd_detach,
};
-static int rtd_ai_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
-static int rtd_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
-static int rtd_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
-static int rtd_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
-static int rtd_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
-static int rtd_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
- comedi_cmd * cmd);
-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_rinsn(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data);
+static int rtd_ao_winsn(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data);
+static int rtd_ao_rinsn(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data);
+static int rtd_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data);
+static int rtd_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data);
+static int rtd_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
+ comedi_cmd *cmd);
+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_poll (comedi_device *dev,comedi_subdevice *s); */
static int rtd_ns_to_timer(unsigned int *ns, int roundMode);
static irqreturn_t rtd_interrupt(int irq, void *d PT_REGS_ARG);
* in the driver structure, dev->board_ptr contains that
* 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 */
comedi_subdevice *s;
struct pci_dev *pcidev;
* allocated by _attach(). dev->private and dev->subdevices are
* deallocated automatically by the core.
*/
-static int rtd_detach(comedi_device * dev)
+static int rtd_detach(comedi_device *dev)
{
#ifdef USE_DMA
int index;
/*
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)
{ /* index in channel list */
unsigned int chan, range, aref;
/*
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)
{
if (n_chan > 1) { /* setup channel gain table */
Note, we don't do any settling delays. Use a instruction list to
select, delay, then read.
*/
-static int rtd_ai_rinsn(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+static int rtd_ai_rinsn(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{
int n, ii;
int stat;
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;
/*
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 */
sampl_t sample;
/*
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 */
unsigned long dma_cs_addr; /* the control/status register */
uint8_t status;
Process what is in the DMA transfer buffer and pass to comedi
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;
s16 *dp;
/*
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 */
/* Not sure what to do if DMA is active */
the command passes.
*/
-static int rtd_ai_cmdtest(comedi_device * dev,
- comedi_subdevice * s, comedi_cmd * cmd)
+static int rtd_ai_cmdtest(comedi_device *dev,
+ comedi_subdevice *s, comedi_cmd *cmd)
{
int err = 0;
int tmp;
This is usually done by an interrupt handler.
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;
int timer;
/*
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;
/*
Output one (or more) analog values to a single port as fast as possible.
*/
-static int rtd_ao_winsn(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+static int rtd_ao_winsn(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
/* AO subdevices should have a read insn as well as a write insn.
* Usually this means copying a value stored in devpriv. */
-static int rtd_ao_rinsn(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+static int rtd_ao_rinsn(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{
int i;
int chan = CR_CHAN(insn->chanspec);
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write
*/
-static int rtd_dio_insn_bits(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+static int rtd_dio_insn_bits(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{
if (insn->n != 2)
return -EINVAL;
/*
Configure one bit on a IO port as Input or Output (hence the name :-).
*/
-static int rtd_dio_insn_config(comedi_device * dev,
- comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
+static int rtd_dio_insn_config(comedi_device *dev,
+ comedi_subdevice *s, comedi_insn *insn, lsampl_t *data)
{
int chan = CR_CHAN(insn->chanspec);
MODULE_DEVICE_TABLE(pci, s626_pci_table);
-static int s626_attach(comedi_device * dev, comedi_devconfig * it);
-static int s626_detach(comedi_device * dev);
+static int s626_attach(comedi_device *dev, comedi_devconfig *it);
+static int s626_detach(comedi_device *dev);
static comedi_driver driver_s626 = {
driver_name:"s626",
COMEDI_PCI_INITCLEANUP_NOMODULE(driver_s626, s626_pci_table);
/* ioctl routines */
-static int s626_ai_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+static int s626_ai_insn_config(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,
- comedi_insn * insn, lsampl_t * data);
-static int s626_ai_cmd(comedi_device * dev, comedi_subdevice * s);
-static int s626_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
- comedi_cmd * cmd);
-static int s626_ai_cancel(comedi_device * dev, comedi_subdevice * s);
-static int s626_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
-static int s626_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
-static int s626_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
-static int s626_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
-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_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data);
+static int s626_ai_cmd(comedi_device *dev, comedi_subdevice *s);
+static int s626_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
+ comedi_cmd *cmd);
+static int s626_ai_cancel(comedi_device *dev, comedi_subdevice *s);
+static int s626_ao_winsn(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data);
+static int s626_ao_rinsn(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data);
+static int s626_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data);
+static int s626_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data);
+static int s626_dio_set_irq(comedi_device *dev, unsigned int chan);
+static int s626_dio_reset_irq(comedi_device *dev, unsigned int gruop,
unsigned int mask);
-static int s626_dio_clear_irq(comedi_device * dev);
-static int s626_enc_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
-static int s626_enc_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
-static int s626_enc_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data);
+static int s626_dio_clear_irq(comedi_device *dev);
+static int s626_enc_insn_config(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data);
+static int s626_enc_insn_read(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data);
+static int s626_enc_insn_write(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data);
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_inttrig(comedi_device * dev, comedi_subdevice * s,
+static int s626_ai_load_polllist(uint8_t *ppl, comedi_cmd *cmd);
+static int s626_ai_inttrig(comedi_device *dev, comedi_subdevice *s,
unsigned int trignum);
static irqreturn_t s626_irq_handler(int irq, void *d PT_REGS_ARG);
static lsampl_t s626_ai_reg_to_uint(int data);
/* end ioctl routines */
/* internal routines */
-static void s626_dio_init(comedi_device * dev);
-static void ResetADC(comedi_device * dev, uint8_t * ppl);
-static void LoadTrimDACs(comedi_device * dev);
-static void WriteTrimDAC(comedi_device * dev, uint8_t LogicalChan,
+static void s626_dio_init(comedi_device *dev);
+static void ResetADC(comedi_device *dev, uint8_t *ppl);
+static void LoadTrimDACs(comedi_device *dev);
+static void WriteTrimDAC(comedi_device *dev, uint8_t LogicalChan,
uint8_t DacData);
-static uint8_t I2Cread(comedi_device * dev, uint8_t addr);
-static uint32_t I2Chandshake(comedi_device * dev, uint32_t val);
-static void SetDAC(comedi_device * dev, uint16_t chan, short dacdata);
-static void SendDAC(comedi_device * dev, uint32_t val);
-static void WriteMISC2(comedi_device * dev, uint16_t NewImage);
-static void DEBItransfer(comedi_device * dev);
-static uint16_t DEBIread(comedi_device * dev, uint16_t addr);
-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 uint8_t I2Cread(comedi_device *dev, uint8_t addr);
+static uint32_t I2Chandshake(comedi_device *dev, uint32_t val);
+static void SetDAC(comedi_device *dev, uint16_t chan, short dacdata);
+static void SendDAC(comedi_device *dev, uint32_t val);
+static void WriteMISC2(comedi_device *dev, uint16_t NewImage);
+static void DEBItransfer(comedi_device *dev);
+static uint16_t DEBIread(comedi_device *dev, uint16_t addr);
+static void DEBIwrite(comedi_device *dev, uint16_t addr, uint16_t wdata);
+static void DEBIreplace(comedi_device *dev, uint16_t addr, uint16_t mask,
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 ------------------------------------------------ */
typedef struct enc_private_struct {
/* 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(*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(*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 (*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 (*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 (*ResetCapFlags) (comedi_device * dev, struct enc_private_struct *); /* Reset event capture flags. */
+ 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(*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. */
+ 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 (*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 (*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. */
uint16_t MyCRA; /* Address of CRA register. */
uint16_t MyCRB; /* Address of CRB register. */
#define encpriv ((enc_private *)(dev->subdevices+5)->private)
/* counters routines */
-static void s626_timer_load(comedi_device * dev, enc_private * k, int tick);
-static uint32_t ReadLatch(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 uint16_t GetMode_A(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 s626_timer_load(comedi_device *dev, enc_private *k, int tick);
+static uint32_t ReadLatch(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 uint16_t GetMode_A(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,
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);
-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 uint16_t GetEnable_A(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 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 uint16_t GetEnable_A(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,
uint16_t value);
/* 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_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_B(comedi_device * dev, enc_private * k);
-static void SetIntSrc_B(comedi_device * dev, enc_private * k,
+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 uint16_t GetLoadTrig_A(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,
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);
-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_A(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 uint16_t GetClkMult(comedi_device *dev, enc_private *k ) ; */
/* static void SetIndexPol(comedi_device *dev, enc_private *k, uint16_t value ); */
/* static uint16_t GetClkSrc( comedi_device *dev,enc_private *k ); */
/* static void SetIndexSrc( comedi_device *dev,enc_private *k, uint16_t value ); */
/* static uint16_t GetIndexSrc( 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 Preload(comedi_device * dev, enc_private * k, uint32_t value);
-static void CountersInit(comedi_device * dev);
+static void PulseIndex_A(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 CountersInit(comedi_device *dev);
/* end internal routines */
/* Counter objects constructor. */
}
};
-static int s626_attach(comedi_device * dev, comedi_devconfig * it)
+static int s626_attach(comedi_device *dev, comedi_devconfig *it)
{
/* uint8_t PollList; */
/* uint16_t AdcData; */
return IRQ_HANDLED;
}
-static int s626_detach(comedi_device * dev)
+static int s626_detach(comedi_device *dev)
{
if (devpriv) {
/* stop ai_command */
/*
* 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;
uint32_t JmpAdrs;
}
/* TO COMPLETE, IF NECESSARY */
-static int s626_ai_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int s626_ai_insn_config(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
return -EINVAL;
/* return i; */
/* } */
-static int s626_ai_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int s626_ai_insn_read(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
uint16_t chan = CR_CHAN(insn->chanspec);
uint16_t range = CR_RANGE(insn->chanspec);
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;
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)
{
if (trignum != 0)
}
/* 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];
return 0;
}
-static int s626_ai_cmdtest(comedi_device * dev, comedi_subdevice * s,
- comedi_cmd * cmd)
+static int s626_ai_cmdtest(comedi_device *dev, comedi_subdevice *s,
+ comedi_cmd *cmd)
{
int err = 0;
int tmp;
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. */
MC_DISABLE(P_MC1, MC1_ERPS1);
return divider - 1;
}
-static int s626_ao_winsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int s626_ao_winsn(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
int i;
return i;
}
-static int s626_ao_rinsn(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int s626_ao_rinsn(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
int i;
* 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;
comedi_subdevice *s;
* This allows packed reading/writing of the DIO channels. The comedi
* core can convert between insn_bits and insn_read/write */
-static int s626_dio_insn_bits(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int s626_dio_insn_bits(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
/* Length of data must be 2 (mask and new data, see below) */
return 2;
}
-static int s626_dio_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int s626_dio_insn_config(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
switch (data[0]) {
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 bitmask;
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)
{
DEBUG("s626_dio_reset_irq: disable interrupt on dio channel %d group %d\n", mask, group);
return 0;
}
-static int s626_dio_clear_irq(comedi_device * dev)
+static int s626_dio_clear_irq(comedi_device *dev)
{
unsigned int group;
/* Now this function initializes the value of the counter (data[0])
and set the subdevice. To complete with trigger and interrupt
configuration */
-static int s626_enc_insn_config(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int s626_enc_insn_config(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
uint16_t Setup = (LOADSRC_INDX << BF_LOADSRC) | /* Preload upon */
/* index. */
return insn->n;
}
-static int s626_enc_insn_read(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int s626_enc_insn_read(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
int n;
return n;
}
-static int s626_enc_insn_write(comedi_device * dev, comedi_subdevice * s,
- comedi_insn * insn, lsampl_t * data)
+static int s626_enc_insn_write(comedi_device *dev, comedi_subdevice *s,
+ comedi_insn *insn, lsampl_t *data)
{
enc_private *k = &encpriv[CR_CHAN(insn->chanspec)];
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 */
/* index. */
static uint8_t trimadrs[] =
{ 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;
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)
{
uint32_t chan;
/* ************** EEPROM ACCESS FUNCTIONS ************** */
/* 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;
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. */
WR7146(P_I2CCTRL, val);
/* 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 uint32_t WSImage;
* 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 ------------- */
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 */
/* MISC2 register. */
/* 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;
/* Execute a DEBI transfer. This must be called from within a */
/* critical section. */
-static void DEBItransfer(comedi_device * dev)
+static void DEBItransfer(comedi_device *dev)
{
/* Initiate upload of shadow RAM to DEBI control register. */
MC_ENABLE(P_MC2, MC2_UPLD_DEBI);
}
/* 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. */
* specifies bits that are to be preserved, wdata is new value to be
* 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)
{
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;
dma_addr_t vpptr;
/* 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;
/* DEBUG FIXME DEBUG("ReadLatch: Read Latch enter\n"); */
/* 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),
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),
CRBMSK_INTRESETCMD | CRBMSK_INTRESET_B);
/* Return counter setup in a format (COUNTER_SETUP) that is consistent */
/* 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 crb;
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 crb;
* 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)
{
register uint16_t cra;
(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)
{
register uint16_t cra;
/* 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");
DEBIreplace(dev, k->MyCRB,
(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,
(uint16_t) (~(CRBMSK_INTCTRL | CRBMSK_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;
}
-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;
}
* 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");
DEBIreplace(dev, k->MyCRB,
* 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),
(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,
(uint16_t) (~(CRBMSK_LOADSRC_B | CRBMSK_INTCTRL)),
(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;
}
-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;
}
* 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)
{
/* Reset any pending counter overflow or index captures. */
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 crb;
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;
}
-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;
}
/* 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;
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;
/* 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");
DEBIwrite(dev, (uint16_t) (k->MyLatchLsw), (uint16_t) value); /* Write value to preload register. */
(uint16_t) (value >> 16));
}
-static void CountersInit(comedi_device * dev)
+static void CountersInit(comedi_device *dev)
{
int chan;
enc_private *k;
#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)
{
comedi_insn insn;
return comedi_do_insn(dev, &insn);
}
-int comedi_data_read(comedi_t * dev, unsigned int subdev, unsigned int chan,
- unsigned int range, unsigned int aref, lsampl_t * data)
+int comedi_data_read(comedi_t *dev, unsigned int subdev, unsigned int chan,
+ unsigned int range, unsigned int aref, lsampl_t *data)
{
comedi_insn 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)
{
comedi_insn 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,
- lsampl_t * data, unsigned int nano_sec)
+ lsampl_t *data, unsigned int nano_sec)
{
int retval;
#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)
{
comedi_insn 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)
{
comedi_insn 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)
{
comedi_insn 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)
{
comedi_insn insn;
#include "../comedilib.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;
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 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_subdevice *s = dev->subdevices + subdevice;
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_subdevice *s = dev->subdevices + subdevice;
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;
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_subdevice *s = dev->subdevices + subdevice;
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_subdevice *s = dev->subdevices + subdevice;
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)
{
comedi_device *dev = (comedi_device *) d;
}
#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)
{
comedi_device *dev = (comedi_device *) d;
}
#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_subdevice *s = dev->subdevices + subdevice;
/*
* ALPHA (non-portable)
*/
-int comedi_get_krange(comedi_t * d, unsigned int subdevice, unsigned int chan,
- unsigned int range, comedi_krange * krange)
+int comedi_get_krange(comedi_t *d, unsigned int subdevice, unsigned int chan,
+ unsigned int range, comedi_krange *krange)
{
comedi_device *dev = (comedi_device *) d;
comedi_subdevice *s = dev->subdevices + subdevice;
/*
* 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_subdevice *s = dev->subdevices + subdevice;
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_subdevice *s = dev->subdevices + subdevice;
/*
* 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)
{
comedi_device *dev = (comedi_device *) d;
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)
{
comedi_device *dev = (comedi_device *) d;
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)
{
comedi_device *dev = (comedi_device *) d;
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_subdevice *s = dev->subdevices + subdev;
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_subdevice *s = dev->subdevices + subdevice;
return (comedi_t *) dev;
}
-int comedi_close(comedi_t * d)
+int comedi_close(comedi_t *d)
{
comedi_device *dev = (comedi_device *) d;
return "unknown error";
}
-int comedi_fileno(comedi_t * d)
+int comedi_fileno(comedi_t *d)
{
comedi_device *dev = (comedi_device *) d;
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_subdevice *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_subdevice *s;
* COMEDI_INSN
* 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_subdevice *s;
- 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_subdevice *s;
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_subdevice *s;
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_subdevice *s;
/*
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)
{
comedi_device *dev = (comedi_device *) d;
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_subdevice *s = dev->subdevices;
}
/* 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_subdevice *s;
}
/* 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_subdevice *s;
writes:
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;
int subd, chan;
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;
This function checks each element in a channel/gain list to make
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 chan;
int comedi_request_irq(unsigned irq, irqreturn_t(*handler) (int,
void *PT_REGS_ARG), unsigned long flags, const char *device,
- comedi_device * dev_id)
+ comedi_device *dev_id)
{
struct comedi_irq_struct *it;
int ret;
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;
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;
unsigned long flags;
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;
unsigned long flags;
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);
}