2 comedi/drivers/amplc_dio.h
4 Header for amplc_dio200.c, amplc_dio200_common.c and
7 Copyright (C) 2005-2013 MEV Ltd. <http://www.mev.co.uk/>
9 COMEDI - Linux Control and Measurement Device Interface
10 Copyright (C) 1998,2000 David A. Schleef <ds@schleef.org>
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
23 #ifndef AMPLC_DIO200_H_INCLUDED
24 #define AMPLC_DIO200_H_INCLUDED
26 /* 200 series register area sizes */
27 #define DIO200_IO_SIZE 0x20
28 #define DIO200_PCIE_IO_SIZE 0x4000
33 enum dio200_regtype { no_regtype = 0, io_regtype, mmio_regtype };
34 struct dio200_region {
36 unsigned long iobase; /* I/O base address */
37 unsigned char __iomem *membase; /* mapped MMIO base address */
39 enum dio200_regtype regtype;
45 enum dio200_sdtype { sd_none, sd_intr, sd_8255, sd_8254, sd_timer };
47 #define DIO200_MAX_SUBDEVS 8
48 #define DIO200_MAX_ISNS 6
54 struct dio200_layout {
55 unsigned short n_subdevs; /* number of subdevices */
56 unsigned char sdtype[DIO200_MAX_SUBDEVS]; /* enum dio200_sdtype */
57 unsigned char sdinfo[DIO200_MAX_SUBDEVS]; /* depends on sdtype */
58 bool has_int_sce:1; /* has interrupt enable/status reg */
59 bool has_clk_gat_sce:1; /* has clock/gate selection registers */
60 bool has_enhancements:1; /* has enhanced features */
63 enum dio200_bustype { isa_bustype, pci_bustype };
67 struct dio200_layout layout;
68 enum dio200_bustype bustype;
69 unsigned char mainbar;
70 unsigned char mainshift;
71 unsigned int mainsize;
75 * Comedi device private data.
77 struct dio200_private {
78 struct dio200_region io; /* Register region */
82 int amplc_dio200_common_attach(struct comedi_device *dev, unsigned int irq,
83 unsigned long req_irq_flags);
85 void amplc_dio200_common_detach(struct comedi_device *dev);
87 /* Used by initialization of PCIe boards. */
88 void amplc_dio200_set_enhance(struct comedi_device *dev, unsigned char val);