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
26
27
28
29
30
31
32#include <linux/module.h>
33
34#include "../comedi_pcmcia.h"
35
36#include "das08.h"
37
38static const struct das08_board_struct das08_cs_boards[] = {
39 {
40 .name = "pcm-das08",
41 .ai_nbits = 12,
42 .ai_pg = das08_bipolar5,
43 .ai_encoding = das08_pcm_encode12,
44 .di_nchan = 3,
45 .do_nchan = 3,
46 .iosize = 16,
47 },
48};
49
50static int das08_cs_auto_attach(struct comedi_device *dev,
51 unsigned long context)
52{
53 struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);
54 struct das08_private_struct *devpriv;
55 unsigned long iobase;
56 int ret;
57
58
59 dev->board_ptr = &das08_cs_boards[0];
60
61 link->config_flags |= CONF_AUTO_SET_IO;
62 ret = comedi_pcmcia_enable(dev, NULL);
63 if (ret)
64 return ret;
65 iobase = link->resource[0]->start;
66
67 devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
68 if (!devpriv)
69 return -ENOMEM;
70
71 return das08_common_attach(dev, iobase);
72}
73
74static struct comedi_driver driver_das08_cs = {
75 .driver_name = "das08_cs",
76 .module = THIS_MODULE,
77 .auto_attach = das08_cs_auto_attach,
78 .detach = comedi_pcmcia_disable,
79};
80
81static int das08_pcmcia_attach(struct pcmcia_device *link)
82{
83 return comedi_pcmcia_auto_config(link, &driver_das08_cs);
84}
85
86static const struct pcmcia_device_id das08_cs_id_table[] = {
87 PCMCIA_DEVICE_MANF_CARD(0x01c5, 0x4001),
88 PCMCIA_DEVICE_NULL
89};
90MODULE_DEVICE_TABLE(pcmcia, das08_cs_id_table);
91
92static struct pcmcia_driver das08_cs_driver = {
93 .name = "pcm-das08",
94 .owner = THIS_MODULE,
95 .id_table = das08_cs_id_table,
96 .probe = das08_pcmcia_attach,
97 .remove = comedi_pcmcia_auto_unconfig,
98};
99module_comedi_pcmcia_driver(driver_das08_cs, das08_cs_driver);
100
101MODULE_AUTHOR("David A. Schleef <ds@schleef.org>");
102MODULE_AUTHOR("Frank Mori Hess <fmhess@users.sourceforge.net>");
103MODULE_DESCRIPTION("Comedi driver for ComputerBoards DAS-08 PCMCIA boards");
104MODULE_LICENSE("GPL");
105