linux/drivers/comedi/drivers/pcm3724.c

// SPDX-License-Identifier: GPL-2.0
/*
 * pcm3724.c
 * Comedi driver for Advantech PCM-3724 Digital I/O board
 *
 * Drew Csillag <[email protected]>
 */

/*
 * Driver: pcm3724
 * Description: Advantech PCM-3724
 * Devices: [Advantech] PCM-3724 (pcm3724)
 * Author: Drew Csillag <[email protected]>
 * Status: tested
 *
 * This is driver for digital I/O boards PCM-3724 with 48 DIO.
 * It needs 8255.o for operations and only immediate mode is supported.
 * See the source for configuration details.
 *
 * Copy/pasted/hacked from pcm724.c
 *
 * Configuration Options:
 *   [0] - I/O port base address
 */

#include <linux/module.h>
#include <linux/comedi/comedidev.h>
#include <linux/comedi/comedi_8255.h>

/*
 * Register I/O Map
 *
 * This board has two standard 8255 devices that provide six 8-bit DIO ports
 * (48 channels total). Six 74HCT245 chips (one for each port) buffer the
 * I/O lines to increase driving capability. Because the 74HCT245 is a
 * bidirectional, tri-state line buffer, two additional I/O ports are used
 * to control the direction of data and the enable of each port.
 */
#define PCM3724_8255_0_BASE
#define PCM3724_8255_1_BASE
#define PCM3724_DIO_DIR_REG
#define PCM3724_DIO_DIR_C0_OUT
#define PCM3724_DIO_DIR_B0_OUT
#define PCM3724_DIO_DIR_A0_OUT
#define PCM3724_DIO_DIR_C1_OUT
#define PCM3724_DIO_DIR_B1_OUT
#define PCM3724_DIO_DIR_A1_OUT
#define PCM3724_GATE_CTRL_REG
#define PCM3724_GATE_CTRL_C0_ENA
#define PCM3724_GATE_CTRL_B0_ENA
#define PCM3724_GATE_CTRL_A0_ENA
#define PCM3724_GATE_CTRL_C1_ENA
#define PCM3724_GATE_CTRL_B1_ENA
#define PCM3724_GATE_CTRL_A1_ENA

/* used to track configured dios */
struct priv_pcm3724 {};

static int compute_buffer(int config, int devno, struct comedi_subdevice *s)
{}

static void do_3724_config(struct comedi_device *dev,
			   struct comedi_subdevice *s, int chanspec)
{}

static void enable_chan(struct comedi_device *dev, struct comedi_subdevice *s,
			int chanspec)
{}

/* overriding the 8255 insn config */
static int subdev_3724_insn_config(struct comedi_device *dev,
				   struct comedi_subdevice *s,
				   struct comedi_insn *insn,
				   unsigned int *data)
{}

static int pcm3724_attach(struct comedi_device *dev,
			  struct comedi_devconfig *it)
{}

static struct comedi_driver pcm3724_driver =;
module_comedi_driver();

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