Version:  2.0.40 2.2.26 2.4.37 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13 3.14 3.15 3.16

Linux/drivers/staging/comedi/drivers/ni_daq_dio24.c

  1 /*
  2     comedi/drivers/ni_daq_dio24.c
  3     Driver for National Instruments PCMCIA DAQ-Card DIO-24
  4     Copyright (C) 2002 Daniel Vecino Castel <dvecino@able.es>
  5 
  6     PCMCIA crap at end of file is adapted from dummy_cs.c 1.31
  7     2001/08/24 12:13:13 from the pcmcia package.
  8     The initial developer of the pcmcia dummy_cs.c code is David A. Hinds
  9     <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
 10     are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
 11 
 12     This program is free software; you can redistribute it and/or modify
 13     it under the terms of the GNU General Public License as published by
 14     the Free Software Foundation; either version 2 of the License, or
 15     (at your option) any later version.
 16 
 17     This program is distributed in the hope that it will be useful,
 18     but WITHOUT ANY WARRANTY; without even the implied warranty of
 19     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 20     GNU General Public License for more details.
 21 */
 22 /*
 23 Driver: ni_daq_dio24
 24 Description: National Instruments PCMCIA DAQ-Card DIO-24
 25 Author: Daniel Vecino Castel <dvecino@able.es>
 26 Devices: [National Instruments] PCMCIA DAQ-Card DIO-24 (ni_daq_dio24)
 27 Status: ?
 28 Updated: Thu, 07 Nov 2002 21:53:06 -0800
 29 
 30 This is just a wrapper around the 8255.o driver to properly handle
 31 the PCMCIA interface.
 32 */
 33 
 34 #include <linux/module.h>
 35 #include "../comedidev.h"
 36 
 37 #include <pcmcia/cistpl.h>
 38 #include <pcmcia/cisreg.h>
 39 #include <pcmcia/ds.h>
 40 
 41 #include "8255.h"
 42 
 43 static int dio24_auto_attach(struct comedi_device *dev,
 44                              unsigned long context)
 45 {
 46         struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);
 47         struct comedi_subdevice *s;
 48         int ret;
 49 
 50         link->config_flags |= CONF_AUTO_SET_IO;
 51         ret = comedi_pcmcia_enable(dev, NULL);
 52         if (ret)
 53                 return ret;
 54         dev->iobase = link->resource[0]->start;
 55 
 56         ret = comedi_alloc_subdevices(dev, 1);
 57         if (ret)
 58                 return ret;
 59 
 60         /* 8255 dio */
 61         s = &dev->subdevices[0];
 62         ret = subdev_8255_init(dev, s, NULL, dev->iobase);
 63         if (ret)
 64                 return ret;
 65 
 66         return 0;
 67 }
 68 
 69 static struct comedi_driver driver_dio24 = {
 70         .driver_name    = "ni_daq_dio24",
 71         .module         = THIS_MODULE,
 72         .auto_attach    = dio24_auto_attach,
 73         .detach         = comedi_pcmcia_disable,
 74 };
 75 
 76 static int dio24_cs_attach(struct pcmcia_device *link)
 77 {
 78         return comedi_pcmcia_auto_config(link, &driver_dio24);
 79 }
 80 
 81 static const struct pcmcia_device_id dio24_cs_ids[] = {
 82         PCMCIA_DEVICE_MANF_CARD(0x010b, 0x475c),        /* daqcard-dio24 */
 83         PCMCIA_DEVICE_NULL
 84 };
 85 MODULE_DEVICE_TABLE(pcmcia, dio24_cs_ids);
 86 
 87 static struct pcmcia_driver dio24_cs_driver = {
 88         .name           = "ni_daq_dio24",
 89         .owner          = THIS_MODULE,
 90         .id_table       = dio24_cs_ids,
 91         .probe          = dio24_cs_attach,
 92         .remove         = comedi_pcmcia_auto_unconfig,
 93 };
 94 module_comedi_pcmcia_driver(driver_dio24, dio24_cs_driver);
 95 
 96 MODULE_AUTHOR("Daniel Vecino Castel <dvecino@able.es>");
 97 MODULE_DESCRIPTION(
 98         "Comedi driver for National Instruments PCMCIA DAQ-Card DIO-24");
 99 MODULE_LICENSE("GPL");
100 

This page was automatically generated by LXR 0.3.1 (source).  •  Linux is a registered trademark of Linus Torvalds  •  Contact us