2 comedi/drivers/das08_cs.c
5 COMEDI - Linux Control and Measurement Device Interface
6 Copyright (C) 2000 David A. Schleef <ds@schleef.org>
7 Copyright (C) 2001,2002,2003 Frank Mori Hess <fmhess@users.sourceforge.net>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 PCMCIA support code for this driver is adapted from the dummy_cs.c
20 driver of the Linux PCMCIA Card Services package.
22 The initial developer of the original code is David A. Hinds
23 <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
24 are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
28 Description: DAS-08 PCMCIA boards
29 Author: Warren Jasper, ds, Frank Hess
30 Devices: [ComputerBoards] PCM-DAS08 (pcm-das08)
33 This is the PCMCIA-specific support split off from the
36 Options (for pcm-das08):
39 Command support does not exist, but could be added for this board.
42 #include <linux/module.h>
44 #include "../comedi_pcmcia.h"
48 static const struct das08_board_struct das08_cs_boards[] = {
52 .ai_pg = das08_bipolar5,
53 .ai_encoding = das08_pcm_encode12,
60 static int das08_cs_auto_attach(struct comedi_device *dev,
61 unsigned long context)
63 struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);
64 struct das08_private_struct *devpriv;
68 /* The das08 driver needs the board_ptr */
69 dev->board_ptr = &das08_cs_boards[0];
71 link->config_flags |= CONF_AUTO_SET_IO;
72 ret = comedi_pcmcia_enable(dev, NULL);
75 iobase = link->resource[0]->start;
77 devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
81 return das08_common_attach(dev, iobase);
84 static struct comedi_driver driver_das08_cs = {
85 .driver_name = "das08_cs",
86 .module = THIS_MODULE,
87 .auto_attach = das08_cs_auto_attach,
88 .detach = comedi_pcmcia_disable,
91 static int das08_pcmcia_attach(struct pcmcia_device *link)
93 return comedi_pcmcia_auto_config(link, &driver_das08_cs);
96 static const struct pcmcia_device_id das08_cs_id_table[] = {
97 PCMCIA_DEVICE_MANF_CARD(0x01c5, 0x4001),
100 MODULE_DEVICE_TABLE(pcmcia, das08_cs_id_table);
102 static struct pcmcia_driver das08_cs_driver = {
104 .owner = THIS_MODULE,
105 .id_table = das08_cs_id_table,
106 .probe = das08_pcmcia_attach,
107 .remove = comedi_pcmcia_auto_unconfig,
109 module_comedi_pcmcia_driver(driver_das08_cs, das08_cs_driver);
111 MODULE_AUTHOR("David A. Schleef <ds@schleef.org>, "
112 "Frank Mori Hess <fmhess@users.sourceforge.net>");
113 MODULE_DESCRIPTION("Comedi driver for ComputerBoards DAS-08 PCMCIA boards");
114 MODULE_LICENSE("GPL");