Commit 8d7d72cc authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: ni_6527: tidy up ni6527_interrupt()

Rename the CamelCase defines used for the interrupt status register.

The NI6527_STATUS_IRQ bit will be set whenever the device is asserting
an interrupt. Modify the function a bit so this is the only requirement
for the interrupt to be IRQ_HANDLED. Currently an OVERFLOW interrupt is
not handled, though it's unlikely this would occur without an EDGE
interrupt.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 87fe6ebd
...@@ -54,11 +54,10 @@ Updated: Sat, 25 Jan 2003 13:24:40 -0800 ...@@ -54,11 +54,10 @@ Updated: Sat, 25 Jan 2003 13:24:40 -0800
#define NI6527_FILT_INTERVAL_REG(x) (0x08 + (x)) #define NI6527_FILT_INTERVAL_REG(x) (0x08 + (x))
#define NI6527_FILT_ENA_REG(x) (0x0c + (x)) #define NI6527_FILT_ENA_REG(x) (0x0c + (x))
#define NI6527_STATUS_REG 0x14
#define Change_Status 0x14 #define NI6527_STATUS_IRQ (1 << 2)
#define MasterInterruptStatus 0x04 #define NI6527_STATUS_OVERFLOW (1 << 1)
#define Overflow 0x02 #define NI6527_STATUS_EDGE (1 << 0)
#define EdgeStatus 0x01
#define Master_Interrupt_Control 0x15 #define Master_Interrupt_Control 0x15
#define FallingEdgeIntEnable 0x10 #define FallingEdgeIntEnable 0x10
...@@ -206,20 +205,22 @@ static irqreturn_t ni6527_interrupt(int irq, void *d) ...@@ -206,20 +205,22 @@ static irqreturn_t ni6527_interrupt(int irq, void *d)
struct comedi_device *dev = d; struct comedi_device *dev = d;
struct ni6527_private *devpriv = dev->private; struct ni6527_private *devpriv = dev->private;
struct comedi_subdevice *s = dev->read_subdev; struct comedi_subdevice *s = dev->read_subdev;
void __iomem *mmio = devpriv->mite->daq_io_addr;
unsigned int status; unsigned int status;
status = readb(devpriv->mite->daq_io_addr + Change_Status); status = readb(mmio + NI6527_STATUS_REG);
if ((status & MasterInterruptStatus) == 0) if (!(status & NI6527_STATUS_IRQ))
return IRQ_NONE;
if ((status & EdgeStatus) == 0)
return IRQ_NONE; return IRQ_NONE;
if (status & NI6527_STATUS_EDGE) {
comedi_buf_put(s->async, 0);
s->async->events |= COMEDI_CB_EOS;
comedi_event(dev, s);
}
writeb(ClrEdge | ClrOverflow, writeb(ClrEdge | ClrOverflow,
devpriv->mite->daq_io_addr + Clear_Register); mmio + Clear_Register);
comedi_buf_put(s->async, 0);
s->async->events |= COMEDI_CB_EOS;
comedi_event(dev, s);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment