linux/drivers/comedi/drivers/dt3000.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * dt3000.c
 * Data Translation DT3000 series driver
 *
 * COMEDI - Linux Control and Measurement Device Interface
 * Copyright (C) 1999 David A. Schleef <[email protected]>
 */

/*
 * Driver: dt3000
 * Description: Data Translation DT3000 series
 * Devices: [Data Translation] DT3001 (dt3000), DT3001-PGL, DT3002, DT3003,
 *   DT3003-PGL, DT3004, DT3005, DT3004-200
 * Author: ds
 * Updated: Mon, 14 Apr 2008 15:41:24 +0100
 * Status: works
 *
 * Configuration Options: not applicable, uses PCI auto config
 *
 * There is code to support AI commands, but it may not work.
 *
 * AO commands are not supported.
 */

/*
 * The DT3000 series is Data Translation's attempt to make a PCI
 * data acquisition board.  The design of this series is very nice,
 * since each board has an on-board DSP (Texas Instruments TMS320C52).
 * However, a few details are a little annoying.  The boards lack
 * bus-mastering DMA, which eliminates them from serious work.
 * They also are not capable of autocalibration, which is a common
 * feature in modern hardware.  The default firmware is pretty bad,
 * making it nearly impossible to write an RT compatible driver.
 * It would make an interesting project to write a decent firmware
 * for these boards.
 *
 * Data Translation originally wanted an NDA for the documentation
 * for the 3k series.  However, if you ask nicely, they might send
 * you the docs without one, also.
 */

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

/*
 * PCI BAR0 - dual-ported RAM location definitions (dev->mmio)
 */
#define DPR_DAC_BUFFER
#define DPR_ADC_BUFFER
#define DPR_COMMAND
#define DPR_SUBSYS
#define DPR_SUBSYS_AI
#define DPR_SUBSYS_AO
#define DPR_SUBSYS_DIN
#define DPR_SUBSYS_DOUT
#define DPR_SUBSYS_MEM
#define DPR_SUBSYS_CT
#define DPR_ENCODE
#define DPR_PARAMS(x)
#define DPR_TICK_REG_LO
#define DPR_TICK_REG_HI
#define DPR_DA_BUF_FRONT
#define DPR_DA_BUF_REAR
#define DPR_AD_BUF_FRONT
#define DPR_AD_BUF_REAR
#define DPR_INT_MASK
#define DPR_INTR_FLAG
#define DPR_INTR_CMDONE
#define DPR_INTR_CTDONE
#define DPR_INTR_DAHWERR
#define DPR_INTR_DASWERR
#define DPR_INTR_DAEMPTY
#define DPR_INTR_ADHWERR
#define DPR_INTR_ADSWERR
#define DPR_INTR_ADFULL
#define DPR_RESPONSE_MBX
#define DPR_CMD_MBX
#define DPR_CMD_COMPLETION(x)
#define DPR_CMD_NOTPROCESSED
#define DPR_CMD_NOERROR
#define DPR_CMD_ERROR
#define DPR_CMD_NOTSUPPORTED
#define DPR_CMD_COMPLETION_MASK
#define DPR_CMD(x)
#define DPR_CMD_GETBRDINFO
#define DPR_CMD_CONFIG
#define DPR_CMD_GETCONFIG
#define DPR_CMD_START
#define DPR_CMD_STOP
#define DPR_CMD_READSINGLE
#define DPR_CMD_WRITESINGLE
#define DPR_CMD_CALCCLOCK
#define DPR_CMD_READEVENTS
#define DPR_CMD_WRITECTCTRL
#define DPR_CMD_READCTCTRL
#define DPR_CMD_WRITECT
#define DPR_CMD_READCT
#define DPR_CMD_WRITEDATA
#define DPR_CMD_READDATA
#define DPR_CMD_WRITEIO
#define DPR_CMD_READIO
#define DPR_CMD_WRITECODE
#define DPR_CMD_READCODE
#define DPR_CMD_EXECUTE
#define DPR_CMD_HALT
#define DPR_CMD_MASK

#define DPR_PARAM5_AD_TRIG(x)
#define DPR_PARAM5_AD_TRIG_INT
#define DPR_PARAM5_AD_TRIG_EXT
#define DPR_PARAM5_AD_TRIG_INT_RETRIG
#define DPR_PARAM5_AD_TRIG_EXT_RETRIG
#define DPR_PARAM5_AD_TRIG_INT_RETRIG2

#define DPR_PARAM6_AD_DIFF

#define DPR_AI_FIFO_DEPTH
#define DPR_AO_FIFO_DEPTH

#define DPR_EXTERNAL_CLOCK
#define DPR_RISING_EDGE

#define DPR_TMODE_MASK

#define DPR_CMD_TIMEOUT

static const struct comedi_lrange range_dt3000_ai =;

static const struct comedi_lrange range_dt3000_ai_pgl =;

enum dt3k_boardid {};

struct dt3k_boardtype {};

static const struct dt3k_boardtype dt3k_boardtypes[] =;

struct dt3k_private {};

static void dt3k_send_cmd(struct comedi_device *dev, unsigned int cmd)
{}

static unsigned int dt3k_readsingle(struct comedi_device *dev,
				    unsigned int subsys, unsigned int chan,
				    unsigned int gain)
{}

static void dt3k_writesingle(struct comedi_device *dev, unsigned int subsys,
			     unsigned int chan, unsigned int data)
{}

static void dt3k_ai_empty_fifo(struct comedi_device *dev,
			       struct comedi_subdevice *s)
{}

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

static int debug_n_ints;

/* FIXME! Assumes shared interrupt is for this card. */
/* What's this debug_n_ints stuff? Obviously needs some work... */
static irqreturn_t dt3k_interrupt(int irq, void *d)
{}

static int dt3k_ns_to_timer(unsigned int timer_base, unsigned int *nanosec,
			    unsigned int flags)
{}

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

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

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

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

static void dt3k_dio_config(struct comedi_device *dev, int bits)
{}

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

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

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

static int dt3000_auto_attach(struct comedi_device *dev,
			      unsigned long context)
{}

static struct comedi_driver dt3000_driver =;

static int dt3000_pci_probe(struct pci_dev *dev,
			    const struct pci_device_id *id)
{}

static const struct pci_device_id dt3000_pci_table[] =;
MODULE_DEVICE_TABLE(pci, dt3000_pci_table);

static struct pci_driver dt3000_pci_driver =;
module_comedi_pci_driver();

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