1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28#ifndef AMPLC_DIO200_H_INCLUDED
29#define AMPLC_DIO200_H_INCLUDED
30
31
32#define DIO200_IO_SIZE 0x20
33#define DIO200_PCIE_IO_SIZE 0x4000
34
35
36
37
38enum dio200_regtype { no_regtype = 0, io_regtype, mmio_regtype };
39struct dio200_region {
40 union {
41 unsigned long iobase;
42 unsigned char __iomem *membase;
43 } u;
44 enum dio200_regtype regtype;
45};
46
47
48
49
50enum dio200_sdtype { sd_none, sd_intr, sd_8255, sd_8254, sd_timer };
51
52#define DIO200_MAX_SUBDEVS 8
53#define DIO200_MAX_ISNS 6
54
55
56
57
58
59struct dio200_layout {
60 unsigned short n_subdevs;
61 unsigned char sdtype[DIO200_MAX_SUBDEVS];
62 unsigned char sdinfo[DIO200_MAX_SUBDEVS];
63 bool has_int_sce:1;
64 bool has_clk_gat_sce:1;
65 bool has_enhancements:1;
66};
67
68enum dio200_bustype { isa_bustype, pci_bustype };
69
70struct dio200_board {
71 const char *name;
72 struct dio200_layout layout;
73 enum dio200_bustype bustype;
74 unsigned char mainbar;
75 unsigned char mainshift;
76 unsigned int mainsize;
77};
78
79
80
81
82struct dio200_private {
83 struct dio200_region io;
84 int intr_sd;
85};
86
87int amplc_dio200_common_attach(struct comedi_device *dev, unsigned int irq,
88 unsigned long req_irq_flags);
89
90void amplc_dio200_common_detach(struct comedi_device *dev);
91
92
93void amplc_dio200_set_enhance(struct comedi_device *dev, unsigned char val);
94
95#endif
96