#define INT_TYPE_AI1_DMA 2
#define INT_TYPE_AI3_INT 4
#define INT_TYPE_AI3_DMA 5
+#ifdef unused
#define INT_TYPE_AI1_DMA_RTC 9
#define INT_TYPE_AI3_DMA_RTC 10
// RTC stuff...
#define RTC_IRQ 8
#define RTC_IO_EXTENT 0x10
+#endif
#define MAGIC_DMA_WORD 0x5a5a
static int pcl816_attach (comedi_device * dev, comedi_devconfig * it);
static int pcl816_detach (comedi_device * dev);
+#ifdef unused
static int RTC_lock = 0; /* RTC lock */
static int RTC_timer_lock = 0; /* RTC int lock */
+#endif
static comedi_driver driver_pcl816 = {
driver_name: "pcl816",
{
int dma; // used DMA, 0=don't use DMA
int dma_rtc; // 1=RTC used with DMA, 0=no RTC alloc
+#ifdef unused
unsigned int rtc_iobase; // RTC port region
unsigned int rtc_iosize;
unsigned int rtc_irq;
+#endif
unsigned long dmabuf[2]; // pointers to begin of DMA buffers
unsigned int dmapages[2]; // len of DMA buffers in PAGE_SIZEs
unsigned int hwdmaptr[2]; // hardware address of DMA buffers
unsigned char ai_neverending; // if=1, then we do neverending record (you must use cancel())
int irq_free; // 1=have allocated IRQ
int irq_blocked; // 1=IRQ now uses any subdev
+#ifdef unused
int rtc_irq_blocked; // 1=we now do AI with DMA&RTC
+#endif
int irq_was_now_closed; // when IRQ finish, there's stored int816_mode for last interrupt
int int816_mode; // who now uses IRQ - 1=AI1 int, 2=AI1 dma, 3=AI3 int, 4AI3 dma
comedi_subdevice *last_int_sub; // ptr to subdevice which now finish
unsigned int ai_act_chanlist_pos; // actual position in MUX list
unsigned int ai_poll_ptr; // how many sampes transfer poll
comedi_subdevice *sub_ai; // ptr to AI subdevice
+#ifdef unused
struct timer_list rtc_irq_timer; // timer for RTC sanity check
unsigned long rtc_freq; // RTC int freq
+#endif
} pcl816_private;
static int pcl816_ai_cancel (comedi_device * dev, comedi_subdevice * s);
static void start_pacer (comedi_device * dev, int mode, unsigned int divisor1,
unsigned int divisor2);
+#ifdef unused
static int set_rtc_irq_bit (unsigned char bit);
+#endif
static int pcl816_ai_cmdtest(comedi_device *dev, comedi_subdevice *s, comedi_cmd *cmd);
static int pcl816_ai_cmd(comedi_device *dev, comedi_subdevice *s);
if (devpriv->irq_blocked > 0) {
switch (devpriv->int816_mode) {
+#ifdef unused
case INT_TYPE_AI1_DMA_RTC:
case INT_TYPE_AI3_DMA_RTC:
set_rtc_irq_bit (0); // stop RTC
del_timer (&devpriv->rtc_irq_timer);
+#endif
case INT_TYPE_AI1_DMA:
case INT_TYPE_AI3_DMA:
disable_dma (devpriv->dma);
return 1; // we can serve this with MUX logic
}
+#ifdef unused
/*
==============================================================================
Enable(1)/disable(0) periodic interrupts from RTC
restore_flags(flags);
return 0;
}
+#endif
/*
free_pages (devpriv->dmabuf[0], devpriv->dmapages[0]);
if (devpriv->dmabuf[1])
free_pages (devpriv->dmabuf[1], devpriv->dmapages[1]);
+#ifdef unused
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);
}
+#endif
}
if (dev->irq)
devpriv->irq_blocked = 0; /* number of subdevice which use IRQ */
devpriv->int816_mode = 0; /* mode of irq */
+#ifdef unused
/* grab RTC for DMA operations */
devpriv->dma_rtc = 0;
if (it->options[2] > 0)
}
no_rtc:
+#endif
/* grab our DMA */
dma = 0;
devpriv->dma = dma;
{
DEBUG(rt_printk("comedi%d: pcl816: remove\n", dev->minor);)
free_resources (dev);
+#ifdef unused
if (devpriv->dma_rtc)
RTC_lock--;
+#endif
return 0;
}
#define INT_TYPE_AI1_DMA_RTC 9
#define INT_TYPE_AI3_DMA_RTC 10
+#ifdef unused
// RTC stuff...
#define RTC_IRQ 8
#define RTC_IO_EXTENT 0x10
+#endif
#define MAGIC_DMA_WORD 0x5a5a
static int pcl818_attach(comedi_device *dev,comedi_devconfig *it);
static int pcl818_detach(comedi_device *dev);
+#ifdef unused
static int RTC_lock = 0; /* RTC lock */
static int RTC_timer_lock = 0; /* RTC int lock */
+#endif
typedef struct {
char *name; // driver name
int dma; // used DMA, 0=don't use DMA
int dma_rtc; // 1=RTC used with DMA, 0=no RTC alloc
int io_range;
+#ifdef unused
unsigned int rtc_iobase; // RTC port region
unsigned int rtc_iosize;
unsigned int rtc_irq;
+#endif
unsigned long dmabuf[2]; // pointers to begin of DMA buffers
unsigned int dmapages[2]; // len of DMA buffers in PAGE_SIZEs
unsigned int hwdmaptr[2]; // hardware address of DMA buffers
int i8253_osc_base; // 1/frequency of on board oscilator in ns
int irq_free; // 1=have allocated IRQ
int irq_blocked; // 1=IRQ now uses any subdev
+#ifdef unused
int rtc_irq_blocked;// 1=we now do AI with DMA&RTC
+#endif
int irq_was_now_closed;// when IRQ finish, there's stored int818_mode for last interrupt
int int818_mode; // who now uses IRQ - 1=AI1 int, 2=AI1 dma, 3=AI3 int, 4AI3 dma
comedi_subdevice *last_int_sub; // ptr to subdevice which now finish
unsigned int act_chanlist_pos;// actual position in MUX list
comedi_subdevice *sub_ai; // ptr to AI subdevice
unsigned char usefifo; // 1=use fifo
+#ifdef unused
struct timer_list rtc_irq_timer;// timer for RTC sanity check
unsigned long rtc_freq; // RTC int freq
+#endif
lsampl_t ao_readback[2];
} pcl818_private;
#ifdef unused
static void start_pacer(comedi_device * dev, int mode, unsigned int divisor1, unsigned int divisor2);
#endif
+#ifdef unused
static int set_rtc_irq_bit(unsigned char bit);
+#endif
#ifdef unused
static void rtc_dropped_irq(unsigned long data);
static int rtc_setfreq_irq(int freq);
return IRQ_HANDLED;
}
+#ifdef unused
/*
==============================================================================
analog input dma mode 1 & 3 over RTC, 818 cards
//outb(0,0x378);
return IRQ_HANDLED;
}
+#endif
/*
==============================================================================
pole=(sampl_t *)devpriv->dmabuf[0];
devpriv->dmasamplsize=devpriv->hwdmasize[0]/2;
pole[devpriv->dmasamplsize-1]=MAGIC_DMA_WORD;
+#ifdef unused
devpriv->rtc_freq=rtc_setfreq_irq(2048);
devpriv->rtc_irq_timer.expires=jiffies + HZ/devpriv->rtc_freq + 2*HZ/100;
devpriv->rtc_irq_timer.data=(unsigned long)dev;
devpriv->rtc_irq_timer.function=rtc_dropped_irq;
add_timer(&devpriv->rtc_irq_timer);
+#endif
if (mode==1) {
devpriv->int818_mode=INT_TYPE_AI1_DMA_RTC;
start_pacer(dev, mode, divisor1, divisor2);
switch(devpriv->int818_mode) {
+#ifdef unused
case INT_TYPE_AI1_DMA_RTC:
case INT_TYPE_AI3_DMA_RTC:
set_rtc_irq_bit(1); /* start RTC */
break;
+#endif
}
return 0;
if (devpriv->irq_blocked>0) {
// rt_printk("pcl818_ai_cancel()\n");
switch (devpriv->int818_mode) {
+#ifdef unused
case INT_TYPE_AI1_DMA_RTC:
case INT_TYPE_AI3_DMA_RTC:
set_rtc_irq_bit(0); // stop RTC
del_timer(&devpriv->rtc_irq_timer);
+#endif
case INT_TYPE_AI1_DMA:
case INT_TYPE_AI3_DMA:
disable_dma(devpriv->dma);
}
}
+#ifdef unused
/*
==============================================================================
Enable(1)/disable(0) periodic interrupts from RTC
restore_flags(flags);
return 0;
}
+#endif
/*
==============================================================================
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]);
+#ifdef unused
if (devpriv->rtc_irq) comedi_free_irq(devpriv->rtc_irq, dev);
if ((devpriv->dma_rtc)&&(RTC_lock==1)) {
if (devpriv->rtc_iobase)
}
if (devpriv->dma_rtc)
RTC_lock--;
+#endif
}
if (dev->irq) free_irq(dev->irq, dev);
devpriv->irq_blocked=0; /* number of subdevice which use IRQ */
devpriv->int818_mode=0; /* mode of irq */
+#ifdef unused
/* grab RTC for DMA operations */
devpriv->dma_rtc=0;
if (it->options[2]>0) { // we want to use DMA
}
no_rtc:
+#endif
/* grab our DMA */
dma=0;
devpriv->dma=dma;