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>
33 #include <linux/comedi/comedi_pcmcia.h>
37 static const struct das08_board_struct das08_cs_boards[] = {
41 .ai_pg = das08_bipolar5,
42 .ai_encoding = das08_pcm_encode12,
49 static int das08_cs_auto_attach(struct comedi_device *dev,
50 unsigned long context)
52 struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);
53 struct das08_private_struct *devpriv;
57 /* The das08 driver needs the board_ptr */
58 dev->board_ptr = &das08_cs_boards[0];
60 link->config_flags |= CONF_AUTO_SET_IO;
61 ret = comedi_pcmcia_enable(dev, NULL);
64 iobase = link->resource[0]->start;
66 devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
70 return das08_common_attach(dev, iobase);
73 static struct comedi_driver driver_das08_cs = {
74 .driver_name = "das08_cs",
75 .module = THIS_MODULE,
76 .auto_attach = das08_cs_auto_attach,
77 .detach = comedi_pcmcia_disable,
80 static int das08_pcmcia_attach(struct pcmcia_device *link)
82 return comedi_pcmcia_auto_config(link, &driver_das08_cs);
85 static const struct pcmcia_device_id das08_cs_id_table[] = {
86 PCMCIA_DEVICE_MANF_CARD(0x01c5, 0x4001),
89 MODULE_DEVICE_TABLE(pcmcia, das08_cs_id_table);
91 static struct pcmcia_driver das08_cs_driver = {
94 .id_table = das08_cs_id_table,
95 .probe = das08_pcmcia_attach,
96 .remove = comedi_pcmcia_auto_unconfig,
98 module_comedi_pcmcia_driver(driver_das08_cs, das08_cs_driver);
100 MODULE_AUTHOR("David A. Schleef <ds@schleef.org>");
101 MODULE_AUTHOR("Frank Mori Hess <fmhess@users.sourceforge.net>");
102 MODULE_DESCRIPTION("Comedi driver for ComputerBoards DAS-08 PCMCIA boards");
103 MODULE_LICENSE("GPL");