#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 "plx9080.h"
#define DB2K_FIRMWARE …
static const struct comedi_lrange db2k_ai_range = …;
#define DB2K_REG_ACQ_CONTROL …
#define DB2K_REG_ACQ_STATUS …
#define DB2K_REG_ACQ_SCAN_LIST_FIFO …
#define DB2K_REG_ACQ_PACER_CLOCK_DIV_LOW …
#define DB2K_REG_ACQ_SCAN_COUNTER …
#define DB2K_REG_ACQ_PACER_CLOCK_DIV_HIGH …
#define DB2K_REG_ACQ_TRIGGER_COUNT …
#define DB2K_REG_ACQ_RESULTS_FIFO …
#define DB2K_REG_ACQ_RESULTS_SHADOW …
#define DB2K_REG_ACQ_ADC_RESULT …
#define DB2K_REG_DAC_SCAN_COUNTER …
#define DB2K_REG_DAC_CONTROL …
#define DB2K_REG_DAC_STATUS …
#define DB2K_REG_DAC_FIFO …
#define DB2K_REG_DAC_PACER_CLOCK_DIV …
#define DB2K_REG_REF_DACS …
#define DB2K_REG_DIO_CONTROL …
#define DB2K_REG_P3_HSIO_DATA …
#define DB2K_REG_P3_CONTROL …
#define DB2K_REG_CAL_EEPROM_CONTROL …
#define DB2K_REG_DAC_SETTING(x) …
#define DB2K_REG_DIO_P2_EXP_IO_8_BIT …
#define DB2K_REG_COUNTER_TIMER_CONTROL …
#define DB2K_REG_COUNTER_INPUT(x) …
#define DB2K_REG_TIMER_DIV(x) …
#define DB2K_REG_DMA_CONTROL …
#define DB2K_REG_TRIG_CONTROL …
#define DB2K_REG_CAL_EEPROM …
#define DB2K_REG_ACQ_DIGITAL_MARK …
#define DB2K_REG_TRIG_DACS …
#define DB2K_REG_DIO_P2_EXP_IO_16_BIT(x) …
#define DB2K_REG_CPLD_STATUS …
#define DB2K_REG_CPLD_WDATA …
#define DB2K_ACQ_CONTROL_SEQ_START_SCAN_LIST …
#define DB2K_ACQ_CONTROL_SEQ_STOP_SCAN_LIST …
#define DB2K_ACQ_CONTROL_RESET_SCAN_LIST_FIFO …
#define DB2K_ACQ_CONTROL_RESET_RESULTS_FIFO …
#define DB2K_ACQ_CONTROL_RESET_CONFIG_PIPE …
#define DB2K_ACQ_CONTROL_ADC_PACER_INTERNAL …
#define DB2K_ACQ_CONTROL_ADC_PACER_EXTERNAL …
#define DB2K_ACQ_CONTROL_ADC_PACER_ENABLE …
#define DB2K_ACQ_CONTROL_ADC_PACER_ENABLE_DAC_PACER …
#define DB2K_ACQ_CONTROL_ADC_PACER_DISABLE …
#define DB2K_ACQ_CONTROL_ADC_PACER_NORMAL_MODE …
#define DB2K_ACQ_CONTROL_ADC_PACER_COMPATIBILITY_MODE …
#define DB2K_ACQ_CONTROL_ADC_PACER_INTERNAL_OUT_ENABLE …
#define DB2K_ACQ_CONTROL_ADC_PACER_EXTERNAL_RISING …
#define DB2K_ACQ_STATUS_RESULTS_FIFO_MORE_1_SAMPLE …
#define DB2K_ACQ_STATUS_RESULTS_FIFO_HAS_DATA …
#define DB2K_ACQ_STATUS_RESULTS_FIFO_OVERRUN …
#define DB2K_ACQ_STATUS_LOGIC_SCANNING …
#define DB2K_ACQ_STATUS_CONFIG_PIPE_FULL …
#define DB2K_ACQ_STATUS_SCAN_LIST_FIFO_EMPTY …
#define DB2K_ACQ_STATUS_ADC_NOT_READY …
#define DB2K_ACQ_STATUS_ARBITRATION_FAILURE …
#define DB2K_ACQ_STATUS_ADC_PACER_OVERRUN …
#define DB2K_ACQ_STATUS_DAC_PACER_OVERRUN …
#define DB2K_DAC_STATUS_DAC_FULL …
#define DB2K_DAC_STATUS_REF_BUSY …
#define DB2K_DAC_STATUS_TRIG_BUSY …
#define DB2K_DAC_STATUS_CAL_BUSY …
#define DB2K_DAC_STATUS_DAC_BUSY(x) …
#define DB2K_DAC_CONTROL_ENABLE_BIT …
#define DB2K_DAC_CONTROL_DATA_IS_SIGNED …
#define DB2K_DAC_CONTROL_RESET_FIFO …
#define DB2K_DAC_CONTROL_DAC_DISABLE(x) …
#define DB2K_DAC_CONTROL_DAC_ENABLE(x) …
#define DB2K_DAC_CONTROL_PATTERN_DISABLE …
#define DB2K_DAC_CONTROL_PATTERN_ENABLE …
#define DB2K_TRIG_CONTROL_TYPE_ANALOG …
#define DB2K_TRIG_CONTROL_TYPE_TTL …
#define DB2K_TRIG_CONTROL_EDGE_HI_LO …
#define DB2K_TRIG_CONTROL_EDGE_LO_HI …
#define DB2K_TRIG_CONTROL_LEVEL_ABOVE …
#define DB2K_TRIG_CONTROL_LEVEL_BELOW …
#define DB2K_TRIG_CONTROL_SENSE_LEVEL …
#define DB2K_TRIG_CONTROL_SENSE_EDGE …
#define DB2K_TRIG_CONTROL_ENABLE …
#define DB2K_TRIG_CONTROL_DISABLE …
#define DB2K_REF_DACS_SET …
#define DB2K_REF_DACS_SELECT_POS_REF …
#define DB2K_REF_DACS_SELECT_NEG_REF …
#define DB2K_CPLD_STATUS_INIT …
#define DB2K_CPLD_STATUS_TXREADY …
#define DB2K_CPLD_VERSION_MASK …
#define DB2K_CPLD_VERSION_NEW …
enum db2k_boardid { … };
struct db2k_boardtype { … };
static const struct db2k_boardtype db2k_boardtypes[] = …;
struct db2k_private { … };
static void db2k_write_acq_scan_list_entry(struct comedi_device *dev, u16 entry)
{ … }
static void db2k_setup_sampling(struct comedi_device *dev, int chan, int gain)
{ … }
static int db2k_ai_status(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned long context)
{ … }
static int db2k_ai_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{ … }
static int db2k_ao_eoc(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned long context)
{ … }
static int db2k_ao_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
{ … }
static void db2k_reset_local_bus(struct comedi_device *dev)
{ … }
static void db2k_reload_plx(struct comedi_device *dev)
{ … }
static void db2k_pulse_prog_pin(struct comedi_device *dev)
{ … }
static int db2k_wait_cpld_init(struct comedi_device *dev)
{ … }
static int db2k_wait_cpld_txready(struct comedi_device *dev)
{ … }
static int db2k_write_cpld(struct comedi_device *dev, u16 data, bool new_cpld)
{ … }
static int db2k_wait_fpga_programmed(struct comedi_device *dev)
{ … }
static int db2k_load_firmware(struct comedi_device *dev, const u8 *cpld_array,
size_t len, unsigned long context)
{ … }
static void db2k_adc_stop_dma_transfer(struct comedi_device *dev)
{ … }
static void db2k_adc_disarm(struct comedi_device *dev)
{ … }
static void db2k_activate_reference_dacs(struct comedi_device *dev)
{ … }
static void db2k_initialize_ctrs(struct comedi_device *dev)
{ … }
static void db2k_initialize_tmrs(struct comedi_device *dev)
{ … }
static void db2k_dac_disarm(struct comedi_device *dev)
{ … }
static void db2k_initialize_adc(struct comedi_device *dev)
{ … }
static int db2k_8255_cb(struct comedi_device *dev, int dir, int port, int data,
unsigned long iobase)
{ … }
static int db2k_auto_attach(struct comedi_device *dev, unsigned long context)
{ … }
static void db2k_detach(struct comedi_device *dev)
{ … }
static struct comedi_driver db2k_driver = …;
static int db2k_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
{ … }
static const struct pci_device_id db2k_pci_table[] = …;
MODULE_DEVICE_TABLE(pci, db2k_pci_table);
static struct pci_driver db2k_pci_driver = …;
module_comedi_pci_driver(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_FIRMWARE(…);