linux/drivers/comedi/drivers/das16m1.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Comedi driver for CIO-DAS16/M1
 * Author: Frank Mori Hess, based on code from the das16 driver.
 * Copyright (C) 2001 Frank Mori Hess <[email protected]>
 *
 * COMEDI - Linux Control and Measurement Device Interface
 * Copyright (C) 2000 David A. Schleef <[email protected]>
 */

/*
 * Driver: das16m1
 * Description: CIO-DAS16/M1
 * Author: Frank Mori Hess <[email protected]>
 * Devices: [Measurement Computing] CIO-DAS16/M1 (das16m1)
 * Status: works
 *
 * This driver supports a single board - the CIO-DAS16/M1. As far as I know,
 * there are no other boards that have the same register layout. Even the
 * CIO-DAS16/M1/16 is significantly different.
 *
 * I was _barely_ able to reach the full 1 MHz capability of this board, using
 * a hard real-time interrupt (set the TRIG_RT flag in your struct comedi_cmd
 * and use rtlinux or RTAI). The board can't do dma, so the bottleneck is
 * pulling the data across the ISA bus. I timed the interrupt handler, and it
 * took my computer ~470 microseconds to pull 512 samples from the board. So
 * at 1 Mhz sampling rate, expect your CPU to be spending almost all of its
 * time in the interrupt handler.
 *
 * This board has some unusual restrictions for its channel/gain list.  If the
 * list has 2 or more channels in it, then two conditions must be satisfied:
 * (1) - even/odd channels must appear at even/odd indices in the list
 * (2) - the list must have an even number of entries.
 *
 * Configuration options:
 *   [0] - base io address
 *   [1] - irq (optional, but you probably want it)
 *
 * irq can be omitted, although the cmd interface will not work without it.
 */

#include <linux/module.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/comedi/comedidev.h>
#include <linux/comedi/comedi_8255.h>
#include <linux/comedi/comedi_8254.h>

/*
 * Register map (dev->iobase)
 */
#define DAS16M1_AI_REG
#define DAS16M1_AI_TO_CHAN(x)
#define DAS16M1_AI_TO_SAMPLE(x)
#define DAS16M1_CS_REG
#define DAS16M1_CS_EXT_TRIG
#define DAS16M1_CS_OVRUN
#define DAS16M1_CS_IRQDATA
#define DAS16M1_DI_REG
#define DAS16M1_DO_REG
#define DAS16M1_CLR_INTR_REG
#define DAS16M1_INTR_CTRL_REG
#define DAS16M1_INTR_CTRL_PACER(x)
#define DAS16M1_INTR_CTRL_PACER_EXT
#define DAS16M1_INTR_CTRL_PACER_INT
#define DAS16M1_INTR_CTRL_PACER_MASK
#define DAS16M1_INTR_CTRL_IRQ(x)
#define DAS16M1_INTR_CTRL_INTE
#define DAS16M1_Q_ADDR_REG
#define DAS16M1_Q_REG
#define DAS16M1_Q_CHAN(x)
#define DAS16M1_Q_RANGE(x)
#define DAS16M1_8254_IOBASE1
#define DAS16M1_8254_IOBASE2
#define DAS16M1_8255_IOBASE
#define DAS16M1_8254_IOBASE3

#define DAS16M1_SIZE2

#define DAS16M1_AI_FIFO_SZ

static const struct comedi_lrange range_das16m1 =;

struct das16m1_private {};

static void das16m1_ai_set_queue(struct comedi_device *dev,
				 unsigned int *chanspec, unsigned int len)
{}

static void das16m1_ai_munge(struct comedi_device *dev,
			     struct comedi_subdevice *s,
			     void *data, unsigned int num_bytes,
			     unsigned int start_chan_index)
{}

static int das16m1_ai_check_chanlist(struct comedi_device *dev,
				     struct comedi_subdevice *s,
				     struct comedi_cmd *cmd)
{}

static int das16m1_ai_cmdtest(struct comedi_device *dev,
			      struct comedi_subdevice *s,
			      struct comedi_cmd *cmd)
{}

static int das16m1_ai_cmd(struct comedi_device *dev,
			  struct comedi_subdevice *s)
{}

static int das16m1_ai_cancel(struct comedi_device *dev,
			     struct comedi_subdevice *s)
{}

static int das16m1_ai_eoc(struct comedi_device *dev,
			  struct comedi_subdevice *s,
			  struct comedi_insn *insn,
			  unsigned long context)
{}

static int das16m1_ai_insn_read(struct comedi_device *dev,
				struct comedi_subdevice *s,
				struct comedi_insn *insn,
				unsigned int *data)
{}

static int das16m1_di_insn_bits(struct comedi_device *dev,
				struct comedi_subdevice *s,
				struct comedi_insn *insn,
				unsigned int *data)
{}

static int das16m1_do_insn_bits(struct comedi_device *dev,
				struct comedi_subdevice *s,
				struct comedi_insn *insn,
				unsigned int *data)
{}

static void das16m1_handler(struct comedi_device *dev, unsigned int status)
{}

static int das16m1_ai_poll(struct comedi_device *dev,
			   struct comedi_subdevice *s)
{}

static irqreturn_t das16m1_interrupt(int irq, void *d)
{}

static int das16m1_irq_bits(unsigned int irq)
{}

static int das16m1_attach(struct comedi_device *dev,
			  struct comedi_devconfig *it)
{}

static void das16m1_detach(struct comedi_device *dev)
{}

static struct comedi_driver das16m1_driver =;
module_comedi_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();