linux/drivers/comedi/drivers/dmm32at.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * dmm32at.c
 * Diamond Systems Diamond-MM-32-AT Comedi driver
 *
 * COMEDI - Linux Control and Measurement Device Interface
 * Copyright (C) 2000 David A. Schleef <[email protected]>
 */

/*
 * Driver: dmm32at
 * Description: Diamond Systems Diamond-MM-32-AT
 * Devices: [Diamond Systems] Diamond-MM-32-AT (dmm32at)
 * Author: Perry J. Piplani <[email protected]>
 * Updated: Fri Jun  4 09:13:24 CDT 2004
 * Status: experimental
 *
 * Configuration Options:
 *	comedi_config /dev/comedi0 dmm32at baseaddr,irq
 *
 * This driver is for the Diamond Systems MM-32-AT board
 *	http://www.diamondsystems.com/products/diamondmm32at
 *
 * It is being used on several projects inside NASA, without
 * problems so far. For analog input commands, TRIG_EXT is not
 * yet supported.
 */

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

/* Board register addresses */
#define DMM32AT_AI_START_CONV_REG
#define DMM32AT_AI_LSB_REG
#define DMM32AT_AUX_DOUT_REG
#define DMM32AT_AUX_DOUT2
#define DMM32AT_AUX_DOUT1
#define DMM32AT_AUX_DOUT0
#define DMM32AT_AI_MSB_REG
#define DMM32AT_AI_LO_CHAN_REG
#define DMM32AT_AI_HI_CHAN_REG
#define DMM32AT_AUX_DI_REG
#define DMM32AT_AUX_DI_DACBUSY
#define DMM32AT_AUX_DI_CALBUSY
#define DMM32AT_AUX_DI3
#define DMM32AT_AUX_DI2
#define DMM32AT_AUX_DI1
#define DMM32AT_AUX_DI0
#define DMM32AT_AO_LSB_REG
#define DMM32AT_AO_MSB_REG
#define DMM32AT_AO_MSB_DACH(x)
#define DMM32AT_FIFO_DEPTH_REG
#define DMM32AT_FIFO_CTRL_REG
#define DMM32AT_FIFO_CTRL_FIFOEN
#define DMM32AT_FIFO_CTRL_SCANEN
#define DMM32AT_FIFO_CTRL_FIFORST
#define DMM32AT_FIFO_STATUS_REG
#define DMM32AT_FIFO_STATUS_EF
#define DMM32AT_FIFO_STATUS_HF
#define DMM32AT_FIFO_STATUS_FF
#define DMM32AT_FIFO_STATUS_OVF
#define DMM32AT_FIFO_STATUS_FIFOEN
#define DMM32AT_FIFO_STATUS_SCANEN
#define DMM32AT_FIFO_STATUS_PAGE_MASK
#define DMM32AT_CTRL_REG
#define DMM32AT_CTRL_RESETA
#define DMM32AT_CTRL_RESETD
#define DMM32AT_CTRL_INTRST
#define DMM32AT_CTRL_PAGE(x)
#define DMM32AT_CTRL_PAGE_8254
#define DMM32AT_CTRL_PAGE_8255
#define DMM32AT_CTRL_PAGE_CALIB
#define DMM32AT_AI_STATUS_REG
#define DMM32AT_AI_STATUS_STS
#define DMM32AT_AI_STATUS_SD1
#define DMM32AT_AI_STATUS_SD0
#define DMM32AT_AI_STATUS_ADCH_MASK
#define DMM32AT_INTCLK_REG
#define DMM32AT_INTCLK_ADINT
#define DMM32AT_INTCLK_DINT
#define DMM32AT_INTCLK_TINT
#define DMM32AT_INTCLK_CLKEN
#define DMM32AT_INTCLK_CLKSEL
#define DMM32AT_CTRDIO_CFG_REG
#define DMM32AT_CTRDIO_CFG_FREQ12
#define DMM32AT_CTRDIO_CFG_FREQ0
#define DMM32AT_CTRDIO_CFG_OUT2EN
#define DMM32AT_CTRDIO_CFG_OUT0EN
#define DMM32AT_CTRDIO_CFG_GT0EN
#define DMM32AT_CTRDIO_CFG_SRC0
#define DMM32AT_CTRDIO_CFG_GT12EN
#define DMM32AT_AI_CFG_REG
#define DMM32AT_AI_CFG_SCINT(x)
#define DMM32AT_AI_CFG_SCINT_20US
#define DMM32AT_AI_CFG_SCINT_15US
#define DMM32AT_AI_CFG_SCINT_10US
#define DMM32AT_AI_CFG_SCINT_5US
#define DMM32AT_AI_CFG_RANGE
#define DMM32AT_AI_CFG_ADBU
#define DMM32AT_AI_CFG_GAIN(x)
#define DMM32AT_AI_READBACK_REG
#define DMM32AT_AI_READBACK_WAIT
#define DMM32AT_AI_READBACK_RANGE
#define DMM32AT_AI_READBACK_ADBU
#define DMM32AT_AI_READBACK_GAIN_MASK

#define DMM32AT_CLK1
#define DMM32AT_CLK2
#define DMM32AT_CLKCT

#define DMM32AT_8255_IOBASE

/* Board register values. */

/* DMM32AT_AI_CFG_REG 0x0b */
#define DMM32AT_RANGE_U10
#define DMM32AT_RANGE_U5
#define DMM32AT_RANGE_B10
#define DMM32AT_RANGE_B5

/* DMM32AT_CLKCT 0x0f */
#define DMM32AT_CLKCT1
#define DMM32AT_CLKCT2

/* board AI ranges in comedi structure */
static const struct comedi_lrange dmm32at_airanges =;

/* register values for above ranges */
static const unsigned char dmm32at_rangebits[] =;

/* only one of these ranges is valid, as set by a jumper on the
 * board. The application should only use the range set by the jumper
 */
static const struct comedi_lrange dmm32at_aoranges =;

static void dmm32at_ai_set_chanspec(struct comedi_device *dev,
				    struct comedi_subdevice *s,
				    unsigned int chanspec, int nchan)
{}

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

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

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

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

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

static void dmm32at_setaitimer(struct comedi_device *dev, unsigned int nansec)
{}

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

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

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

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

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

static int dmm32at_8255_io(struct comedi_device *dev,
			   int dir, int port, int data, unsigned long regbase)
{}

/* Make sure the board is there and put it to a known state */
static int dmm32at_reset(struct comedi_device *dev)
{}

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

static struct comedi_driver dmm32at_driver =;
module_comedi_driver();

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