This source file includes following definitions.
- dio24_auto_attach
- dio24_cs_attach
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 #include <linux/module.h>
26 #include "../comedi_pcmcia.h"
27
28 #include "8255.h"
29
30 static int dio24_auto_attach(struct comedi_device *dev,
31 unsigned long context)
32 {
33 struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);
34 struct comedi_subdevice *s;
35 int ret;
36
37 link->config_flags |= CONF_AUTO_SET_IO;
38 ret = comedi_pcmcia_enable(dev, NULL);
39 if (ret)
40 return ret;
41 dev->iobase = link->resource[0]->start;
42
43 ret = comedi_alloc_subdevices(dev, 1);
44 if (ret)
45 return ret;
46
47
48 s = &dev->subdevices[0];
49 return subdev_8255_init(dev, s, NULL, 0x00);
50 }
51
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,
57 };
58
59 static int dio24_cs_attach(struct pcmcia_device *link)
60 {
61 return comedi_pcmcia_auto_config(link, &driver_dio24);
62 }
63
64 static const struct pcmcia_device_id dio24_cs_ids[] = {
65 PCMCIA_DEVICE_MANF_CARD(0x010b, 0x475c),
66 PCMCIA_DEVICE_NULL
67 };
68 MODULE_DEVICE_TABLE(pcmcia, dio24_cs_ids);
69
70 static struct pcmcia_driver dio24_cs_driver = {
71 .name = "ni_daq_dio24",
72 .owner = THIS_MODULE,
73 .id_table = dio24_cs_ids,
74 .probe = dio24_cs_attach,
75 .remove = comedi_pcmcia_auto_unconfig,
76 };
77 module_comedi_pcmcia_driver(driver_dio24, dio24_cs_driver);
78
79 MODULE_AUTHOR("Daniel Vecino Castel <dvecino@able.es>");
80 MODULE_DESCRIPTION(
81 "Comedi driver for National Instruments PCMCIA DAQ-Card DIO-24");
82 MODULE_LICENSE("GPL");