From 885a7da351d04e8f62d201e094fc1c287ed5360b Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Tue, 4 Mar 2014 11:29:34 -0700 Subject: [PATCH] staging: comedi: pcl816: remove unreachable interrupt handler code According to the users manual, when using interrupt (non-DMA) transfers this hardware generates an interrupt at the start of a conversion. This requires the interrupt routine to busywait until the end-of-conversion. It appears this was unreliable and interrupt only async command support was removed at some time. Async command support is still available when DMA is used. Remove the unreachable interrupt only handler code. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl816.c | 51 ------------------------- 1 file changed, 51 deletions(-) diff --git a/drivers/staging/comedi/drivers/pcl816.c b/drivers/staging/comedi/drivers/pcl816.c index 66d3c5a4f2ce..a4c59291568f 100644 --- a/drivers/staging/comedi/drivers/pcl816.c +++ b/drivers/staging/comedi/drivers/pcl816.c @@ -65,9 +65,7 @@ Configuration Options: #define PCL816_AD_HI 9 /* type of interrupt handler */ -#define INT_TYPE_AI1_INT 1 #define INT_TYPE_AI1_DMA 2 -#define INT_TYPE_AI3_INT 4 #define INT_TYPE_AI3_DMA 5 #define MAGIC_DMA_WORD 0x5a5a @@ -273,50 +271,6 @@ static int pcl816_ai_insn_read(struct comedi_device *dev, return n; } -static irqreturn_t interrupt_pcl816_ai_mode13_int(int irq, void *d) -{ - struct comedi_device *dev = d; - struct pcl816_private *devpriv = dev->private; - struct comedi_subdevice *s = dev->read_subdev; - struct comedi_cmd *cmd = &s->async->cmd; - int timeout = 50; /* wait max 50us */ - - while (timeout--) { - if (!(inb(dev->iobase + PCL816_STATUS) & - PCL816_STATUS_DRDY_MASK)) - break; - udelay(1); - } - if (!timeout) { /* timeout, bail error */ - outb(0, dev->iobase + PCL816_CLRINT); /* clear INT request */ - comedi_error(dev, "A/D mode1/3 IRQ without DRDY!"); - s->cancel(dev, s); - s->async->events |= COMEDI_CB_EOA | COMEDI_CB_ERROR; - comedi_event(dev, s); - return IRQ_HANDLED; - - } - - comedi_buf_put(s->async, pcl816_ai_get_sample(dev, s)); - - outb(0, dev->iobase + PCL816_CLRINT); /* clear INT request */ - - s->async->cur_chan++; - if (s->async->cur_chan >= cmd->chanlist_len) { - s->async->cur_chan = 0; - devpriv->ai_act_scan++; - } - - if (cmd->stop_src == TRIG_COUNT && - devpriv->ai_act_scan >= cmd->stop_arg) { - /* all data sampled */ - s->cancel(dev, s); - s->async->events |= COMEDI_CB_EOA; - } - comedi_event(dev, s); - return IRQ_HANDLED; -} - static void transfer_from_dma_buf(struct comedi_device *dev, struct comedi_subdevice *s, unsigned short *ptr, @@ -389,9 +343,6 @@ static irqreturn_t interrupt_pcl816(int irq, void *d) case INT_TYPE_AI1_DMA: case INT_TYPE_AI3_DMA: return interrupt_pcl816_ai_mode13_dma(irq, d); - case INT_TYPE_AI1_INT: - case INT_TYPE_AI3_INT: - return interrupt_pcl816_ai_mode13_int(irq, d); } outb(0, dev->iobase + PCL816_CLRINT); /* clear INT request */ @@ -593,8 +544,6 @@ static int pcl816_ai_cancel(struct comedi_device *dev, case INT_TYPE_AI1_DMA: case INT_TYPE_AI3_DMA: disable_dma(devpriv->dma); - case INT_TYPE_AI1_INT: - case INT_TYPE_AI3_INT: outb(inb(dev->iobase + PCL816_CONTROL) & 0x73, dev->iobase + PCL816_CONTROL); /* Stop A/D */ udelay(1); -- 2.34.1