linux/drivers/comedi/drivers/ni_660x.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Hardware driver for NI 660x devices
 */

/*
 * Driver: ni_660x
 * Description: National Instruments 660x counter/timer boards
 * Devices: [National Instruments] PCI-6601 (ni_660x), PCI-6602, PXI-6602,
 *   PCI-6608, PXI-6608, PCI-6624, PXI-6624
 * Author: J.P. Mellor <[email protected]>,
 *   [email protected],
 *   [email protected],
 *   [email protected],
 *   Frank Mori Hess <[email protected]>
 * Updated: Mon, 16 Jan 2017 14:00:43 +0000
 * Status: experimental
 *
 * Encoders work.  PulseGeneration (both single pulse and pulse train)
 * works.  Buffered commands work for input but not output.
 *
 * References:
 * DAQ 660x Register-Level Programmer Manual  (NI 370505A-01)
 * DAQ 6601/6602 User Manual (NI 322137B-01)
 */

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

/* See Register-Level Programmer Manual page 3.1 */
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

/* there are only up to 3 dma channels, but the register layout allows for 4 */
#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)
{}

/*
 * Retrieves the current source of the output selector for the given
 * destination.  If the terminal for the destination is not already configured
 * as an output, this function returns -EINVAL as error.
 *
 * Return: The register value of the destination output selector;
 *	   -EINVAL if terminal is not configured for output.
 */
static inline int get_output_select_source(int dest, struct comedi_device *dev)
{}

/*
 * Test a route:
 *
 * Return: -1 if not connectible;
 *	    0 if connectible and not connected;
 *	    1 if connectible and connected.
 */
static inline int test_route(unsigned int src, unsigned int dest,
			     struct comedi_device *dev)
{}

/* Connect the actual route.  */
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();