#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/comedi/comedidev.h>
#include <linux/comedi/comedi_8255.h>
#include <linux/comedi/comedi_8254.h>
#include "ni_labpc.h"
#include "ni_labpc_regs.h"
#include "ni_labpc_isadma.h"
enum scan_mode { … };
static const struct comedi_lrange range_labpc_plus_ai = …;
static const struct comedi_lrange range_labpc_1200_ai = …;
static const struct comedi_lrange range_labpc_ao = …;
#ifdef CONFIG_HAS_IOPORT
static unsigned int labpc_inb(struct comedi_device *dev, unsigned long reg)
{ … }
static void labpc_outb(struct comedi_device *dev,
unsigned int byte, unsigned long reg)
{ … }
#endif
static unsigned int labpc_readb(struct comedi_device *dev, unsigned long reg)
{ … }
static void labpc_writeb(struct comedi_device *dev,
unsigned int byte, unsigned long reg)
{ … }
static int labpc_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
{ … }
static void labpc_ai_set_chan_and_gain(struct comedi_device *dev,
enum scan_mode mode,
unsigned int chan,
unsigned int range,
unsigned int aref)
{ … }
static void labpc_setup_cmd6_reg(struct comedi_device *dev,
struct comedi_subdevice *s,
enum scan_mode mode,
enum transfer_type xfer,
unsigned int range,
unsigned int aref,
bool ena_intr)
{ … }
static unsigned int labpc_read_adc_fifo(struct comedi_device *dev)
{ … }
static void labpc_clear_adc_fifo(struct comedi_device *dev)
{ … }
static int labpc_ai_eoc(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned long context)
{ … }
static int labpc_ai_insn_read(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{ … }
static bool labpc_use_continuous_mode(const struct comedi_cmd *cmd,
enum scan_mode mode)
{ … }
static unsigned int labpc_ai_convert_period(const struct comedi_cmd *cmd,
enum scan_mode mode)
{ … }
static void labpc_set_ai_convert_period(struct comedi_cmd *cmd,
enum scan_mode mode, unsigned int ns)
{ … }
static unsigned int labpc_ai_scan_period(const struct comedi_cmd *cmd,
enum scan_mode mode)
{ … }
static void labpc_set_ai_scan_period(struct comedi_cmd *cmd,
enum scan_mode mode, unsigned int ns)
{ … }
static void labpc_adc_timing(struct comedi_device *dev, struct comedi_cmd *cmd,
enum scan_mode mode)
{ … }
static enum scan_mode labpc_ai_scan_mode(const struct comedi_cmd *cmd)
{ … }
static int labpc_ai_check_chanlist(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_cmd *cmd)
{ … }
static int labpc_ai_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_cmd *cmd)
{ … }
static int labpc_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
{ … }
static int labpc_drain_fifo(struct comedi_device *dev)
{ … }
static void labpc_drain_dregs(struct comedi_device *dev)
{ … }
static irqreturn_t labpc_interrupt(int irq, void *d)
{ … }
static void labpc_ao_write(struct comedi_device *dev,
struct comedi_subdevice *s,
unsigned int chan, unsigned int val)
{ … }
static int labpc_ao_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{ … }
static void labpc_serial_out(struct comedi_device *dev, unsigned int value,
unsigned int value_width)
{ … }
static unsigned int labpc_serial_in(struct comedi_device *dev)
{ … }
static unsigned int labpc_eeprom_read(struct comedi_device *dev,
unsigned int address)
{ … }
static unsigned int labpc_eeprom_read_status(struct comedi_device *dev)
{ … }
static void labpc_eeprom_write(struct comedi_device *dev,
unsigned int address, unsigned int value)
{ … }
static void write_caldac(struct comedi_device *dev, unsigned int channel,
unsigned int value)
{ … }
static int labpc_calib_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{ … }
static int labpc_eeprom_ready(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned long context)
{ … }
static int labpc_eeprom_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{ … }
int labpc_common_attach(struct comedi_device *dev,
unsigned int irq, unsigned long isr_flags)
{ … }
EXPORT_SYMBOL_GPL(…);
void labpc_common_detach(struct comedi_device *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __init labpc_common_init(void)
{ … }
module_init(…) …;
static void __exit labpc_common_exit(void)
{ … }
module_exit(labpc_common_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;