use of free_irq() and SA_SHIRQ, and pci_device_id tables.
#define START_AI_EXT 0x01 /* start measure on external trigger */
#define STOP_AI_EXT 0x02 /* stop measure on external trigger */
-comedi_lrange range_pci9118dg_hr={ 8, {
+static comedi_lrange range_pci9118dg_hr={ 8, {
BIP_RANGE(5),
BIP_RANGE(2.5),
BIP_RANGE(1.25),
}
};
-comedi_lrange range_pci9118hg={ 8, {
+static comedi_lrange range_pci9118hg={ 8, {
BIP_RANGE(5),
BIP_RANGE(0.5),
BIP_RANGE(0.05),
} boardtype;
+static struct pci_device_id pci9118_pci_table[] __devinitdata = {
+ { PCI_VENDOR_ID_AMCC, 0x80d9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+ { 0 }
+};
+MODULE_DEVICE_TABLE(pci, pci9118_pci_table);
+
static boardtype boardtypes[] =
{
{"pci9118dg", PCI_VENDOR_ID_AMCC, 0x80d9,
if (devpriv->dmabuf_virt[1]) free_pages(devpriv->dmabuf_virt[1],devpriv->dmabuf_pages[1]);
}
- if(dev->irq) free_irq(dev->irq,dev);
+ if(dev->irq) comedi_free_irq(dev->irq,dev);
if(dev->iobase) release_region(dev->iobase,this_board->iorange_9118);
#undef PCI171X_EXTDEBUG
+#undef DPRINTK
#ifdef PCI171X_EXTDEBUG
#define DPRINTK(fmt, args...) rt_printk(fmt, ## args)
#else
unsigned int fifo_half_size; // size of FIFO/2
} boardtype;
+static struct pci_device_id pci1710_pci_table[] = __devinitdata {
+ { ADVANTECH_VENDOR, 0x1710, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+ { ADVANTECH_VENDOR, 0x1711, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+ { ADVANTECH_VENDOR, 0x1713, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+ { ADVANTECH_VENDOR, 0x1720, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+ { ADVANTECH_VENDOR, 0x1731, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+ { 0 }
+};
+MODULE_DEVICE_TABLE(pci, pci1710_pci_table);
+
static boardtype boardtypes[] =
{
{"pci1710", ADVANTECH_VENDOR, 0x1710,
if (dev->private)
if (devpriv->valid) pci1710_reset(dev);
- if (dev->irq) free_irq(dev->irq,dev);
+ if (dev->irq) comedi_free_irq(dev->irq,dev);
if (dev->iobase) release_region(dev->iobase,this_board->iorange);
if (pci_list_builded) {
return card;
}
+
+static int amcc_init(void)
+{
+ return 0;
+}
+
+static void amcc_cleanup(void)
+{
+
+}
+
+module_init(amcc_init);
+module_exit(amcc_cleanup);
+
+EXPORT_SYMBOL(pci_card_alloc);
+EXPORT_SYMBOL(pci_card_data);
+EXPORT_SYMBOL(pci_card_free);
+EXPORT_SYMBOL(pci_card_list_cleanup);
+EXPORT_SYMBOL(pci_card_list_display);
+EXPORT_SYMBOL(pci_card_list_init);
+EXPORT_SYMBOL(select_and_alloc_pci_card);
+EXPORT_SYMBOL(find_free_pci_card_by_device);
+EXPORT_SYMBOL(find_free_pci_card_by_position);
+EXPORT_SYMBOL(amcc_devices);
+
+
+
int find_free_pci_card_by_position(unsigned short vendor_id, unsigned short device_id, unsigned short pci_bus, unsigned short pci_slot, struct pcilst_struct **card);
struct pcilst_struct *select_and_alloc_pci_card(unsigned short vendor_id, unsigned short device_id, unsigned short pci_bus, unsigned short pci_slot);
-int pci_card_alloc(struct pcilst_struct *amcc);
+//int pci_card_alloc(struct pcilst_struct *amcc);
int pci_card_free(struct pcilst_struct *amcc);
void pci_card_list_display(void);
int pci_card_data(struct pcilst_struct *amcc,
dev->board_name = thisboard->name;
/* Register the interrupt handler. */
- irq_hdl = comedi_request_irq(devpriv->pci_dev->irq, pci230_interrupt, 0, "PCI230", dev );
+ irq_hdl = comedi_request_irq(devpriv->pci_dev->irq, pci230_interrupt, SA_SHIRQ, "amplc_pci230", dev);
if(irq_hdl<0) {
printk("comedi%d: amplc_pci230: unable to register irq, commands will not be available %d\n", dev->minor, devpriv->pci_dev->irq);
}
*/
static int cb_pcidas_attach(comedi_device *dev,comedi_devconfig *it);
static int cb_pcidas_detach(comedi_device *dev);
-comedi_driver driver_cb_pcidas={
+static comedi_driver driver_cb_pcidas={
driver_name: "cb_pcidas",
module: THIS_MODULE,
attach: cb_pcidas_attach,
Subdevice 3 pretends to be a digital input subdevice, but it always
returns 0 when read. However, if you run a command with
scan_begin_src=TRIG_EXT, it uses pin 13 as a external triggering
-pin, which can be used to wake up tasks.
+pin, which can be used to wake up tasks. (or is that pin 10. --ds)
*/
/*
static int parport_attach(comedi_device *dev,comedi_devconfig *it);
static int parport_detach(comedi_device *dev);
-comedi_driver driver_parport={
+static comedi_driver driver_parport={
driver_name: "comedi_parport",
module: THIS_MODULE,
attach: parport_attach,
s=dev->subdevices+1;
s->type=COMEDI_SUBD_DI;
s->subdev_flags=SDF_READABLE;
- s->n_chan=4;
+ s->n_chan=5;
s->maxdata=1;
s->range_table=&range_digital;
s->insn_bits = parport_insn_b;
static int timer_inttrig(comedi_device *dev, comedi_subdevice *s, unsigned int trig_num);
static int timer_start_cmd(comedi_device *dev, comedi_subdevice *s);
-comedi_driver driver_timer={
+static comedi_driver driver_timer={
module: THIS_MODULE,
driver_name: "comedi_rt_timer",
attach: timer_attach,
static int daqboard2000_attach(comedi_device *dev,comedi_devconfig *it);
static int daqboard2000_detach(comedi_device *dev);
-comedi_driver driver_daqboard2000 = {
+static comedi_driver driver_daqboard2000 = {
driver_name: "daqboard2000",
module: THIS_MODULE,
attach: daqboard2000_attach,
static int das16_attach(comedi_device *dev,comedi_devconfig *it);
static int das16_detach(comedi_device *dev);
-comedi_driver driver_das16={
+static comedi_driver driver_das16={
driver_name: "das16",
module: THIS_MODULE,
attach: das16_attach,
};
*/
-comedi_driver driver_das1800={
+static comedi_driver driver_das1800={
driver_name: "das1800",
module: THIS_MODULE,
attach: das1800_attach,
static int das6402_attach(comedi_device *dev,comedi_devconfig *it);
static int das6402_detach(comedi_device *dev);
-comedi_driver driver_das6402={
+static comedi_driver driver_das6402={
driver_name: "das6402",
module: THIS_MODULE,
attach: das6402_attach,
static int das6402_detach(comedi_device *dev)
{
- if(dev->irq)free_irq(dev->irq,dev);
+ if(dev->irq)comedi_free_irq(dev->irq,dev);
if(dev->iobase)release_region(dev->iobase,DAS6402_SIZE);
return 0;
printk("comedi%d: dt2811: remove\n", dev->minor);
if (dev->irq) {
- free_irq(dev->irq, dev);
+ comedi_free_irq(dev->irq, dev);
}
if(dev->iobase){
release_region(dev->iobase, DT2811_SIZE);
static int dt2814_attach(comedi_device *dev,comedi_devconfig *it);
static int dt2814_detach(comedi_device *dev);
-comedi_driver driver_dt2814={
+static comedi_driver driver_dt2814={
driver_name: "dt2814",
module: THIS_MODULE,
attach: dt2814_attach,
printk("comedi%d: dt2814: remove\n",dev->minor);
if(dev->irq){
- free_irq(dev->irq,dev);
+ comedi_free_irq(dev->irq,dev);
}
if(dev->iobase){
release_region(dev->iobase,DT2814_SIZE);
static int dt2815_attach(comedi_device *dev,comedi_devconfig *it);
static int dt2815_detach(comedi_device *dev);
-comedi_driver driver_dt2815={
+static comedi_driver driver_dt2815={
driver_name: "dt2815",
module: THIS_MODULE,
attach: dt2815_attach,
static int dt2817_attach(comedi_device *dev,comedi_devconfig *it);
static int dt2817_detach(comedi_device *dev);
-comedi_driver driver_dt2817={
+static comedi_driver driver_dt2817={
driver_name: "dt2817",
module: THIS_MODULE,
attach: dt2817_attach,
static int dt282x_attach(comedi_device * dev, comedi_devconfig * it);
static int dt282x_detach(comedi_device * dev);
-comedi_driver driver_dt282x={
+static comedi_driver driver_dt282x={
driver_name: "dt282x",
module: THIS_MODULE,
attach: dt282x_attach,
static void free_resources(comedi_device *dev)
{
if (dev->irq) {
- free_irq(dev->irq, dev);
+ comedi_free_irq(dev->irq, dev);
}
if(dev->iobase)
release_region(dev->iobase, DT2821_SIZE);
static int dt3000_attach(comedi_device *dev,comedi_devconfig *it);
static int dt3000_detach(comedi_device *dev);
-comedi_driver driver_dt3000={
+static comedi_driver driver_dt3000={
driver_name: "dt3000",
module: THIS_MODULE,
attach: dt3000_attach,
int ret=0;
printk("dt3000:");
-#ifdef PCI_SUPPORT_VER1
- if(!pcibios_present()){
-#else
if(!pci_present()){
-#endif
printk(" no PCI bus\n");
return -EINVAL;
}
}
-#ifdef PCI_SUPPORT_VER1
-static int dt_pci_find_device(comedi_device *dev);
-static int setup_pci(comedi_device *dev);
-
-static int dt_pci_probe(comedi_device *dev)
-{
- int board;
- int ret;
-
- ret=dt_pci_find_device(NULL,&board);
- if(ret==0)
- return 0;
-
- setup_pci(dev);
-
- return 1;
-}
-
-static int dt_pci_find_device(comedi_device *dev)
-{
- int i;
- unsigned char pci_bus;
- unsigned char pci_dev_fn;
-
- for(i=0;i<n_dt3k_boards;i++){
- if(pcibios_find_device(PCI_VENDOR_ID_DT,
- dt3k_boardtypes[i].device_id,
- 0,
- &pci_bus,
- &pci_dev_fn) == PCIBIOS_SUCCESSFUL)
- {
- devpriv->pci_bus=pci_bus;
- devpriv->pci_dev_fn=pci_dev_fn;
- dev->board_ptr=dt3k_boards+i;
- return 1;
- }
- }
- return 0;
-}
-
-static int setup_pci(comedi_device *dev)
-{
- unsigned long offset;
- u32 addr;
-
- pcibios_read_config_dword(devpriv->pci_bus,devpriv->pci_device_fn,
- PCI_BASE_ADDRESS_0,&addr);
- devpriv->phys_addr=addr;
- offset=devpriv->phys_addr & ~PAGE_MASK;
- devpriv->io_addr=ioremap(devpriv->phys_addr&PAGE_MASK,DT3000_SIZE+offset)
- +offset;
-#if DEBUG
- printk("0x%08lx mapped to %p, ",devpriv->phys_addr,devpriv->io_addr);
-#endif
-
- dev->iobase = (int)devpriv->io_addr;
-
- return 0;
-}
-
-#else
-
static struct pci_dev *dt_pci_find_device(struct pci_dev *from,int *board);
static int setup_pci(comedi_device *dev);
}
#endif
-#endif /* PCI_SUPPORT_VER1 */
static int fl512_attach(comedi_device *dev,comedi_devconfig *it);
static int fl512_detach(comedi_device *dev);
-comedi_driver driver_fl512 = {
+static comedi_driver driver_fl512 = {
driver_name: "fl512",
module: THIS_MODULE,
attach: fl512_attach,
static int pci20xxx_attach(comedi_device * dev, comedi_devconfig * it);
static int pci20xxx_detach(comedi_device * dev);
-comedi_driver driver_pci20xxx = {
+static comedi_driver driver_pci20xxx = {
driver_name: "ii_pci20kc",
module: THIS_MODULE,
attach: pci20xxx_attach,
static int mpc8260cpm_attach(comedi_device *dev,comedi_devconfig *it);
static int mpc8260cpm_detach(comedi_device *dev);
-comedi_driver driver_mpc8260cpm={
+static comedi_driver driver_mpc8260cpm={
driver_name: "dummy",
module: THIS_MODULE,
attach: mpc8260cpm_attach,
static int multiq3_attach(comedi_device *dev,comedi_devconfig *it);
static int multiq3_detach(comedi_device *dev);
-comedi_driver driver_multiq3={
+static comedi_driver driver_multiq3={
driver_name: "multiq3",
module: THIS_MODULE,
attach: multiq3_attach,
unsigned short ao_chans;
unsigned short ao_bits;
}ni_670x_board;
-ni_670x_board ni_670x_boards[] =
+static ni_670x_board ni_670x_boards[] =
{
{
dev_id : 0x2c90,
static int a2150_detach(comedi_device *dev);
static int a2150_cancel(comedi_device *dev, comedi_subdevice *s);
-comedi_driver driver_a2150={
+static comedi_driver driver_a2150={
driver_name: "ni_at_a2150",
module: THIS_MODULE,
attach: a2150_attach,
static int ni_atmio_attach(comedi_device *dev,comedi_devconfig *it);
static int ni_atmio_detach(comedi_device *dev);
-comedi_driver driver_atmio={
+static comedi_driver driver_atmio={
driver_name: "ni_atmio",
module: THIS_MODULE,
attach: ni_atmio_attach,
static void reset_atmio16d(comedi_device *dev);
/* main driver struct */
-comedi_driver driver_atmio16d={
+static comedi_driver driver_atmio16d={
driver_name: "atmio16",
module: THIS_MODULE,
attach: atmio16d_attach,
subdev_8255_cleanup(dev,dev->subdevices + 3);
if(dev->irq)
- free_irq(dev->irq,dev);
+ comedi_free_irq(dev->irq,dev);
reset_atmio16d(dev);
}
/* not all boards can deglitch, but this shouldn't hurt */
- if(cmd->flags & TRIG_DEGLITCH) /* XXX ? */
+ if(cmd->chanlist[i] & CR_DITHER)
conf |= AO_Deglitch;
/* analog reference */
static int mio_cs_attach(comedi_device *dev,comedi_devconfig *it);
static int mio_cs_detach(comedi_device *dev);
-comedi_driver driver_ni_mio_cs={
+static comedi_driver driver_ni_mio_cs={
driver_name: "ni_mio_cs",
module: THIS_MODULE,
attach: mio_cs_attach,
static int nidio_attach(comedi_device *dev,comedi_devconfig *it);
static int nidio_detach(comedi_device *dev);
-comedi_driver driver_pcidio={
+static comedi_driver driver_pcidio={
driver_name: "ni_pcidio",
module: THIS_MODULE,
attach: nidio_attach,
static int pcimio_attach(comedi_device *dev,comedi_devconfig *it);
static int pcimio_detach(comedi_device *dev);
-comedi_driver driver_pcimio={
+static comedi_driver driver_pcimio={
driver_name: "ni_pcimio",
module: THIS_MODULE,
attach: pcimio_attach,
printk("comedi%d: pcl711: remove\n", dev->minor);
if (dev->irq)
- free_irq(dev->irq, dev);
+ comedi_free_irq(dev->irq, dev);
if (dev->iobase)
release_region(dev->iobase, PCL711_SIZE);
#define n_boardtypes (sizeof(boardtypes)/sizeof(boardtype))
#define this_board ((boardtype *)dev->board_ptr)
-comedi_driver driver_pcl724={
+static comedi_driver driver_pcl724={
driver_name: "pcl724",
module: THIS_MODULE,
attach: pcl724_attach,
#ifdef PCL724_IRQ
if(dev->irq){
- free_irq(dev->irq,dev);
+ comedi_free_irq(dev->irq,dev);
}
#endif
static int pcl725_attach(comedi_device *dev,comedi_devconfig *it);
static int pcl725_detach(comedi_device *dev);
-comedi_driver driver_pcl725={
+static comedi_driver driver_pcl725={
driver_name: "pcl725",
module: THIS_MODULE,
attach: pcl725_attach,
#ifdef ACL6126_IRQ
if(dev->irq){
- free_irq(dev->irq,dev);
+ comedi_free_irq(dev->irq,dev);
}
#endif
free_dma(devpriv->dma);
}
if (dev->irq)
- free_irq(dev->irq, dev);
+ comedi_free_irq(dev->irq, dev);
if (dev->iobase)
release_region(dev->iobase, this_board->io_range);
}
if (devpriv->dma) free_dma(devpriv->dma);
if (devpriv->dmabuf[0]) free_pages(devpriv->dmabuf[0], devpriv->dmapages[0]);
if (devpriv->dmabuf[1]) free_pages(devpriv->dmabuf[1], devpriv->dmapages[1]);
- if (devpriv->rtc_irq) free_irq(devpriv->rtc_irq, dev);
+ if (devpriv->rtc_irq) comedi_free_irq(devpriv->rtc_irq, dev);
if ((devpriv->dma_rtc)&&(RTC_lock==1)) {
if (devpriv->rtc_iobase)
release_region(devpriv->rtc_iobase, devpriv->rtc_iosize);
devpriv->rtc_iobase=RTC_PORT(0);
devpriv->rtc_iosize=RTC_IO_EXTENT;
RTC_lock++;
- if (!comedi_request_irq(RTC_IRQ, interrupt_pcl818_ai_mode13_dma_rtc, SA_SHIRQ, "pcl818 DMA (RTC)", dev)) {
+ if (!comedi_request_irq(RTC_IRQ, interrupt_pcl818_ai_mode13_dma_rtc, 0, "pcl818 DMA (RTC)", dev)) {
devpriv->dma_rtc=1;
devpriv->rtc_irq=RTC_IRQ;
rt_printk(", dma_irq=%d", devpriv->rtc_irq);
static int pcm3730_attach(comedi_device *dev,comedi_devconfig *it);
static int pcm3730_detach(comedi_device *dev);
-comedi_driver driver_pcm3730={
+static comedi_driver driver_pcm3730={
driver_name: "pcm3730",
module: THIS_MODULE,
attach: pcm3730_attach,
#define n_boards (sizeof(boards)/sizeof(boards[0]))
#define this_board ((struct boarddef_struct *)dev->board_ptr)
-comedi_driver driver_poc=
+static comedi_driver driver_poc=
{
driver_name: "poc",
module: THIS_MODULE,
static int daqp_attach(comedi_device *dev,comedi_devconfig *it);
static int daqp_detach(comedi_device *dev);
-comedi_driver driver_daqp={
+static comedi_driver driver_daqp={
driver_name: "daqp",
module: THIS_MODULE,
attach: daqp_attach,
dev->irq = devpriv->pci_dev->irq;
if(dev->irq>0){
if((ret=comedi_request_irq (dev->irq, rtd_interrupt,
- 0, "rtd520", dev))<0)
+ SA_SHIRQ, "rtd520", dev))<0)
return ret;
printk("( irq = %d )\n", dev->irq);
} else {
release_region(dev->iobase, RTI800_SIZE);
if(dev->irq)
- free_irq(dev->irq,dev);
+ comedi_free_irq(dev->irq,dev);
return 0;
}
/* This is used by modprobe to translate PCI IDs to drivers. Should
* only be used for PCI and ISA-PnP devices */
+/* Please add your PCI vendor ID to comedidev.h, and it will be forwarded
+ * upstream. */
#define PCI_VENDOR_ID_SKEL 0xdafe
static struct pci_device_id skel_pci_table[] __devinitdata = {
{ PCI_VENDOR_ID_SKEL, 0x0100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
int have_dio;
} dnp_board;
-dnp_board dnp_boards[] = { /* we only support one DNP 'board' */
+static dnp_board dnp_boards[] = { /* we only support one DNP 'board' */
{ /* variant at the moment */
name: "dnp-1486",
ai_chans: 16,
static int dnp_attach(comedi_device *dev,comedi_devconfig *it);
static int dnp_detach(comedi_device *dev);
-comedi_driver driver_dnp = {
+static comedi_driver driver_dnp = {
driver_name: "ssv_dnp",
module: THIS_MODULE,
attach: dnp_attach,
static int dnp_detach(comedi_device *dev)
{
- /* deallocate I/O ports: */
-# warning region should be released here!
- /*release_region(0x22,2);*/
-
/* configure all ports as input (default) */
outb(PAMR,CSCIR); outb(0x00,CSCDR);
outb(PBMR,CSCIR); outb(0x00,CSCDR);