1 // SPDX-License-Identifier: GPL-2.0+
3 * comedi/drivers/amplc_pc236.c
4 * Driver for Amplicon PC36AT DIO boards.
6 * Copyright (C) 2002 MEV Ltd. <http://www.mev.co.uk/>
8 * COMEDI - Linux Control and Measurement Device Interface
9 * Copyright (C) 2000 David A. Schleef <ds@schleef.org>
13 * Description: Amplicon PC36AT
14 * Author: Ian Abbott <abbotti@mev.co.uk>
15 * Devices: [Amplicon] PC36AT (pc36at)
16 * Updated: Fri, 25 Jul 2014 15:32:40 +0000
19 * Configuration options - PC36AT:
20 * [0] - I/O port base address
21 * [1] - IRQ (optional)
23 * The PC36AT board has a single 8255 appearing as subdevice 0.
25 * Subdevice 1 pretends to be a digital input device, but it always returns
26 * 0 when read. However, if you run a command with scan_begin_src=TRIG_EXT,
27 * a rising edge on port C bit 3 acts as an external trigger, which can be
28 * used to wake up tasks. This is like the comedi_parport device, but the
29 * only way to physically disable the interrupt on the PC36AT is to remove
30 * the IRQ jumper. If no interrupt is connected, then subdevice 1 is
34 #include <linux/module.h>
36 #include "../comedidev.h"
38 #include "amplc_pc236.h"
40 static int pc236_attach(struct comedi_device
*dev
, struct comedi_devconfig
*it
)
42 struct pc236_private
*devpriv
;
45 devpriv
= comedi_alloc_devpriv(dev
, sizeof(*devpriv
));
49 ret
= comedi_request_region(dev
, it
->options
[0], 0x4);
53 return amplc_pc236_common_attach(dev
, dev
->iobase
, it
->options
[1], 0);
56 static const struct pc236_board pc236_boards
[] = {
62 static struct comedi_driver amplc_pc236_driver
= {
63 .driver_name
= "amplc_pc236",
64 .module
= THIS_MODULE
,
65 .attach
= pc236_attach
,
66 .detach
= comedi_legacy_detach
,
67 .board_name
= &pc236_boards
[0].name
,
68 .offset
= sizeof(struct pc236_board
),
69 .num_names
= ARRAY_SIZE(pc236_boards
),
72 module_comedi_driver(amplc_pc236_driver
);
74 MODULE_AUTHOR("Comedi http://www.comedi.org");
75 MODULE_DESCRIPTION("Comedi driver for Amplicon PC36AT DIO boards");
76 MODULE_LICENSE("GPL");