linux/drivers/comedi/drivers/adl_pci9111.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * adl_pci9111.c
 * Hardware driver for PCI9111 ADLink cards: PCI-9111HR
 * Copyright (C) 2002-2005 Emmanuel Pacaud <[email protected]>
 */

/*
 * Driver: adl_pci9111
 * Description: Adlink PCI-9111HR
 * Devices: [ADLink] PCI-9111HR (adl_pci9111)
 * Author: Emmanuel Pacaud <[email protected]>
 * Status: experimental
 *
 * Configuration options: not applicable, uses PCI auto config
 *
 * Supports:
 * - ai_insn read
 * - ao_insn read/write
 * - di_insn read
 * - do_insn read/write
 * - ai_do_cmd mode with the following sources:
 *	- start_src		TRIG_NOW
 *	- scan_begin_src	TRIG_FOLLOW	TRIG_TIMER	TRIG_EXT
 *	- convert_src				TRIG_TIMER	TRIG_EXT
 *	- scan_end_src		TRIG_COUNT
 *	- stop_src		TRIG_COUNT	TRIG_NONE
 *
 * The scanned channels must be consecutive and start from 0. They must
 * all have the same range and aref.
 */

/*
 * TODO:
 * - Really test implemented functionality.
 * - Add support for the PCI-9111DG with a probe routine to identify
 *   the card type (perhaps with the help of the channel number readback
 *   of the A/D Data register).
 * - Add external multiplexer support.
 */

#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 PCI9111_FIFO_HALF_SIZE

#define PCI9111_AI_ACQUISITION_PERIOD_MIN_NS

#define PCI9111_RANGE_SETTING_DELAY
#define PCI9111_AI_INSTANT_READ_UDELAY_US

/*
 * IO address map and bit defines
 */
#define PCI9111_AI_FIFO_REG
#define PCI9111_AO_REG
#define PCI9111_DIO_REG
#define PCI9111_EDIO_REG
#define PCI9111_AI_CHANNEL_REG
#define PCI9111_AI_RANGE_STAT_REG
#define PCI9111_AI_STAT_AD_BUSY
#define PCI9111_AI_STAT_FF_FF
#define PCI9111_AI_STAT_FF_HF
#define PCI9111_AI_STAT_FF_EF
#define PCI9111_AI_RANGE(x)
#define PCI9111_AI_RANGE_MASK
#define PCI9111_AI_TRIG_CTRL_REG
#define PCI9111_AI_TRIG_CTRL_TRGEVENT
#define PCI9111_AI_TRIG_CTRL_POTRG
#define PCI9111_AI_TRIG_CTRL_PTRG
#define PCI9111_AI_TRIG_CTRL_ETIS
#define PCI9111_AI_TRIG_CTRL_TPST
#define PCI9111_AI_TRIG_CTRL_ASCAN
#define PCI9111_INT_CTRL_REG
#define PCI9111_INT_CTRL_ISC2
#define PCI9111_INT_CTRL_FFEN
#define PCI9111_INT_CTRL_ISC1
#define PCI9111_INT_CTRL_ISC0
#define PCI9111_SOFT_TRIG_REG
#define PCI9111_8254_BASE_REG
#define PCI9111_INT_CLR_REG

/* PLX 9052 Local Interrupt 1 enabled and active */
#define PCI9111_LI1_ACTIVE

/* PLX 9052 Local Interrupt 2 enabled and active */
#define PCI9111_LI2_ACTIVE

static const struct comedi_lrange pci9111_ai_range =;

struct pci9111_private_data {};

static void plx9050_interrupt_control(unsigned long io_base,
				      bool int1_enable,
				      bool int1_active_high,
				      bool int2_enable,
				      bool int2_active_high,
				      bool interrupt_enable)
{}

enum pci9111_ISC0_sources {};

enum pci9111_ISC1_sources {};

static void pci9111_interrupt_source_set(struct comedi_device *dev,
					 enum pci9111_ISC0_sources irq_0_source,
					 enum pci9111_ISC1_sources irq_1_source)
{}

static void pci9111_fifo_reset(struct comedi_device *dev)
{}

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

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

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

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

static void pci9111_ai_munge(struct comedi_device *dev,
			     struct comedi_subdevice *s, void *data,
			     unsigned int num_bytes,
			     unsigned int start_chan_index)
{}

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

static irqreturn_t pci9111_interrupt(int irq, void *p_device)
{}

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

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

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

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

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

static int pci9111_reset(struct comedi_device *dev)
{}

static int pci9111_auto_attach(struct comedi_device *dev,
			       unsigned long context_unused)
{}

static void pci9111_detach(struct comedi_device *dev)
{}

static struct comedi_driver adl_pci9111_driver =;

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

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

static struct pci_driver adl_pci9111_pci_driver =;
module_comedi_pci_driver();

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