#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/comedi/comedi_pci.h>
#include "mite.h"
#include "ni_tio.h"
#include "ni_routes.h"
enum ni_660x_register { … };
#define NI660X_CLK_CFG_COUNTER_SWAP …
#define NI660X_GLOBAL_INT_COUNTER0 …
#define NI660X_GLOBAL_INT_COUNTER1 …
#define NI660X_GLOBAL_INT_COUNTER2 …
#define NI660X_GLOBAL_INT_COUNTER3 …
#define NI660X_GLOBAL_INT_CASCADE …
#define NI660X_GLOBAL_INT_GLOBAL_POL …
#define NI660X_GLOBAL_INT_GLOBAL …
#define NI660X_DMA_CFG_SEL(_c, _s) …
#define NI660X_DMA_CFG_SEL_MASK(_c) …
#define NI660X_DMA_CFG_SEL_NONE(_c) …
#define NI660X_DMA_CFG_RESET(_c) …
#define NI660X_IO_CFG(x) …
#define NI660X_IO_CFG_OUT_SEL(_c, _s) …
#define NI660X_IO_CFG_OUT_SEL_MASK(_c) …
#define NI660X_IO_CFG_IN_SEL(_c, _s) …
#define NI660X_IO_CFG_IN_SEL_MASK(_c) …
struct ni_660x_register_data { … };
static const struct ni_660x_register_data ni_660x_reg_data[NI660X_NUM_REGS] = …;
#define NI660X_CHIP_OFFSET …
enum ni_660x_boardid { … };
struct ni_660x_board { … };
static const struct ni_660x_board ni_660x_boards[] = …;
#define NI660X_NUM_PFI_CHANNELS …
#define NI660X_MAX_DMA_CHANNEL …
#define NI660X_COUNTERS_PER_CHIP …
#define NI660X_MAX_CHIPS …
#define NI660X_MAX_COUNTERS …
struct ni_660x_private { … };
static void ni_660x_write(struct comedi_device *dev, unsigned int chip,
unsigned int bits, unsigned int reg)
{ … }
static unsigned int ni_660x_read(struct comedi_device *dev,
unsigned int chip, unsigned int reg)
{ … }
static void ni_660x_gpct_write(struct ni_gpct *counter, unsigned int bits,
enum ni_gpct_register reg)
{ … }
static unsigned int ni_660x_gpct_read(struct ni_gpct *counter,
enum ni_gpct_register reg)
{ … }
static inline void ni_660x_set_dma_channel(struct comedi_device *dev,
unsigned int mite_channel,
struct ni_gpct *counter)
{ … }
static inline void ni_660x_unset_dma_channel(struct comedi_device *dev,
unsigned int mite_channel,
struct ni_gpct *counter)
{ … }
static int ni_660x_request_mite_channel(struct comedi_device *dev,
struct ni_gpct *counter,
enum comedi_io_direction direction)
{ … }
static void ni_660x_release_mite_channel(struct comedi_device *dev,
struct ni_gpct *counter)
{ … }
static int ni_660x_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
{ … }
static int ni_660x_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
{ … }
static void set_tio_counterswap(struct comedi_device *dev, int chip)
{ … }
static void ni_660x_handle_gpct_interrupt(struct comedi_device *dev,
struct comedi_subdevice *s)
{ … }
static irqreturn_t ni_660x_interrupt(int irq, void *d)
{ … }
static int ni_660x_input_poll(struct comedi_device *dev,
struct comedi_subdevice *s)
{ … }
static int ni_660x_buf_change(struct comedi_device *dev,
struct comedi_subdevice *s)
{ … }
static int ni_660x_allocate_private(struct comedi_device *dev)
{ … }
static int ni_660x_alloc_mite_rings(struct comedi_device *dev)
{ … }
static void ni_660x_free_mite_rings(struct comedi_device *dev)
{ … }
static int ni_660x_dio_insn_bits(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{ … }
static void ni_660x_select_pfi_output(struct comedi_device *dev,
unsigned int chan, unsigned int out_sel)
{ … }
static void ni_660x_set_pfi_direction(struct comedi_device *dev,
unsigned int chan,
unsigned int direction)
{ … }
static unsigned int ni_660x_get_pfi_direction(struct comedi_device *dev,
unsigned int chan)
{ … }
static int ni_660x_set_pfi_routing(struct comedi_device *dev,
unsigned int chan, unsigned int source)
{ … }
static int ni_660x_get_pfi_routing(struct comedi_device *dev, unsigned int chan)
{ … }
static void ni_660x_set_pfi_filter(struct comedi_device *dev,
unsigned int chan, unsigned int value)
{ … }
static int ni_660x_dio_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
unsigned int *data)
{ … }
static unsigned int _ni_get_valid_routes(struct comedi_device *dev,
unsigned int n_pairs,
unsigned int *pair_data)
{ … }
static inline int get_output_select_source(int dest, struct comedi_device *dev)
{ … }
static inline int test_route(unsigned int src, unsigned int dest,
struct comedi_device *dev)
{ … }
static inline int connect_route(unsigned int src, unsigned int dest,
struct comedi_device *dev)
{ … }
static inline int disconnect_route(unsigned int src, unsigned int dest,
struct comedi_device *dev)
{ … }
static int ni_global_insn_config(struct comedi_device *dev,
struct comedi_insn *insn,
unsigned int *data)
{ … }
static void ni_660x_init_tio_chips(struct comedi_device *dev,
unsigned int n_chips)
{ … }
static int ni_660x_auto_attach(struct comedi_device *dev,
unsigned long context)
{ … }
static void ni_660x_detach(struct comedi_device *dev)
{ … }
static struct comedi_driver ni_660x_driver = …;
static int ni_660x_pci_probe(struct pci_dev *dev,
const struct pci_device_id *id)
{ … }
static const struct pci_device_id ni_660x_pci_table[] = …;
MODULE_DEVICE_TABLE(pci, ni_660x_pci_table);
static struct pci_driver ni_660x_pci_driver = …;
module_comedi_pci_driver(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;