1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * comedi/drivers/amplc_dio.h
4  *
5  * Header for amplc_dio200.c, amplc_dio200_common.c and
6  * amplc_dio200_pci.c.
7  *
8  * Copyright (C) 2005-2013 MEV Ltd. <https://www.mev.co.uk/>
9  *
10  * COMEDI - Linux Control and Measurement Device Interface
11  * Copyright (C) 1998,2000 David A. Schleef <ds@schleef.org>
12  */
13 
14 #ifndef AMPLC_DIO200_H_INCLUDED
15 #define AMPLC_DIO200_H_INCLUDED
16 
17 #include <linux/types.h>
18 
19 struct comedi_device;
20 
21 /*
22  * Subdevice types.
23  */
24 enum dio200_sdtype { sd_none, sd_intr, sd_8255, sd_8254, sd_timer };
25 
26 #define DIO200_MAX_SUBDEVS	8
27 #define DIO200_MAX_ISNS		6
28 
29 struct dio200_board {
30 	const char *name;
31 	unsigned char mainbar;
32 	unsigned short n_subdevs;	/* number of subdevices */
33 	unsigned char sdtype[DIO200_MAX_SUBDEVS];	/* enum dio200_sdtype */
34 	unsigned char sdinfo[DIO200_MAX_SUBDEVS];	/* depends on sdtype */
35 	unsigned int has_int_sce:1;	/* has interrupt enable/status reg */
36 	unsigned int has_clk_gat_sce:1;	/* has clock/gate selection registers */
37 	unsigned int is_pcie:1;			/* has enhanced features */
38 };
39 
40 int amplc_dio200_common_attach(struct comedi_device *dev, unsigned int irq,
41 			       unsigned long req_irq_flags);
42 
43 /* Used by initialization of PCIe boards. */
44 void amplc_dio200_set_enhance(struct comedi_device *dev, unsigned char val);
45 
46 #endif
47