brintos

brintos / linux-shallow public Read only

0
0
Text · 1.4 KiB · d24a69d Raw
55 lines · c
1/* SPDX-License-Identifier: GPL-2.0+ */2/*3 * comedi_8255.h4 * Generic 8255 digital I/O subdevice support5 *6 * COMEDI - Linux Control and Measurement Device Interface7 * Copyright (C) 1998 David A. Schleef <ds@schleef.org>8 */9 10#ifndef _COMEDI_8255_H11#define _COMEDI_8255_H12 13#include <linux/errno.h>14 15#define I8255_SIZE		0x0416 17#define I8255_DATA_A_REG	0x0018#define I8255_DATA_B_REG	0x0119#define I8255_DATA_C_REG	0x0220#define I8255_CTRL_REG		0x0321#define I8255_CTRL_C_LO_IO	BIT(0)22#define I8255_CTRL_B_IO		BIT(1)23#define I8255_CTRL_B_MODE	BIT(2)24#define I8255_CTRL_C_HI_IO	BIT(3)25#define I8255_CTRL_A_IO		BIT(4)26#define I8255_CTRL_A_MODE(x)	((x) << 5)27#define I8255_CTRL_CW		BIT(7)28 29struct comedi_device;30struct comedi_subdevice;31 32#ifdef CONFIG_HAS_IOPORT33int subdev_8255_io_init(struct comedi_device *dev, struct comedi_subdevice *s,34			unsigned long regbase);35#else36static inline int subdev_8255_io_init(struct comedi_device *dev,37				      struct comedi_subdevice *s,38				      unsigned long regbase)39{40	return -ENXIO;41}42#endif43 44int subdev_8255_mm_init(struct comedi_device *dev, struct comedi_subdevice *s,45			unsigned long regbase);46 47int subdev_8255_cb_init(struct comedi_device *dev, struct comedi_subdevice *s,48			int (*io)(struct comedi_device *dev, int dir, int port,49				  int data, unsigned long context),50			unsigned long context);51 52unsigned long subdev_8255_regbase(struct comedi_subdevice *s);53 54#endif55