3 * comedi driver for DAS08 ISA/PC-104 boards
5 * COMEDI - Linux Control and Measurement Device Interface
6 * Copyright (C) 2000 David A. Schleef <ds@schleef.org>
7 * Copyright (C) 2001,2002,2003 Frank Mori Hess <fmhess@users.sourceforge.net>
8 * Copyright (C) 2004 Salvador E. Tropea <set@users.sf.net> <set@ieee.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
23 * Description: DAS-08 ISA/PC-104 compatible boards
24 * Devices: (Keithley Metrabyte) DAS08 [isa-das08],
25 * (ComputerBoards) DAS08 [isa-das08]
26 * (ComputerBoards) DAS08-PGM [das08-pgm]
27 * (ComputerBoards) DAS08-PGH [das08-pgh]
28 * (ComputerBoards) DAS08-PGL [das08-pgl]
29 * (ComputerBoards) DAS08-AOH [das08-aoh]
30 * (ComputerBoards) DAS08-AOL [das08-aol]
31 * (ComputerBoards) DAS08-AOM [das08-aom]
32 * (ComputerBoards) DAS08/JR-AO [das08/jr-ao]
33 * (ComputerBoards) DAS08/JR-16-AO [das08jr-16-ao]
34 * (ComputerBoards) PC104-DAS08 [pc104-das08]
35 * (ComputerBoards) DAS08/JR/16 [das08jr/16]
36 * Author: Warren Jasper, ds, Frank Hess
37 * Updated: Fri, 31 Aug 2012 19:19:06 +0100
40 * This is the ISA/PC-104-specific support split off from the das08 driver.
42 * Configuration Options:
43 * [0] - base io address
46 #include "../comedidev.h"
50 static const struct das08_board_struct das08_isa_boards
[] = {
55 .ai_pg
= das08_pg_none
,
56 .ai_encoding
= das08_encode12
,
61 .iosize
= 16, /* unchecked */
63 /* cio-das08pgx.pdf */
67 .ai_encoding
= das08_encode12
,
72 .iosize
= 16, /* unchecked */
74 /* cio-das08pgx.pdf */
78 .ai_encoding
= das08_encode12
,
82 .iosize
= 16, /* unchecked */
84 /* cio-das08pgx.pdf */
88 .ai_encoding
= das08_encode12
,
92 .iosize
= 16, /* unchecked */
94 /* cio-das08_aox.pdf */
98 .ai_encoding
= das08_encode12
,
102 .i8255_offset
= 0x0c,
103 .i8254_offset
= 0x04,
104 .iosize
= 16, /* unchecked */
106 /* cio-das08_aox.pdf */
110 .ai_encoding
= das08_encode12
,
114 .i8255_offset
= 0x0c,
115 .i8254_offset
= 0x04,
116 .iosize
= 16, /* unchecked */
118 /* cio-das08_aox.pdf */
122 .ai_encoding
= das08_encode12
,
126 .i8255_offset
= 0x0c,
127 .i8254_offset
= 0x04,
128 .iosize
= 16, /* unchecked */
130 /* cio-das08-jr-ao.pdf */
131 .name
= "das08/jr-ao",
134 .ai_pg
= das08_pg_none
,
135 .ai_encoding
= das08_encode12
,
139 .iosize
= 16, /* unchecked */
141 /* cio-das08jr-16-ao.pdf */
142 .name
= "das08jr-16-ao",
145 .ai_pg
= das08_pg_none
,
146 .ai_encoding
= das08_encode16
,
150 .i8254_offset
= 0x04,
151 .iosize
= 16, /* unchecked */
153 .name
= "pc104-das08",
155 .ai_pg
= das08_pg_none
,
156 .ai_encoding
= das08_encode12
,
160 .iosize
= 16, /* unchecked */
162 .name
= "das08jr/16",
165 .ai_pg
= das08_pg_none
,
166 .ai_encoding
= das08_encode16
,
169 .iosize
= 16, /* unchecked */
173 static int das08_isa_attach(struct comedi_device
*dev
,
174 struct comedi_devconfig
*it
)
176 const struct das08_board_struct
*thisboard
= comedi_board(dev
);
177 struct das08_private_struct
*devpriv
;
180 devpriv
= kzalloc(sizeof(*devpriv
), GFP_KERNEL
);
183 dev
->private = devpriv
;
185 ret
= comedi_request_region(dev
, it
->options
[0], thisboard
->iosize
);
189 return das08_common_attach(dev
, dev
->iobase
);
192 static void das08_isa_detach(struct comedi_device
*dev
)
194 das08_common_detach(dev
);
195 comedi_legacy_detach(dev
);
198 static struct comedi_driver das08_isa_driver
= {
199 .driver_name
= "isa-das08",
200 .module
= THIS_MODULE
,
201 .attach
= das08_isa_attach
,
202 .detach
= das08_isa_detach
,
203 .board_name
= &das08_isa_boards
[0].name
,
204 .num_names
= ARRAY_SIZE(das08_isa_boards
),
205 .offset
= sizeof(das08_isa_boards
[0]),
207 module_comedi_driver(das08_isa_driver
);
209 MODULE_AUTHOR("Comedi http://www.comedi.org");
210 MODULE_DESCRIPTION("Comedi low-level driver");
211 MODULE_LICENSE("GPL");