2 * Comedi driver for National Instruments PCMCIA DAQ-Card DIO-24
3 * Copyright (C) 2002 Daniel Vecino Castel <dvecino@able.es>
5 * PCMCIA crap at end of file is adapted from dummy_cs.c 1.31
6 * 2001/08/24 12:13:13 from the pcmcia package.
7 * The initial developer of the pcmcia dummy_cs.c code is David A. Hinds
8 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
9 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
23 * Driver: ni_daq_dio24
24 * Description: National Instruments PCMCIA DAQ-Card DIO-24
25 * Author: Daniel Vecino Castel <dvecino@able.es>
26 * Devices: [National Instruments] PCMCIA DAQ-Card DIO-24 (ni_daq_dio24)
28 * Updated: Thu, 07 Nov 2002 21:53:06 -0800
30 * This is just a wrapper around the 8255.o driver to properly handle
31 * the PCMCIA interface.
34 #include <linux/module.h>
35 #include "../comedi_pcmcia.h"
39 static int dio24_auto_attach(struct comedi_device *dev,
40 unsigned long context)
42 struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);
43 struct comedi_subdevice *s;
46 link->config_flags |= CONF_AUTO_SET_IO;
47 ret = comedi_pcmcia_enable(dev, NULL);
50 dev->iobase = link->resource[0]->start;
52 ret = comedi_alloc_subdevices(dev, 1);
57 s = &dev->subdevices[0];
58 return subdev_8255_init(dev, s, NULL, 0x00);
61 static struct comedi_driver driver_dio24 = {
62 .driver_name = "ni_daq_dio24",
63 .module = THIS_MODULE,
64 .auto_attach = dio24_auto_attach,
65 .detach = comedi_pcmcia_disable,
68 static int dio24_cs_attach(struct pcmcia_device *link)
70 return comedi_pcmcia_auto_config(link, &driver_dio24);
73 static const struct pcmcia_device_id dio24_cs_ids[] = {
74 PCMCIA_DEVICE_MANF_CARD(0x010b, 0x475c), /* daqcard-dio24 */
77 MODULE_DEVICE_TABLE(pcmcia, dio24_cs_ids);
79 static struct pcmcia_driver dio24_cs_driver = {
80 .name = "ni_daq_dio24",
82 .id_table = dio24_cs_ids,
83 .probe = dio24_cs_attach,
84 .remove = comedi_pcmcia_auto_unconfig,
86 module_comedi_pcmcia_driver(driver_dio24, dio24_cs_driver);
88 MODULE_AUTHOR("Daniel Vecino Castel <dvecino@able.es>");
90 "Comedi driver for National Instruments PCMCIA DAQ-Card DIO-24");
91 MODULE_LICENSE("GPL");