summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/addi_apci_1032.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-11-05 14:40:34 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-06 09:30:57 +0100
commit12d606f75422f4989a853c7c52b06a3b15ef59a2 (patch)
treef1f811e2aaee24b7a44e5c8acd58b201fdaf907d /drivers/staging/comedi/drivers/addi_apci_1032.c
parentb37f84d56af3efcadd3fc01630f029382707e312 (diff)
downloadlinux-rt-12d606f75422f4989a853c7c52b06a3b15ef59a2.tar.gz
staging: comedi: addi_apci_1032: cleanup v_ADDI_Interrupt()
There is no need for this function to call v_APCI1032_Interrupt() in hwdrv_apci1032.c to reset the board. Just move the code from v_APCI1032_Interrupt() directly into this function. Rename the CamelCase function to apci1032_interrupt(). Rename the CamelCase local variable used to read/write the control register. Change the return from IRQ_RETVAL(1) to IRQ_HANDLED. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/addi_apci_1032.c')
-rw-r--r--drivers/staging/comedi/drivers/addi_apci_1032.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/staging/comedi/drivers/addi_apci_1032.c b/drivers/staging/comedi/drivers/addi_apci_1032.c
index 1b4d6983aa54..ab346719671a 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1032.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1032.c
@@ -6,10 +6,24 @@
#include "addi-data/hwdrv_apci1032.c"
-static irqreturn_t v_ADDI_Interrupt(int irq, void *d)
+static irqreturn_t apci1032_interrupt(int irq, void *d)
{
- v_APCI1032_Interrupt(irq, d);
- return IRQ_RETVAL(1);
+ struct comedi_device *dev = d;
+ struct addi_private *devpriv = dev->private;
+ unsigned int ctrl;
+
+ /* disable the interrupt */
+ ctrl = inl(dev->iobase + APCI1032_CTRL_REG);
+ outl(ctrl & ~APCI1032_CTRL_INT_ENA, dev->iobase + APCI1032_CTRL_REG);
+
+ ui_InterruptStatus = inl(dev->iobase + APCI1032_STATUS_REG);
+ ui_InterruptStatus = ui_InterruptStatus & 0X0000FFFF;
+ send_sig(SIGIO, devpriv->tsk_Current, 0); /* send signal to the sample */
+
+ /* enable the interrupt */
+ outl(ctrl, dev->iobase + APCI1032_CTRL_REG);
+
+ return IRQ_HANDLED;
}
static int apci1032_di_insn_bits(struct comedi_device *dev,
@@ -56,7 +70,7 @@ static int apci1032_attach_pci(struct comedi_device *dev,
dev->iobase = pci_resource_start(pcidev, 2);
if (pcidev->irq > 0) {
- ret = request_irq(pcidev->irq, v_ADDI_Interrupt, IRQF_SHARED,
+ ret = request_irq(pcidev->irq, apci1032_interrupt, IRQF_SHARED,
dev->board_name, dev);
if (ret == 0)
dev->irq = pcidev->irq;