#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/comedi/comedidev.h>
#include <linux/comedi/comedi_8255.h>
#include <linux/comedi/comedi_8254.h>
#include "amplc_dio200.h"
#define DIO200_IO_SIZE …
#define DIO200_PCIE_IO_SIZE …
#define DIO200_CLK_SCE(x) …
#define DIO200_GAT_SCE(x) …
#define DIO200_INT_SCE …
#define DIO200_ENHANCE …
#define DIO200_VERSION …
#define DIO200_TS_CONFIG …
#define DIO200_TS_COUNT …
static unsigned char clk_gat_sce(unsigned int which, unsigned int chan,
unsigned int source)
{ … }
static const unsigned int clock_period[32] = …;
#define TS_CONFIG_RESET …
#define TS_CONFIG_CLK_SRC_MASK …
#define TS_CONFIG_MAX_CLK_SRC …
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
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
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(…) …;