linux/drivers/comedi/drivers/amplc_dio200_common.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * comedi/drivers/amplc_dio200_common.c
 *
 * Common support code for "amplc_dio200" and "amplc_dio200_pci".
 *
 * Copyright (C) 2005-2013 MEV Ltd. <https://www.mev.co.uk/>
 *
 * COMEDI - Linux Control and Measurement Device Interface
 * Copyright (C) 1998,2000 David A. Schleef <[email protected]>
 */

#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/comedi/comedidev.h>
#include <linux/comedi/comedi_8255.h>	/* only for register defines */
#include <linux/comedi/comedi_8254.h>

#include "amplc_dio200.h"

/* 200 series registers */
#define DIO200_IO_SIZE
#define DIO200_PCIE_IO_SIZE
#define DIO200_CLK_SCE(x)
#define DIO200_GAT_SCE(x)
#define DIO200_INT_SCE
/* Extra registers for new PCIe boards */
#define DIO200_ENHANCE
#define DIO200_VERSION
#define DIO200_TS_CONFIG
#define DIO200_TS_COUNT

/*
 * Functions for constructing value for DIO_200_?CLK_SCE and
 * DIO_200_?GAT_SCE registers:
 *
 * 'which' is: 0 for CTR-X1, CTR-Y1, CTR-Z1; 1 for CTR-X2, CTR-Y2 or CTR-Z2.
 * 'chan' is the channel: 0, 1 or 2.
 * 'source' is the signal source: 0 to 7, or 0 to 31 for "enhanced" boards.
 */
static unsigned char clk_gat_sce(unsigned int which, unsigned int chan,
				 unsigned int source)
{}

/*
 * Periods of the internal clock sources in nanoseconds.
 */
static const unsigned int clock_period[32] =;

/*
 * Timestamp timer configuration register (for new PCIe boards).
 */
#define TS_CONFIG_RESET
#define TS_CONFIG_CLK_SRC_MASK
#define TS_CONFIG_MAX_CLK_SRC

/*
 * Periods of the timestamp timer clock sources in nanoseconds.
 */
static const unsigned int ts_clock_period[TS_CONFIG_MAX_CLK_SRC + 1] =;

struct dio200_subdev_8255 {};

struct dio200_subdev_intr {};

#ifdef CONFIG_HAS_IOPORT

static unsigned char dio200___read8(struct comedi_device *dev,
				    unsigned int offset)
{}

static void dio200___write8(struct comedi_device *dev,
			    unsigned int offset, unsigned char val)
{}

static unsigned int dio200___read32(struct comedi_device *dev,
				    unsigned int offset)
{}

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

#else /* CONFIG_HAS_IOPORT */

static unsigned char dio200___read8(struct comedi_device *dev,
				    unsigned int offset)
{
	return readb(dev->mmio + offset);
}

static void dio200___write8(struct comedi_device *dev,
			    unsigned int offset, unsigned char val)
{
	writeb(val, dev->mmio + offset);
}

static unsigned int dio200___read32(struct comedi_device *dev,
				    unsigned int offset)
{
	return readl(dev->mmio + offset);
}

static void dio200___write32(struct comedi_device *dev,
			     unsigned int offset, unsigned int val)
{
	writel(val, dev->mmio + offset);
}

#endif /* CONFIG_HAS_IOPORT */

static unsigned char dio200_read8(struct comedi_device *dev,
				  unsigned int offset)
{}

static void dio200_write8(struct comedi_device *dev,
			  unsigned int offset, unsigned char val)
{}

static unsigned int dio200_read32(struct comedi_device *dev,
				  unsigned int offset)
{}

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

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

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

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

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

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

static void dio200_read_scan_intr(struct comedi_device *dev,
				  struct comedi_subdevice *s,
				  unsigned int triggered)
{}

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

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

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

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

static int dio200_subdev_intr_init(struct comedi_device *dev,
				   struct comedi_subdevice *s,
				   unsigned int offset,
				   unsigned int valid_isns)
{}

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

static void dio200_subdev_8254_set_gate_src(struct comedi_device *dev,
					    struct comedi_subdevice *s,
					    unsigned int chan,
					    unsigned int src)
{}

static void dio200_subdev_8254_set_clock_src(struct comedi_device *dev,
					     struct comedi_subdevice *s,
					     unsigned int chan,
					     unsigned int src)
{}

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

static int dio200_subdev_8254_init(struct comedi_device *dev,
				   struct comedi_subdevice *s,
				   unsigned int offset)
{}

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

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

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

static int dio200_subdev_8255_init(struct comedi_device *dev,
				   struct comedi_subdevice *s,
				   unsigned int offset)
{}

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

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

static void dio200_subdev_timer_get_clock_src(struct comedi_device *dev,
					      struct comedi_subdevice *s,
					      unsigned int *src,
					      unsigned int *period)
{}

static int dio200_subdev_timer_set_clock_src(struct comedi_device *dev,
					     struct comedi_subdevice *s,
					     unsigned int src)
{}

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

void amplc_dio200_set_enhance(struct comedi_device *dev, unsigned char val)
{}
EXPORT_SYMBOL_GPL();

int amplc_dio200_common_attach(struct comedi_device *dev, unsigned int irq,
			       unsigned long req_irq_flags)
{}
EXPORT_SYMBOL_GPL();

static int __init amplc_dio200_common_init(void)
{}
module_init();

static void __exit amplc_dio200_common_exit(void)
{}
module_exit(amplc_dio200_common_exit);

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