linux/drivers/comedi/drivers/adv_pci1760.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * COMEDI driver for the Advantech PCI-1760
 * Copyright (C) 2015 H Hartley Sweeten <[email protected]>
 *
 * Based on the pci1760 support in the adv_pci_dio driver written by:
 *	Michal Dobes <[email protected]>
 *
 * COMEDI - Linux Control and Measurement Device Interface
 * Copyright (C) 2000 David A. Schleef <[email protected]>
 */

/*
 * Driver: adv_pci1760
 * Description: Advantech PCI-1760 Relay & Isolated Digital Input Card
 * Devices: [Advantech] PCI-1760 (adv_pci1760)
 * Author: H Hartley Sweeten <[email protected]>
 * Updated: Fri, 13 Nov 2015 12:34:00 -0700
 * Status: untested
 *
 * Configuration Options: not applicable, uses PCI auto config
 */

#include <linux/module.h>
#include <linux/comedi/comedi_pci.h>

/*
 * PCI-1760 Register Map
 *
 * Outgoing Mailbox Bytes
 * OMB3: Not used (must be 0)
 * OMB2: The command code to the PCI-1760
 * OMB1: The hi byte of the parameter for the command in OMB2
 * OMB0: The lo byte of the parameter for the command in OMB2
 *
 * Incoming Mailbox Bytes
 * IMB3: The Isolated Digital Input status (updated every 100us)
 * IMB2: The current command (matches OMB2 when command is successful)
 * IMB1: The hi byte of the feedback data for the command in OMB2
 * IMB0: The lo byte of the feedback data for the command in OMB2
 *
 * Interrupt Control/Status
 * INTCSR3: Not used (must be 0)
 * INTCSR2: The interrupt status (read only)
 * INTCSR1: Interrupt enable/disable
 * INTCSR0: Not used (must be 0)
 */
#define PCI1760_OMB_REG(x)
#define PCI1760_IMB_REG(x)
#define PCI1760_INTCSR_REG(x)
#define PCI1760_INTCSR1_IRQ_ENA
#define PCI1760_INTCSR2_OMB_IRQ
#define PCI1760_INTCSR2_IMB_IRQ
#define PCI1760_INTCSR2_IRQ_STATUS
#define PCI1760_INTCSR2_IRQ_ASSERTED

/* PCI-1760 command codes */
#define PCI1760_CMD_CLR_IMB2
#define PCI1760_CMD_SET_DO
#define PCI1760_CMD_GET_DO
#define PCI1760_CMD_GET_STATUS
#define PCI1760_CMD_GET_FW_VER
#define PCI1760_CMD_GET_HW_VER
#define PCI1760_CMD_SET_PWM_HI(x)
#define PCI1760_CMD_SET_PWM_LO(x)
#define PCI1760_CMD_SET_PWM_CNT(x)
#define PCI1760_CMD_ENA_PWM
#define PCI1760_CMD_ENA_FILT
#define PCI1760_CMD_ENA_PAT_MATCH
#define PCI1760_CMD_SET_PAT_MATCH
#define PCI1760_CMD_ENA_RISE_EDGE
#define PCI1760_CMD_ENA_FALL_EDGE
#define PCI1760_CMD_ENA_CNT
#define PCI1760_CMD_RST_CNT
#define PCI1760_CMD_ENA_CNT_OFLOW
#define PCI1760_CMD_ENA_CNT_MATCH
#define PCI1760_CMD_SET_CNT_EDGE
#define PCI1760_CMD_GET_CNT
#define PCI1760_CMD_SET_HI_SAMP(x)
#define PCI1760_CMD_SET_LO_SAMP(x)
#define PCI1760_CMD_SET_CNT(x)
#define PCI1760_CMD_SET_CNT_MATCH(x)
#define PCI1760_CMD_GET_INT_FLAGS
#define PCI1760_CMD_GET_INT_FLAGS_MATCH
#define PCI1760_CMD_GET_INT_FLAGS_COS
#define PCI1760_CMD_GET_INT_FLAGS_OFLOW
#define PCI1760_CMD_GET_OS
#define PCI1760_CMD_GET_CNT_STATUS

#define PCI1760_CMD_TIMEOUT
#define PCI1760_CMD_RETRIES

#define PCI1760_PWM_TIMEBASE

static int pci1760_send_cmd(struct comedi_device *dev,
			    unsigned char cmd, unsigned short val)
{}

static int pci1760_cmd(struct comedi_device *dev,
		       unsigned char cmd, unsigned short val)
{}

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

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

static int pci1760_pwm_ns_to_div(unsigned int flags, unsigned int ns)
{}

static int pci1760_pwm_enable(struct comedi_device *dev,
			      unsigned int chan, bool enable)
{}

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

static void pci1760_reset(struct comedi_device *dev)
{}

static int pci1760_auto_attach(struct comedi_device *dev,
			       unsigned long context)
{}

static struct comedi_driver pci1760_driver =;

static int pci1760_pci_probe(struct pci_dev *dev,
			     const struct pci_device_id *id)
{}

static const struct pci_device_id pci1760_pci_table[] =;
MODULE_DEVICE_TABLE(pci, pci1760_pci_table);

static struct pci_driver pci1760_pci_driver =;
module_comedi_pci_driver();

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