return 5;
return 0;
-
}
static int pci9111_ai_do_cmd(struct comedi_device *dev,
array[i] ^= 0x8000;
else
array[i] = (array[i] >> 4) & 0x0fff;
-
}
}
13-oct-2007
+ first try
-
-
*/
#include <linux/module.h>
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
-
/* only bits 0-4 have information about digital inputs */
data[1] = (inb(dev->iobase + ADQ12B_STINR) & ADQ12B_STINR_IN_MASK);
for (i = 0; i < d->regs; i++)
data[1] |= inb(dev->iobase + d->addr + i) << (8 * i);
-
return insn->n;
}
}
module_exit(amplc_pc236_common_exit);
-
MODULE_AUTHOR("Comedi http://www.comedi.org");
MODULE_DESCRIPTION("Comedi helper for amplc_pc236 and amplc_pci236");
MODULE_LICENSE("GPL");
if (!test_and_clear_bit(AO_CMD_STARTED, &devpriv->state))
return;
-
spin_lock_irqsave(&devpriv->ao_spinlock, flags);
/* Kill the interrupts. */
devpriv->intsce = 0;
if (!devpriv->ao_scan_vals)
return -ENOMEM;
-
/* Allocate buffer to hold AO channel scan order. */
devpriv->ao_scan_order = kmalloc(sizeof(devpriv->ao_scan_order[0]) *
thisboard->ao_chans, GFP_KERNEL);
if (!devpriv->ao_scan_order)
return -ENOMEM;
-
/* Disable interrupt sources. */
devpriv->intsce = 0;
outb(0, devpriv->iobase1 + PCI224_INT_SCE);
Author: ds
Updated: Mon, 04 Nov 2002 20:04:21 -0800
Status: experimental
-
-
*/
#include <linux/module.h>
&devpriv->ai_buffer_bus_addr[i]);
if (!devpriv->ai_buffer[i])
return -ENOMEM;
-
}
for (i = 0; i < AO_DMA_RING_COUNT; i++) {
if (ao_cmd_is_supported(thisboard)) {
ao_buffer_bus_addr[i]);
if (!devpriv->ao_buffer[i])
return -ENOMEM;
-
}
}
/* allocate dma descriptors */
}
for (n = 0; n < insn->n; n++) {
-
/* clear adc buffer (inside loop for 4020 sake) */
writew(0, devpriv->main_iobase + ADC_BUFFER_CLEAR_REG);
retval = set_ai_fifo_size(dev, fifo_size);
if (retval < 0)
return retval;
-
}
block_size = ai_fifo_size(dev) / fifo->num_segments * bytes_in_sample;
strlcat(devpriv->name, buf,
sizeof(devpriv->name));
}
-
}
}
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{
-
data[1] = inb(dev->iobase + DAS1800_DIGITAL) & 0xf;
data[0] = 0;
The cio-das802/16 does not have a fifo-empty status bit! Therefore
only fifo-half-full transfers are possible with this card.
-*/
-/*
cmd triggers supported:
start_src: TRIG_NOW | TRIG_EXT
scan_end_src: TRIG_COUNT
convert_src: TRIG_TIMER | TRIG_EXT
stop_src: TRIG_NONE | TRIG_COUNT
-
-
*/
#include <linux/module.h>
}
return 0;
-
}
static int dmm32at_ai_cancel(struct comedi_device *dev,
};
struct dt2801_board {
-
const char *name;
int boardcode;
int ad_diff;
#define DT2811_ADMODE 0x03
struct dt2811_board {
-
const char *name;
const struct comedi_lrange *bip_5;
const struct comedi_lrange *bip_2_5;
#define DT2814_CHANMASK 0x0f
struct dt2814_private {
-
int ntrig;
int curadchan;
};
outb(chan | DT2814_ENB | (trigvar << 5), dev->iobase + DT2814_CSR);
return 0;
-
}
static irqreturn_t dt2814_interrupt(int irq, void *d)
#define DT2815_STATUS 1
struct dt2815_private {
-
const struct comedi_lrange *range_type_list[8];
unsigned int ao_readback[8];
};
return 4;
return 0;
-
}
static int dt282x_ao_inttrig(struct comedi_device *dev,
return 5;
return 0;
-
}
/* setup dma descriptors so a link completes every 'len' bytes */
break;
default:
break;
-
}
return IRQ_HANDLED;
unsigned int *init_ticks,
unsigned int *scan_ticks, unsigned int *chan_ticks)
{
-
int rest;
*init_ticks = 0;
unsigned int init_ticks,
unsigned int scan_ticks, unsigned int chan_ticks)
{
-
unsigned int tmp = 0;
/* Write timer arguments */
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{
-
unsigned int init_ticks;
unsigned int chan_ticks;
unsigned int scan_ticks;
if (cmd->start_src == TRIG_NOW &&
cmd->scan_begin_src == TRIG_TIMER &&
cmd->convert_src == TRIG_TIMER) {
-
/* Check timer arguments */
if (init_ticks < ME4000_AI_MIN_TICKS) {
dev_err(dev->class_dev, "Invalid start arg\n");
} else if (cmd->start_src == TRIG_NOW &&
cmd->scan_begin_src == TRIG_FOLLOW &&
cmd->convert_src == TRIG_TIMER) {
-
/* Check timer arguments */
if (init_ticks < ME4000_AI_MIN_TICKS) {
dev_err(dev->class_dev, "Invalid start arg\n");
} else if (cmd->start_src == TRIG_EXT &&
cmd->scan_begin_src == TRIG_TIMER &&
cmd->convert_src == TRIG_TIMER) {
-
/* Check timer arguments */
if (init_ticks < ME4000_AI_MIN_TICKS) {
dev_err(dev->class_dev, "Invalid start arg\n");
} else if (cmd->start_src == TRIG_EXT &&
cmd->scan_begin_src == TRIG_FOLLOW &&
cmd->convert_src == TRIG_TIMER) {
-
/* Check timer arguments */
if (init_ticks < ME4000_AI_MIN_TICKS) {
dev_err(dev->class_dev, "Invalid start arg\n");
} else if (cmd->start_src == TRIG_EXT &&
cmd->scan_begin_src == TRIG_EXT &&
cmd->convert_src == TRIG_TIMER) {
-
/* Check timer arguments */
if (init_ticks < ME4000_AI_MIN_TICKS) {
dev_err(dev->class_dev, "Invalid start arg\n");
} else if (cmd->start_src == TRIG_EXT &&
cmd->scan_begin_src == TRIG_EXT &&
cmd->convert_src == TRIG_EXT) {
-
/* Check timer arguments */
if (init_ticks < ME4000_AI_MIN_TICKS) {
dev_err(dev->class_dev, "Invalid start arg\n");
else
devpriv->gpioc_R = devpriv->bar0_mem + MF624_GPIOC_R;
-
ret = comedi_alloc_subdevices(dev, 4);
if (ret)
return ret;
(MPC624_OSR4 | MPC624_OSR3 | MPC624_OSR2 | MPC624_OSR1 | MPC624_OSR0)
/* -------------------------------------------------------------------------- */
struct mpc624_private {
-
/* set by mpc624_attach() from driver's parameters */
unsigned long int ulConvertionRate;
};
}
struct NI_660xRegisterData {
-
const char *name; /* Register Name */
int offset; /* Offset from base address from GPCT chip */
enum ni_660x_register_direction direction;
for (i = 0; i < ARRAY_SIZE(ni_boards); i++) {
if (ni_boards[i].device_id == device_id)
return i;
-
}
if (device_id == 255)
dev_err(dev->class_dev, "can't find board\n");
if (ret < 0)
return ret;
-
return 0;
}
#define CLOCK_100_HZ 0x8F25
struct atmio16_board_t {
-
const char *name;
int has_8255;
};
}
if (dev->irq) {
-
/* interrupt on FIFO, errors, SC_TC */
interrupt_a_enable |= AI_Error_Interrupt_Enable |
AI_SC_TC_Interrupt_Enable;
default:
return -EINVAL;
}
-
}
static void init_ao_67xx(struct comedi_device *dev, struct comedi_subdevice *s)
return 0;
}
-
static void m_series_init_eeprom_buffer(struct comedi_device *dev)
{
struct ni_private *devpriv = dev->private;
if (err)
return 2;
-
/* Step 3: check if arguments are trivially valid */
err |= cfc_check_trigger_arg_is(&cmd->start_arg, 0);
if (err)
return 3;
-
/* step 4: fix up any arguments */
if (cmd->convert_src == TRIG_TIMER) {
unsigned int arg = cmd->convert_arg;
if (err)
return 4;
-
/* step 5: complain about special chanlist considerations */
if (cmd->chanlist) {
devpriv->interrupt_mode = semaphore;
for (i = 0; i < insn->n; i++) {
-
/* Start conversion */
outb(DAQP_COMMAND_ARM | DAQP_COMMAND_FIFO_DATA,
dev->iobase + DAQP_COMMAND);
if (err)
return 3;
-
/* step 4: fix up any arguments */
if (cmd->scan_begin_src == TRIG_TIMER) {
#include <linux/poll.h>
struct serial2002_range_table_t {
-
/* HACK... */
int length;
struct comedi_krange range;
};
struct serial2002_private {
-
int port; /* /dev/ttyS<port> */
int speed; /* baudrate */
struct file *tty;
}
}
return result;
-
}
static void serial2002_write(struct file *f, struct serial_data data)
outb(val, CSCDR);
return insn->n;
-
}
static int dnp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
*/
-
#include <linux/module.h>
#include <linux/delay.h>
#include "../comedidev.h"
static int __unioxx5_define_chan_offset(int chan_num)
{
-
if (chan_num < 0 || chan_num > 23)
return -1;
struct comedi_insn *insn,
unsigned int *data)
{
-
struct usbdux_private *devpriv = dev->private;
int ret;
/* step 4: fix up any arguments */
return 0;
-
}
static int usbduxfast_ai_inttrig(struct comedi_device *dev,