linux/drivers/comedi/drivers/cb_pcidas.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * cb_pcidas.c
 * Developed by Ivan Martinez and Frank Mori Hess, with valuable help from
 * David Schleef and the rest of the Comedi developers comunity.
 *
 * Copyright (C) 2001-2003 Ivan Martinez <[email protected]>
 * Copyright (C) 2001,2002 Frank Mori Hess <[email protected]>
 *
 * COMEDI - Linux Control and Measurement Device Interface
 * Copyright (C) 1997-8 David A. Schleef <[email protected]>
 */

/*
 * Driver: cb_pcidas
 * Description: MeasurementComputing PCI-DAS series
 *   with the AMCC S5933 PCI controller
 * Devices: [Measurement Computing] PCI-DAS1602/16 (cb_pcidas),
 *   PCI-DAS1602/16jr, PCI-DAS1602/12, PCI-DAS1200, PCI-DAS1200jr,
 *   PCI-DAS1000, PCI-DAS1001, PCI_DAS1002
 * Author: Ivan Martinez <[email protected]>,
 *   Frank Mori Hess <[email protected]>
 * Updated: 2003-3-11
 *
 * Status:
 * There are many reports of the driver being used with most of the
 * supported cards. Despite no detailed log is maintained, it can
 * be said that the driver is quite tested and stable.
 *
 * The boards may be autocalibrated using the comedi_calibrate
 * utility.
 *
 * Configuration options: not applicable, uses PCI auto config
 *
 * For commands, the scanned channels must be consecutive
 * (i.e. 4-5-6-7, 2-3-4,...), and must all have the same
 * range and aref.
 *
 * AI Triggering:
 * For start_src == TRIG_EXT, the A/D EXTERNAL TRIGGER IN (pin 45) is used.
 * For 1602 series, the start_arg is interpreted as follows:
 *	start_arg == 0                   => gated trigger (level high)
 *	start_arg == CR_INVERT           => gated trigger (level low)
 *	start_arg == CR_EDGE             => Rising edge
 *	start_arg == CR_EDGE | CR_INVERT => Falling edge
 * For the other boards the trigger will be done on rising edge
 */

/*
 * TODO:
 * analog triggering on 1602 series
 */

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

#include "amcc_s5933.h"

#define AI_BUFFER_SIZE
#define AO_BUFFER_SIZE

/*
 * PCI BAR1 Register map (devpriv->pcibar1)
 */
#define PCIDAS_CTRL_REG
#define PCIDAS_CTRL_INT(x)
#define PCIDAS_CTRL_INT_NONE
#define PCIDAS_CTRL_INT_EOS
#define PCIDAS_CTRL_INT_FHF
#define PCIDAS_CTRL_INT_FNE
#define PCIDAS_CTRL_INT_MASK
#define PCIDAS_CTRL_INTE
#define PCIDAS_CTRL_DAHFIE
#define PCIDAS_CTRL_EOAIE
#define PCIDAS_CTRL_DAHFI
#define PCIDAS_CTRL_EOAI
#define PCIDAS_CTRL_INT_CLR
#define PCIDAS_CTRL_EOBI
#define PCIDAS_CTRL_ADHFI
#define PCIDAS_CTRL_ADNEI
#define PCIDAS_CTRL_ADNE
#define PCIDAS_CTRL_DAEMIE
#define PCIDAS_CTRL_LADFUL
#define PCIDAS_CTRL_DAEMI

#define PCIDAS_CTRL_AI_INT
#define PCIDAS_CTRL_AO_INT

#define PCIDAS_AI_REG
#define PCIDAS_AI_FIRST(x)
#define PCIDAS_AI_LAST(x)
#define PCIDAS_AI_CHAN(x)
#define PCIDAS_AI_GAIN(x)
#define PCIDAS_AI_SE
#define PCIDAS_AI_UNIP
#define PCIDAS_AI_PACER(x)
#define PCIDAS_AI_PACER_SW
#define PCIDAS_AI_PACER_INT
#define PCIDAS_AI_PACER_EXTN
#define PCIDAS_AI_PACER_EXTP
#define PCIDAS_AI_PACER_MASK
#define PCIDAS_AI_EOC

#define PCIDAS_TRIG_REG
#define PCIDAS_TRIG_SEL(x)
#define PCIDAS_TRIG_SEL_NONE
#define PCIDAS_TRIG_SEL_SW
#define PCIDAS_TRIG_SEL_EXT
#define PCIDAS_TRIG_SEL_ANALOG
#define PCIDAS_TRIG_SEL_MASK
#define PCIDAS_TRIG_POL
#define PCIDAS_TRIG_MODE
#define PCIDAS_TRIG_EN
#define PCIDAS_TRIG_BURSTE
#define PCIDAS_TRIG_CLR

#define PCIDAS_CALIB_REG
#define PCIDAS_CALIB_8800_SEL
#define PCIDAS_CALIB_TRIM_SEL
#define PCIDAS_CALIB_DAC08_SEL
#define PCIDAS_CALIB_SRC(x)
#define PCIDAS_CALIB_EN
#define PCIDAS_CALIB_DATA

#define PCIDAS_AO_REG
#define PCIDAS_AO_EMPTY
#define PCIDAS_AO_DACEN
#define PCIDAS_AO_START
#define PCIDAS_AO_PACER(x)
#define PCIDAS_AO_PACER_SW
#define PCIDAS_AO_PACER_INT
#define PCIDAS_AO_PACER_EXTN
#define PCIDAS_AO_PACER_EXTP
#define PCIDAS_AO_PACER_MASK
#define PCIDAS_AO_CHAN_EN(c)
#define PCIDAS_AO_CHAN_MASK
#define PCIDAS_AO_UPDATE_BOTH
#define PCIDAS_AO_RANGE(c, r)
#define PCIDAS_AO_RANGE_MASK(c)

/*
 * PCI BAR2 Register map (devpriv->pcibar2)
 */
#define PCIDAS_AI_DATA_REG
#define PCIDAS_AI_FIFO_CLR_REG

/*
 * PCI BAR3 Register map (dev->iobase)
 */
#define PCIDAS_AI_8254_BASE
#define PCIDAS_8255_BASE
#define PCIDAS_AO_8254_BASE

/*
 * PCI BAR4 Register map (devpriv->pcibar4)
 */
#define PCIDAS_AO_DATA_REG(x)
#define PCIDAS_AO_FIFO_REG
#define PCIDAS_AO_FIFO_CLR_REG

/* analog input ranges for most boards */
static const struct comedi_lrange cb_pcidas_ranges =;

/* pci-das1001 input ranges */
static const struct comedi_lrange cb_pcidas_alt_ranges =;

/* analog output ranges */
static const struct comedi_lrange cb_pcidas_ao_ranges =;

enum cb_pcidas_boardid {};

struct cb_pcidas_board {};

static const struct cb_pcidas_board cb_pcidas_boards[] =;

struct cb_pcidas_private {};

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

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

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

/* analog output insn for pcidas-1000 and 1200 series */
static int cb_pcidas_ao_nofifo_insn_write(struct comedi_device *dev,
					  struct comedi_subdevice *s,
					  struct comedi_insn *insn,
					  unsigned int *data)
{}

/* analog output insn for pcidas-1602 series */
static int cb_pcidas_ao_fifo_insn_write(struct comedi_device *dev,
					struct comedi_subdevice *s,
					struct comedi_insn *insn,
					unsigned int *data)
{}

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

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

static void cb_pcidas_calib_write(struct comedi_device *dev,
				  unsigned int val, unsigned int len,
				  bool trimpot)
{}

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

static void cb_pcidas_dac08_write(struct comedi_device *dev, unsigned int val)
{}

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

static void cb_pcidas_trimpot_write(struct comedi_device *dev,
				    unsigned int chan, unsigned int val)
{}

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

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

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

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

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

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

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

static void cb_pcidas_ao_load_fifo(struct comedi_device *dev,
				   struct comedi_subdevice *s,
				   unsigned int nsamples)
{}

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

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

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

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

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

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

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

static void cb_pcidas_detach(struct comedi_device *dev)
{}

static struct comedi_driver cb_pcidas_driver =;

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

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

static struct pci_driver cb_pcidas_pci_driver =;
module_comedi_pci_driver();

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