linux/drivers/comedi/drivers/dt282x.c

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

/*
 * Driver: dt282x
 * Description: Data Translation DT2821 series (including DT-EZ)
 * Author: ds
 * Devices: [Data Translation] DT2821 (dt2821), DT2821-F-16SE (dt2821-f),
 *   DT2821-F-8DI (dt2821-f), DT2821-G-16SE (dt2821-g),
 *   DT2821-G-8DI (dt2821-g), DT2823 (dt2823), DT2824-PGH (dt2824-pgh),
 *   DT2824-PGL (dt2824-pgl), DT2825 (dt2825), DT2827 (dt2827),
 *   DT2828 (dt2828), DT2928 (dt2829), DT21-EZ (dt21-ez), DT23-EZ (dt23-ez),
 *   DT24-EZ (dt24-ez), DT24-EZ-PGL (dt24-ez-pgl)
 * Status: complete
 * Updated: Wed, 22 Aug 2001 17:11:34 -0700
 *
 * Configuration options:
 *   [0] - I/O port base address
 *   [1] - IRQ (optional, required for async command support)
 *   [2] - DMA 1 (optional, required for async command support)
 *   [3] - DMA 2 (optional, required for async command support)
 *   [4] - AI jumpered for 0=single ended, 1=differential
 *   [5] - AI jumpered for 0=straight binary, 1=2's complement
 *   [6] - AO 0 data format (deprecated, see below)
 *   [7] - AO 1 data format (deprecated, see below)
 *   [8] - AI jumpered for 0=[-10,10]V, 1=[0,10], 2=[-5,5], 3=[0,5]
 *   [9] - AO channel 0 range (deprecated, see below)
 *   [10]- AO channel 1 range (deprecated, see below)
 *
 * Notes:
 *   - AO commands might be broken.
 *   - If you try to run a command on both the AI and AO subdevices
 *     simultaneously, bad things will happen.  The driver needs to
 *     be fixed to check for this situation and return an error.
 *   - AO range is not programmable. The AO subdevice has a range_table
 *     containing all the possible analog output ranges. Use the range
 *     that matches your board configuration to convert between data
 *     values and physical units. The format of the data written to the
 *     board is handled automatically based on the unipolar/bipolar
 *     range that is selected.
 */

#include <linux/module.h>
#include <linux/delay.h>
#include <linux/gfp.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/comedi/comedidev.h>
#include <linux/comedi/comedi_isadma.h>

/*
 * Register map
 */
#define DT2821_ADCSR_REG
#define DT2821_ADCSR_ADERR
#define DT2821_ADCSR_ADCLK
#define DT2821_ADCSR_MUXBUSY
#define DT2821_ADCSR_ADDONE
#define DT2821_ADCSR_IADDONE
#define DT2821_ADCSR_GS(x)
#define DT2821_ADCSR_CHAN(x)
#define DT2821_CHANCSR_REG
#define DT2821_CHANCSR_LLE
#define DT2821_CHANCSR_TO_PRESLA(x)
#define DT2821_CHANCSR_NUMB(x)
#define DT2821_ADDAT_REG
#define DT2821_DACSR_REG
#define DT2821_DACSR_DAERR
#define DT2821_DACSR_YSEL(x)
#define DT2821_DACSR_SSEL
#define DT2821_DACSR_DACRDY
#define DT2821_DACSR_IDARDY
#define DT2821_DACSR_DACLK
#define DT2821_DACSR_HBOE
#define DT2821_DACSR_LBOE
#define DT2821_DADAT_REG
#define DT2821_DIODAT_REG
#define DT2821_SUPCSR_REG
#define DT2821_SUPCSR_DMAD
#define DT2821_SUPCSR_ERRINTEN
#define DT2821_SUPCSR_CLRDMADNE
#define DT2821_SUPCSR_DDMA
#define DT2821_SUPCSR_DS(x)
#define DT2821_SUPCSR_DS_PIO
#define DT2821_SUPCSR_DS_AD_CLK
#define DT2821_SUPCSR_DS_DA_CLK
#define DT2821_SUPCSR_DS_AD_TRIG
#define DT2821_SUPCSR_BUFFB
#define DT2821_SUPCSR_SCDN
#define DT2821_SUPCSR_DACON
#define DT2821_SUPCSR_ADCINIT
#define DT2821_SUPCSR_DACINIT
#define DT2821_SUPCSR_PRLD
#define DT2821_SUPCSR_STRIG
#define DT2821_SUPCSR_XTRIG
#define DT2821_SUPCSR_XCLK
#define DT2821_SUPCSR_BDINIT
#define DT2821_TMRCTR_REG
#define DT2821_TMRCTR_PRESCALE(x)
#define DT2821_TMRCTR_DIVIDER(x)

/* Pacer Clock */
#define DT2821_OSC_BASE
#define DT2821_PRESCALE(x)
#define DT2821_PRESCALE_MAX
#define DT2821_DIVIDER_MAX
#define DT2821_OSC_MAX

static const struct comedi_lrange range_dt282x_ai_lo_bipolar =;

static const struct comedi_lrange range_dt282x_ai_lo_unipolar =;

static const struct comedi_lrange range_dt282x_ai_5_bipolar =;

static const struct comedi_lrange range_dt282x_ai_5_unipolar =;

static const struct comedi_lrange range_dt282x_ai_hi_bipolar =;

static const struct comedi_lrange range_dt282x_ai_hi_unipolar =;

/*
 * The Analog Output range is set per-channel using jumpers on the board.
 * All of these ranges may not be available on some DT2821 series boards.
 * The default jumper setting has both channels set for +/-10V output.
 */
static const struct comedi_lrange dt282x_ao_range =;

struct dt282x_board {};

static const struct dt282x_board boardtypes[] =;

struct dt282x_private {};

static int dt282x_prep_ai_dma(struct comedi_device *dev, int dma_index, int n)
{}

static int dt282x_prep_ao_dma(struct comedi_device *dev, int dma_index, int n)
{}

static void dt282x_disable_dma(struct comedi_device *dev)
{}

static unsigned int dt282x_ns_to_timer(unsigned int *ns, unsigned int flags)
{}

static void dt282x_munge(struct comedi_device *dev,
			 struct comedi_subdevice *s,
			 unsigned short *buf,
			 unsigned int nbytes)
{}

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

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

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

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

static void dt282x_load_changain(struct comedi_device *dev, int n,
				 unsigned int *chanlist)
{}

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

/*
 *    Performs a single A/D conversion.
 *      - Put channel/gain into channel-gain list
 *      - preload multiplexer
 *      - trigger conversion and wait for it to finish
 */
static int dt282x_ai_insn_read(struct comedi_device *dev,
			       struct comedi_subdevice *s,
			       struct comedi_insn *insn,
			       unsigned int *data)
{}

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

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

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

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

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

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

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

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

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

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

static const struct comedi_lrange *const ai_range_table[] =;

static const struct comedi_lrange *const ai_range_pgl_table[] =;

static const struct comedi_lrange *opt_ai_range_lkup(int ispgl, int x)
{}

static void dt282x_alloc_dma(struct comedi_device *dev,
			     struct comedi_devconfig *it)
{}

static void dt282x_free_dma(struct comedi_device *dev)
{}

static int dt282x_initialize(struct comedi_device *dev)
{}

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

static void dt282x_detach(struct comedi_device *dev)
{}

static struct comedi_driver dt282x_driver =;
module_comedi_driver();

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