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 "../comedi_pcmcia.h"
30 static int dio24_auto_attach(struct comedi_device *dev,
31 unsigned long context)
33 struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);
34 struct comedi_subdevice *s;
37 link->config_flags |= CONF_AUTO_SET_IO;
38 ret = comedi_pcmcia_enable(dev, NULL);
41 dev->iobase = link->resource[0]->start;
43 ret = comedi_alloc_subdevices(dev, 1);
48 s = &dev->subdevices[0];
49 return subdev_8255_init(dev, s, NULL, 0x00);
52 static struct comedi_driver driver_dio24 = {
53 .driver_name = "ni_daq_dio24",
54 .module = THIS_MODULE,
55 .auto_attach = dio24_auto_attach,
56 .detach = comedi_pcmcia_disable,
59 static int dio24_cs_attach(struct pcmcia_device *link)
61 return comedi_pcmcia_auto_config(link, &driver_dio24);
64 static const struct pcmcia_device_id dio24_cs_ids[] = {
65 PCMCIA_DEVICE_MANF_CARD(0x010b, 0x475c), /* daqcard-dio24 */
68 MODULE_DEVICE_TABLE(pcmcia, dio24_cs_ids);
70 static struct pcmcia_driver dio24_cs_driver = {
71 .name = "ni_daq_dio24",
73 .id_table = dio24_cs_ids,
74 .probe = dio24_cs_attach,
75 .remove = comedi_pcmcia_auto_unconfig,
77 module_comedi_pcmcia_driver(driver_dio24, dio24_cs_driver);
79 MODULE_AUTHOR("Daniel Vecino Castel <dvecino@able.es>");
81 "Comedi driver for National Instruments PCMCIA DAQ-Card DIO-24");
82 MODULE_LICENSE("GPL");