1 /* SPDX-License-Identifier: GPL-2.0+ */
6 * COMEDI - Linux Control and Measurement Device Interface
7 * Copyright (C) 1998 David A. Schleef <ds@schleef.org>
13 #define I8255_SIZE 0x04
15 #define I8255_DATA_A_REG 0x00
16 #define I8255_DATA_B_REG 0x01
17 #define I8255_DATA_C_REG 0x02
18 #define I8255_CTRL_REG 0x03
19 #define I8255_CTRL_C_LO_IO BIT(0)
20 #define I8255_CTRL_B_IO BIT(1)
21 #define I8255_CTRL_B_MODE BIT(2)
22 #define I8255_CTRL_C_HI_IO BIT(3)
23 #define I8255_CTRL_A_IO BIT(4)
24 #define I8255_CTRL_A_MODE(x) ((x) << 5)
25 #define I8255_CTRL_CW BIT(7)
28 struct comedi_subdevice;
30 int subdev_8255_init(struct comedi_device *dev, struct comedi_subdevice *s,
31 int (*io)(struct comedi_device *dev, int dir, int port,
32 int data, unsigned long regbase),
33 unsigned long regbase);
35 int subdev_8255_mm_init(struct comedi_device *dev, struct comedi_subdevice *s,
36 int (*io)(struct comedi_device *dev, int dir, int port,
37 int data, unsigned long regbase),
38 unsigned long regbase);
40 unsigned long subdev_8255_regbase(struct comedi_subdevice *s);