From 88ee6659cd9061e17e787e1d8d520687fe60b6c2 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Sun, 27 May 2001 22:35:48 +0000 Subject: [PATCH] ifdef all the remaining trig related code --- comedi/drivers/das08.c | 5 +++++ comedi/drivers/das6402.c | 4 ++++ comedi/drivers/ni_pcidio.c | 4 ++++ comedi/drivers/pcl711.c | 6 ++++++ comedi/drivers/pcl812.c | 8 ++++++++ comedi/drivers/pcl818.c | 20 ++++++++++++++++++++ 6 files changed, 47 insertions(+) diff --git a/comedi/drivers/das08.c b/comedi/drivers/das08.c index 4a1e7678..48e5f97b 100644 --- a/comedi/drivers/das08.c +++ b/comedi/drivers/das08.c @@ -569,8 +569,13 @@ static int das08_attach(comedi_device *dev,comedi_devconfig *it) } devpriv->pdev = pdev; // read base addresses +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) pci_iobase = pdev->base_address[1] & PCI_BASE_ADDRESS_IO_MASK; iobase = pdev->base_address[2] & PCI_BASE_ADDRESS_IO_MASK; +#else + pci_iobase = pdev->resource[1].start; + iobase = pdev->resource[2].start; +#endif // reserve io ports for 9052 pci chip if(check_region(pci_iobase,PCIDAS08_SIZE)<0){ diff --git a/comedi/drivers/das6402.c b/comedi/drivers/das6402.c index c5ff4a27..0e5c8466 100644 --- a/comedi/drivers/das6402.c +++ b/comedi/drivers/das6402.c @@ -243,6 +243,7 @@ static int das6402_ai_cancel(comedi_device *dev,comedi_subdevice *s) return 0; } +#ifdef CONFIG_COMEDI_TRIG static int das6402_ai_mode2(comedi_device *dev,comedi_subdevice *s,comedi_trig *it) { devpriv->das6402_ignoreirq=1; @@ -263,6 +264,7 @@ static int das6402_ai_mode2(comedi_device *dev,comedi_subdevice *s,comedi_trig * return 0; } +#endif static int board_init(comedi_device *dev) @@ -357,7 +359,9 @@ static int das6402_attach(comedi_device *dev,comedi_devconfig *it) s->type=COMEDI_SUBD_AI; s->subdev_flags=SDF_READABLE; s->n_chan=8; +#ifdef CONFIG_COMEDI_TRIG s->trig[2]=das6402_ai_mode2; +#endif s->cancel=das6402_ai_cancel; s->maxdata=(1<<12)-1; s->len_chanlist=16; /* ? */ diff --git a/comedi/drivers/ni_pcidio.c b/comedi/drivers/ni_pcidio.c index ec0f2803..c449efc6 100644 --- a/comedi/drivers/ni_pcidio.c +++ b/comedi/drivers/ni_pcidio.c @@ -303,6 +303,7 @@ static int ni_pcidio_insn_bits(comedi_device *dev,comedi_subdevice *s, return 2; } +#ifdef CONFIG_COMEDI_TRIG static int nidio_dio_mode2(comedi_device *dev,comedi_subdevice *s,comedi_trig *it) { int i; @@ -381,6 +382,7 @@ static int nidio_dio_mode2(comedi_device *dev,comedi_subdevice *s,comedi_trig *i return 0; } +#endif static int nidio_attach(comedi_device *dev,comedi_devconfig *it) { @@ -426,7 +428,9 @@ static int nidio_attach(comedi_device *dev,comedi_devconfig *it) s->n_chan=32; s->range_table=&range_digital; s->maxdata=1; +#ifdef CONFIG_COMEDI_TRIG s->trig[2]=nidio_dio_mode2; +#endif s->insn_config = ni_pcidio_insn_config; s->insn_bits = ni_pcidio_insn_bits; s->len_chanlist=32; /* XXX */ diff --git a/comedi/drivers/pcl711.c b/comedi/drivers/pcl711.c index 319eac56..409f8dfd 100644 --- a/comedi/drivers/pcl711.c +++ b/comedi/drivers/pcl711.c @@ -271,6 +271,7 @@ ok: return n; } +#ifdef CONFIG_COMEDI_TRIG static int pcl711_ai_mode4(comedi_device * dev, comedi_subdevice * s, comedi_trig * it) { if (!this_board->is_pcl711b || dev->irq == 0) @@ -285,8 +286,10 @@ static int pcl711_ai_mode4(comedi_device * dev, comedi_subdevice * s, comedi_tri return 0; } +#endif +#ifdef CONFIG_COMEDI_TRIG static int pcl711_ai_mode1(comedi_device * dev, comedi_subdevice * s, comedi_trig * it) { int timer1,timer2; @@ -325,6 +328,7 @@ static int pcl711_ai_mode1(comedi_device * dev, comedi_subdevice * s, comedi_tri return 0; } +#endif /* analog output @@ -460,8 +464,10 @@ static int pcl711_attach(comedi_device * dev, comedi_devconfig * it) s->len_chanlist = 1; s->range_table = this_board->ai_range_type; s->insn_read = pcl711_ai_insn; +#ifdef CONFIG_COMEDI_TRIG s->trig[1] = pcl711_ai_mode1; s->trig[4] = pcl711_ai_mode4; +#endif s++; /* AO subdevice */ diff --git a/comedi/drivers/pcl812.c b/comedi/drivers/pcl812.c index d82d3395..38cc8d73 100644 --- a/comedi/drivers/pcl812.c +++ b/comedi/drivers/pcl812.c @@ -453,6 +453,7 @@ static void interrupt_pcl812(int irq, void *d, struct pt_regs *regs) ANALOG INPUT MODE 1, 812pg card interrupt pacer pooling */ +#ifdef CONFIG_COMEDI_TRIG static int pcl812_ai_mode1_int(comedi_device * dev, comedi_subdevice * s, comedi_trig * it) { int timer1,timer2; @@ -491,11 +492,13 @@ static int pcl812_ai_mode1_int(comedi_device * dev, comedi_subdevice * s, comedi return 0; } +#endif /* ============================================================================== ANALOG INPUT MODE 1, 812pg card */ +#ifdef CONFIG_COMEDI_TRIG static int pcl812_ai_mode1(comedi_device * dev, comedi_subdevice * s, comedi_trig * it) { @@ -528,11 +531,13 @@ static int pcl812_ai_mode1(comedi_device * dev, comedi_subdevice * s, comedi_tri #endif return pcl812_ai_mode1_int(dev, s, it); /* no, we can only int driven */ } +#endif /* ============================================================================== ANALOG INPUT MODE 3, 812pg card */ +#ifdef CONFIG_COMEDI_TRIG static int pcl812_ai_mode3_int(comedi_device * dev, comedi_subdevice * s, comedi_trig * it) { @@ -555,6 +560,7 @@ static int pcl812_ai_mode3_int(comedi_device * dev, comedi_subdevice * s, comedi return 0; } +#endif /* ============================================================================== @@ -748,6 +754,7 @@ static int pcl812_attach(comedi_device * dev, comedi_devconfig * it) if(this_board->is_812pg){ if (it->options[3] == 1) s->range_table = &range_pcl812pg2_ai; +#ifdef CONFIG_COMEDI_TRIG if (dev->irq) { if (it->options[2] != 1) { s->trig[1] = pcl812_ai_mode1; @@ -755,6 +762,7 @@ static int pcl812_attach(comedi_device * dev, comedi_devconfig * it) s->trig[3] = pcl812_ai_mode3_int; } } +#endif }else{ if (it->options[1] == 1) s->range_table = &range_pcl813b2_ai; diff --git a/comedi/drivers/pcl818.c b/comedi/drivers/pcl818.c index f6a88a49..82ff7829 100644 --- a/comedi/drivers/pcl818.c +++ b/comedi/drivers/pcl818.c @@ -792,6 +792,7 @@ static void interrupt_pcl818(int irq, void *d, struct pt_regs *regs) ============================================================================== ANALOG INPUT MODE 1 or 3 DMA , 818 cards */ +#ifdef CONFIG_COMEDI_TRIG void pcl818_ai_mode13dma_int(int mode, comedi_device * dev, comedi_subdevice * s, comedi_trig * it) { unsigned int flags; @@ -824,11 +825,13 @@ void pcl818_ai_mode13dma_int(int mode, comedi_device * dev, comedi_subdevice * s outb(0x86 | (dev->irq << 4), dev->iobase + PCL818_CONTROL); /* Ext trig+IRQ+DMA */ }; } +#endif /* ============================================================================== ANALOG INPUT MODE 1 or 3 DMA rtc, 818 cards */ +#ifdef CONFIG_COMEDI_TRIG void pcl818_ai_mode13dma_rtc(int mode, comedi_device * dev, comedi_subdevice * s, comedi_trig * it) { unsigned int flags; @@ -860,11 +863,13 @@ void pcl818_ai_mode13dma_rtc(int mode, comedi_device * dev, comedi_subdevice * s outb(0x06 | (dev->irq << 4), dev->iobase + PCL818_CONTROL); /* Ext trig+DMA */ }; } +#endif /* ============================================================================== ANALOG INPUT MODE 1 or 3, 818 cards */ +#ifdef CONFIG_COMEDI_TRIG static int pcl818_ai_mode13(int mode, comedi_device * dev, comedi_subdevice * s, comedi_trig * it) { int divisor1, divisor2; @@ -946,30 +951,36 @@ static int pcl818_ai_mode13(int mode, comedi_device * dev, comedi_subdevice * s, return 0; } +#endif /* ============================================================================== ANALOG INPUT MODE 1, 818 cards */ +#ifdef CONFIG_COMEDI_TRIG static int pcl818_ai_mode1(comedi_device * dev, comedi_subdevice * s, comedi_trig * it) { return pcl818_ai_mode13(1, dev, s, it); } +#endif /* ============================================================================== ANALOG INPUT MODE 3, 818 cards */ +#ifdef CONFIG_COMEDI_TRIG static int pcl818_ai_mode3(comedi_device * dev, comedi_subdevice * s, comedi_trig * it) { return pcl818_ai_mode13(3, dev, s, it); } +#endif /* ============================================================================== ANALOG OUTPUT MODE 1 or 3, 818 cards */ #ifdef PCL818_MODE13_AO +#ifdef CONFIG_COMEDI_TRIG static int pcl818_ao_mode13(int mode, comedi_device * dev, comedi_subdevice * s, comedi_trig * it) { int divisor1, divisor2; @@ -1018,25 +1029,30 @@ static int pcl818_ao_mode13(int mode, comedi_device * dev, comedi_subdevice * s, return 0; } +#endif /* ============================================================================== ANALOG OUTPUT MODE 1, 818 cards */ +#ifdef CONFIG_COMEDI_TRIG static int pcl818_ao_mode1(comedi_device * dev, comedi_subdevice * s, comedi_trig * it) { return pcl818_ao_mode13(1, dev, s, it); } +#endif /* ============================================================================== ANALOG OUTPUT MODE 3, 818 cards */ +#ifdef CONFIG_COMEDI_TRIG static int pcl818_ao_mode3(comedi_device * dev, comedi_subdevice * s, comedi_trig * it) { return pcl818_ao_mode13(3, dev, s, it); } #endif +#endif /* ============================================================================== @@ -1507,10 +1523,12 @@ no_dma: s->range_table = this_board->ai_range_type; s->cancel=pcl818_ai_cancel; s->insn_read = pcl818_ai_insn_read; +#ifdef CONFIG_COMEDI_TRIG if ((irq)||(devpriv->dma_rtc)) { s->trig[1] = pcl818_ai_mode1; s->trig[3] = pcl818_ai_mode3; } +#endif if(this_board->is_818){ if ((it->options[4]==1)||(it->options[4]==10)) s->range_table=&range_pcl818l_h_ai; // secondary range list jumper selectable @@ -1542,11 +1560,13 @@ no_dma: s->range_table = this_board->ao_range_type; s->insn_read = pcl818_ao_insn_read; s->insn_write = pcl818_ao_insn_write; +#ifdef CONFIG_COMEDI_TRIG #ifdef PCL818_MODE13_AO if (irq) { s->trig[1] = pcl818_ao_mode1; s->trig[3] = pcl818_ao_mode3; } +#endif #endif if(this_board->is_818){ if ((it->options[4]==1)||(it->options[4]==10)) -- 2.26.2