#include <linux/module.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/comedi/comedi_pci.h>
#include <linux/comedi/comedi_8254.h>
#include "plx9052.h"
#define ME4000_FIRMWARE …
#define ME4000_AO_CHAN(x) …
#define ME4000_AO_CTRL_REG(x) …
#define ME4000_AO_CTRL_MODE_0 …
#define ME4000_AO_CTRL_MODE_1 …
#define ME4000_AO_CTRL_STOP …
#define ME4000_AO_CTRL_ENABLE_FIFO …
#define ME4000_AO_CTRL_ENABLE_EX_TRIG …
#define ME4000_AO_CTRL_EX_TRIG_EDGE …
#define ME4000_AO_CTRL_IMMEDIATE_STOP …
#define ME4000_AO_CTRL_ENABLE_DO …
#define ME4000_AO_CTRL_ENABLE_IRQ …
#define ME4000_AO_CTRL_RESET_IRQ …
#define ME4000_AO_STATUS_REG(x) …
#define ME4000_AO_STATUS_FSM …
#define ME4000_AO_STATUS_FF …
#define ME4000_AO_STATUS_HF …
#define ME4000_AO_STATUS_EF …
#define ME4000_AO_FIFO_REG(x) …
#define ME4000_AO_SINGLE_REG(x) …
#define ME4000_AO_TIMER_REG(x) …
#define ME4000_AI_CTRL_REG …
#define ME4000_AI_STATUS_REG …
#define ME4000_AI_CTRL_MODE_0 …
#define ME4000_AI_CTRL_MODE_1 …
#define ME4000_AI_CTRL_MODE_2 …
#define ME4000_AI_CTRL_SAMPLE_HOLD …
#define ME4000_AI_CTRL_IMMEDIATE_STOP …
#define ME4000_AI_CTRL_STOP …
#define ME4000_AI_CTRL_CHANNEL_FIFO …
#define ME4000_AI_CTRL_DATA_FIFO …
#define ME4000_AI_CTRL_FULLSCALE …
#define ME4000_AI_CTRL_OFFSET …
#define ME4000_AI_CTRL_EX_TRIG_ANALOG …
#define ME4000_AI_CTRL_EX_TRIG …
#define ME4000_AI_CTRL_EX_TRIG_FALLING …
#define ME4000_AI_CTRL_EX_IRQ …
#define ME4000_AI_CTRL_EX_IRQ_RESET …
#define ME4000_AI_CTRL_LE_IRQ …
#define ME4000_AI_CTRL_LE_IRQ_RESET …
#define ME4000_AI_CTRL_HF_IRQ …
#define ME4000_AI_CTRL_HF_IRQ_RESET …
#define ME4000_AI_CTRL_SC_IRQ …
#define ME4000_AI_CTRL_SC_IRQ_RESET …
#define ME4000_AI_CTRL_SC_RELOAD …
#define ME4000_AI_STATUS_EF_CHANNEL …
#define ME4000_AI_STATUS_HF_CHANNEL …
#define ME4000_AI_STATUS_FF_CHANNEL …
#define ME4000_AI_STATUS_EF_DATA …
#define ME4000_AI_STATUS_HF_DATA …
#define ME4000_AI_STATUS_FF_DATA …
#define ME4000_AI_STATUS_LE …
#define ME4000_AI_STATUS_FSM …
#define ME4000_AI_CTRL_EX_TRIG_BOTH …
#define ME4000_AI_CHANNEL_LIST_REG …
#define ME4000_AI_LIST_INPUT_DIFFERENTIAL …
#define ME4000_AI_LIST_RANGE(x) …
#define ME4000_AI_LIST_LAST_ENTRY …
#define ME4000_AI_DATA_REG …
#define ME4000_AI_CHAN_TIMER_REG …
#define ME4000_AI_CHAN_PRE_TIMER_REG …
#define ME4000_AI_SCAN_TIMER_LOW_REG …
#define ME4000_AI_SCAN_TIMER_HIGH_REG …
#define ME4000_AI_SCAN_PRE_TIMER_LOW_REG …
#define ME4000_AI_SCAN_PRE_TIMER_HIGH_REG …
#define ME4000_AI_START_REG …
#define ME4000_IRQ_STATUS_REG …
#define ME4000_IRQ_STATUS_EX …
#define ME4000_IRQ_STATUS_LE …
#define ME4000_IRQ_STATUS_AI_HF …
#define ME4000_IRQ_STATUS_AO_0_HF …
#define ME4000_IRQ_STATUS_AO_1_HF …
#define ME4000_IRQ_STATUS_AO_2_HF …
#define ME4000_IRQ_STATUS_AO_3_HF …
#define ME4000_IRQ_STATUS_SC …
#define ME4000_DIO_PORT_0_REG …
#define ME4000_DIO_PORT_1_REG …
#define ME4000_DIO_PORT_2_REG …
#define ME4000_DIO_PORT_3_REG …
#define ME4000_DIO_DIR_REG …
#define ME4000_AO_LOADSETREG_XX …
#define ME4000_DIO_CTRL_REG …
#define ME4000_DIO_CTRL_MODE_0 …
#define ME4000_DIO_CTRL_MODE_1 …
#define ME4000_DIO_CTRL_MODE_2 …
#define ME4000_DIO_CTRL_MODE_3 …
#define ME4000_DIO_CTRL_MODE_4 …
#define ME4000_DIO_CTRL_MODE_5 …
#define ME4000_DIO_CTRL_MODE_6 …
#define ME4000_DIO_CTRL_MODE_7 …
#define ME4000_DIO_CTRL_FUNCTION_0 …
#define ME4000_DIO_CTRL_FUNCTION_1 …
#define ME4000_DIO_CTRL_FIFO_HIGH_0 …
#define ME4000_DIO_CTRL_FIFO_HIGH_1 …
#define ME4000_DIO_CTRL_FIFO_HIGH_2 …
#define ME4000_DIO_CTRL_FIFO_HIGH_3 …
#define ME4000_AO_DEMUX_ADJUST_REG …
#define ME4000_AO_DEMUX_ADJUST_VALUE …
#define ME4000_AI_SAMPLE_COUNTER_REG …
#define ME4000_AI_FIFO_COUNT …
#define ME4000_AI_MIN_TICKS …
#define ME4000_AI_MIN_SAMPLE_TIME …
#define ME4000_AI_CHANNEL_LIST_COUNT …
struct me4000_private { … };
enum me4000_boardid { … };
struct me4000_board { … };
static const struct me4000_board me4000_boards[] = …;
static const struct comedi_lrange me4000_ai_range = …;
static int me4000_xilinx_download(struct comedi_device *dev,
const u8 *data, size_t size,
unsigned long context)
{ … }
static void me4000_ai_reset(struct comedi_device *dev)
{ … }
static void me4000_reset(struct comedi_device *dev)
{ … }
static unsigned int me4000_ai_get_sample(struct comedi_device *dev,
struct comedi_subdevice *s)
{ … }
static int me4000_ai_eoc(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned long context)
{ … }
static int me4000_ai_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{ … }
static int me4000_ai_cancel(struct comedi_device *dev,
struct comedi_subdevice *s)
{ … }
static int me4000_ai_check_chanlist(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{ … }
static void me4000_ai_round_cmd_args(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{ … }
static void me4000_ai_write_chanlist(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{ … }
static int me4000_ai_do_cmd(struct comedi_device *dev,
struct comedi_subdevice *s)
{ … }
static int me4000_ai_do_cmd_test(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{ … }
static irqreturn_t me4000_ai_isr(int irq, void *dev_id)
{ … }
static int me4000_ao_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{ … }
static int me4000_dio_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{ … }
static int me4000_dio_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{ … }
static int me4000_auto_attach(struct comedi_device *dev,
unsigned long context)
{ … }
static void me4000_detach(struct comedi_device *dev)
{ … }
static struct comedi_driver me4000_driver = …;
static int me4000_pci_probe(struct pci_dev *dev,
const struct pci_device_id *id)
{ … }
static const struct pci_device_id me4000_pci_table[] = …;
MODULE_DEVICE_TABLE(pci, me4000_pci_table);
static struct pci_driver me4000_pci_driver = …;
module_comedi_pci_driver(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_FIRMWARE(…);