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