1 // SPDX-License-Identifier: GPL-2.0+
3 * Comedi driver for DAS008 PCMCIA boards
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 * PCMCIA support code for this driver is adapted from the dummy_cs.c
10 * driver of the Linux PCMCIA Card Services package.
12 * The initial developer of the original code is David A. Hinds
13 * <dahinds@users.sourceforge.net>. Portions created by David A. Hinds
14 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
19 * Description: DAS-08 PCMCIA boards
20 * Author: Warren Jasper, ds, Frank Hess
21 * Devices: [ComputerBoards] PCM-DAS08 (pcm-das08)
24 * This is the PCMCIA-specific support split off from the
27 * Configuration Options: none, uses PCMCIA auto config
29 * Command support does not exist, but could be added for this board.
32 #include <linux/module.h>
34 #include "../comedi_pcmcia.h"
38 static const struct das08_board_struct das08_cs_boards[] = {
42 .ai_pg = das08_bipolar5,
43 .ai_encoding = das08_pcm_encode12,
50 static int das08_cs_auto_attach(struct comedi_device *dev,
51 unsigned long context)
53 struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);
54 struct das08_private_struct *devpriv;
58 /* The das08 driver needs the board_ptr */
59 dev->board_ptr = &das08_cs_boards[0];
61 link->config_flags |= CONF_AUTO_SET_IO;
62 ret = comedi_pcmcia_enable(dev, NULL);
65 iobase = link->resource[0]->start;
67 devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
71 return das08_common_attach(dev, iobase);
74 static 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,
81 static int das08_pcmcia_attach(struct pcmcia_device *link)
83 return comedi_pcmcia_auto_config(link, &driver_das08_cs);
86 static const struct pcmcia_device_id das08_cs_id_table[] = {
87 PCMCIA_DEVICE_MANF_CARD(0x01c5, 0x4001),
90 MODULE_DEVICE_TABLE(pcmcia, das08_cs_id_table);
92 static struct pcmcia_driver das08_cs_driver = {
95 .id_table = das08_cs_id_table,
96 .probe = das08_pcmcia_attach,
97 .remove = comedi_pcmcia_auto_unconfig,
99 module_comedi_pcmcia_driver(driver_das08_cs, das08_cs_driver);
101 MODULE_AUTHOR("David A. Schleef <ds@schleef.org>");
102 MODULE_AUTHOR("Frank Mori Hess <fmhess@users.sourceforge.net>");
103 MODULE_DESCRIPTION("Comedi driver for ComputerBoards DAS-08 PCMCIA boards");
104 MODULE_LICENSE("GPL");