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

staging: comedi: ni_6527: rename CamelCase defines for the control register

Rename the CamelCase defines used for the interrupt control register.

To clarify the code a bit, add two new defines to enable/disable the
interrupts.
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 73261fc0
...@@ -58,13 +58,16 @@ Updated: Sat, 25 Jan 2003 13:24:40 -0800 ...@@ -58,13 +58,16 @@ Updated: Sat, 25 Jan 2003 13:24:40 -0800
#define NI6527_STATUS_IRQ (1 << 2) #define NI6527_STATUS_IRQ (1 << 2)
#define NI6527_STATUS_OVERFLOW (1 << 1) #define NI6527_STATUS_OVERFLOW (1 << 1)
#define NI6527_STATUS_EDGE (1 << 0) #define NI6527_STATUS_EDGE (1 << 0)
#define NI6527_CTRL_REG 0x15
#define Master_Interrupt_Control 0x15 #define NI6527_CTRL_FALLING (1 << 4)
#define FallingEdgeIntEnable 0x10 #define NI6527_CTRL_RISING (1 << 3)
#define RisingEdgeIntEnable 0x08 #define NI6527_CTRL_IRQ (1 << 2)
#define MasterInterruptEnable 0x04 #define NI6527_CTRL_OVERFLOW (1 << 1)
#define OverflowIntEnable 0x02 #define NI6527_CTRL_EDGE (1 << 0)
#define EdgeIntEnable 0x01 #define NI6527_CTRL_DISABLE_IRQS 0
#define NI6527_CTRL_ENABLE_IRQS (NI6527_CTRL_FALLING | \
NI6527_CTRL_RISING | \
NI6527_CTRL_IRQ | NI6527_CTRL_EDGE)
#define Rising_Edge_Detection_Enable(x) (0x018+(x)) #define Rising_Edge_Detection_Enable(x) (0x018+(x))
#define Falling_Edge_Detection_Enable(x) (0x020+(x)) #define Falling_Edge_Detection_Enable(x) (0x020+(x))
...@@ -273,9 +276,8 @@ static int ni6527_intr_cmd(struct comedi_device *dev, ...@@ -273,9 +276,8 @@ static int ni6527_intr_cmd(struct comedi_device *dev,
writeb(NI6527_CLR_IRQS, writeb(NI6527_CLR_IRQS,
devpriv->mite->daq_io_addr + NI6527_CLR_REG); devpriv->mite->daq_io_addr + NI6527_CLR_REG);
writeb(FallingEdgeIntEnable | RisingEdgeIntEnable | writeb(NI6527_CTRL_ENABLE_IRQS,
MasterInterruptEnable | EdgeIntEnable, devpriv->mite->daq_io_addr + NI6527_CTRL_REG);
devpriv->mite->daq_io_addr + Master_Interrupt_Control);
return 0; return 0;
} }
...@@ -285,7 +287,8 @@ static int ni6527_intr_cancel(struct comedi_device *dev, ...@@ -285,7 +287,8 @@ static int ni6527_intr_cancel(struct comedi_device *dev,
{ {
struct ni6527_private *devpriv = dev->private; struct ni6527_private *devpriv = dev->private;
writeb(0x00, devpriv->mite->daq_io_addr + Master_Interrupt_Control); writeb(NI6527_CTRL_DISABLE_IRQS,
devpriv->mite->daq_io_addr + NI6527_CTRL_REG);
return 0; return 0;
} }
...@@ -402,7 +405,8 @@ static int ni6527_auto_attach(struct comedi_device *dev, ...@@ -402,7 +405,8 @@ static int ni6527_auto_attach(struct comedi_device *dev,
writeb(NI6527_CLR_IRQS | NI6527_CLR_RESET_FILT, writeb(NI6527_CLR_IRQS | NI6527_CLR_RESET_FILT,
devpriv->mite->daq_io_addr + NI6527_CLR_REG); devpriv->mite->daq_io_addr + NI6527_CLR_REG);
writeb(0x00, devpriv->mite->daq_io_addr + Master_Interrupt_Control); writeb(NI6527_CTRL_DISABLE_IRQS,
devpriv->mite->daq_io_addr + NI6527_CTRL_REG);
ret = request_irq(mite_irq(devpriv->mite), ni6527_interrupt, ret = request_irq(mite_irq(devpriv->mite), ni6527_interrupt,
IRQF_SHARED, dev->board_name, dev); IRQF_SHARED, dev->board_name, dev);
...@@ -419,8 +423,8 @@ static void ni6527_detach(struct comedi_device *dev) ...@@ -419,8 +423,8 @@ static void ni6527_detach(struct comedi_device *dev)
struct ni6527_private *devpriv = dev->private; struct ni6527_private *devpriv = dev->private;
if (devpriv && devpriv->mite && devpriv->mite->daq_io_addr) if (devpriv && devpriv->mite && devpriv->mite->daq_io_addr)
writeb(0x00, writeb(NI6527_CTRL_DISABLE_IRQS,
devpriv->mite->daq_io_addr + Master_Interrupt_Control); devpriv->mite->daq_io_addr + NI6527_CTRL_REG);
if (dev->irq) if (dev->irq)
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
if (devpriv && devpriv->mite) { if (devpriv && devpriv->mite) {
......
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