1 // SPDX-License-Identifier: GPL-2.0+
3 * Comedi driver for National Instruments PCMCIA DAQ-Card DIO-24
4 * Copyright (C) 2002 Daniel Vecino Castel <dvecino@able.es>
6 * PCMCIA crap at end of file is adapted from dummy_cs.c 1.31
7 * 2001/08/24 12:13:13 from the pcmcia package.
8 * The initial developer of the pcmcia dummy_cs.c code is David A. Hinds
9 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
10 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
14 * Driver: ni_daq_dio24
15 * Description: National Instruments PCMCIA DAQ-Card DIO-24
16 * Author: Daniel Vecino Castel <dvecino@able.es>
17 * Devices: [National Instruments] PCMCIA DAQ-Card DIO-24 (ni_daq_dio24)
19 * Updated: Thu, 07 Nov 2002 21:53:06 -0800
21 * This is just a wrapper around the 8255.o driver to properly handle
22 * the PCMCIA interface.
25 #include <linux/module.h>
26 #include <linux/comedi/comedi_pcmcia.h>
27 #include <linux/comedi/comedi_8255.h>
29 static int dio24_auto_attach(struct comedi_device *dev,
30 unsigned long context)
32 struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);
33 struct comedi_subdevice *s;
36 link->config_flags |= CONF_AUTO_SET_IO;
37 ret = comedi_pcmcia_enable(dev, NULL);
40 dev->iobase = link->resource[0]->start;
42 ret = comedi_alloc_subdevices(dev, 1);
47 s = &dev->subdevices[0];
48 return subdev_8255_io_init(dev, s, 0x00);
51 static struct comedi_driver driver_dio24 = {
52 .driver_name = "ni_daq_dio24",
53 .module = THIS_MODULE,
54 .auto_attach = dio24_auto_attach,
55 .detach = comedi_pcmcia_disable,
58 static int dio24_cs_attach(struct pcmcia_device *link)
60 return comedi_pcmcia_auto_config(link, &driver_dio24);
63 static const struct pcmcia_device_id dio24_cs_ids[] = {
64 PCMCIA_DEVICE_MANF_CARD(0x010b, 0x475c), /* daqcard-dio24 */
67 MODULE_DEVICE_TABLE(pcmcia, dio24_cs_ids);
69 static struct pcmcia_driver dio24_cs_driver = {
70 .name = "ni_daq_dio24",
72 .id_table = dio24_cs_ids,
73 .probe = dio24_cs_attach,
74 .remove = comedi_pcmcia_auto_unconfig,
76 module_comedi_pcmcia_driver(driver_dio24, dio24_cs_driver);
78 MODULE_AUTHOR("Daniel Vecino Castel <dvecino@able.es>");
80 "Comedi driver for National Instruments PCMCIA DAQ-Card DIO-24");
81 MODULE_LICENSE("GPL");