1 // SPDX-License-Identifier: GPL-2.0+
4 * comedi driver for DAS08 PCI boards
6 * COMEDI - Linux Control and Measurement Device Interface
7 * Copyright (C) 2000 David A. Schleef <ds@schleef.org>
8 * Copyright (C) 2001,2002,2003 Frank Mori Hess <fmhess@users.sourceforge.net>
9 * Copyright (C) 2004 Salvador E. Tropea <set@users.sf.net> <set@ieee.org>
14 * Description: DAS-08 PCI compatible boards
15 * Devices: [ComputerBoards] PCI-DAS08 (pci-das08)
16 * Author: Warren Jasper, ds, Frank Hess
17 * Updated: Fri, 31 Aug 2012 19:19:06 +0100
20 * This is the PCI-specific support split off from the das08 driver.
22 * Configuration Options: not applicable, uses PCI auto config
25 #include <linux/module.h>
27 #include "../comedi_pci.h"
31 static const struct das08_board_struct das08_pci_boards[] = {
35 .ai_pg = das08_bipolar5,
36 .ai_encoding = das08_encode12,
44 static int das08_pci_auto_attach(struct comedi_device *dev,
45 unsigned long context_unused)
47 struct pci_dev *pdev = comedi_to_pci_dev(dev);
48 struct das08_private_struct *devpriv;
51 devpriv = comedi_alloc_devpriv(dev, sizeof(*devpriv));
55 /* The das08 driver needs the board_ptr */
56 dev->board_ptr = &das08_pci_boards[0];
58 ret = comedi_pci_enable(dev);
61 dev->iobase = pci_resource_start(pdev, 2);
63 return das08_common_attach(dev, dev->iobase);
66 static struct comedi_driver das08_pci_comedi_driver = {
67 .driver_name = "pci-das08",
68 .module = THIS_MODULE,
69 .auto_attach = das08_pci_auto_attach,
70 .detach = comedi_pci_detach,
73 static int das08_pci_probe(struct pci_dev *dev,
74 const struct pci_device_id *id)
76 return comedi_pci_auto_config(dev, &das08_pci_comedi_driver,
80 static const struct pci_device_id das08_pci_table[] = {
81 { PCI_DEVICE(PCI_VENDOR_ID_CB, 0x0029) },
84 MODULE_DEVICE_TABLE(pci, das08_pci_table);
86 static struct pci_driver das08_pci_driver = {
88 .id_table = das08_pci_table,
89 .probe = das08_pci_probe,
90 .remove = comedi_pci_auto_unconfig,
92 module_comedi_pci_driver(das08_pci_comedi_driver, das08_pci_driver);
94 MODULE_AUTHOR("Comedi https://www.comedi.org");
95 MODULE_DESCRIPTION("Comedi low-level driver");
96 MODULE_LICENSE("GPL");