staging: comedi: ni_6527: rename CamelCase defines for the control register
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 1 Oct 2013 22:12:19 +0000 (15:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Oct 2013 21:09:53 +0000 (14:09 -0700)
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: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_6527.c

index 5be2bf5d1158b9af7a1fb0a3936f87ac72c9829b..5ca6d89309043cd989b7ca518ee9fa9b4461b384 100644 (file)
@@ -58,13 +58,16 @@ Updated: Sat, 25 Jan 2003 13:24:40 -0800
 #define NI6527_STATUS_IRQ              (1 << 2)
 #define NI6527_STATUS_OVERFLOW         (1 << 1)
 #define NI6527_STATUS_EDGE             (1 << 0)
-
-#define Master_Interrupt_Control               0x15
-#define FallingEdgeIntEnable           0x10
-#define RisingEdgeIntEnable            0x08
-#define MasterInterruptEnable          0x04
-#define OverflowIntEnable              0x02
-#define EdgeIntEnable                  0x01
+#define NI6527_CTRL_REG                        0x15
+#define NI6527_CTRL_FALLING            (1 << 4)
+#define NI6527_CTRL_RISING             (1 << 3)
+#define NI6527_CTRL_IRQ                        (1 << 2)
+#define NI6527_CTRL_OVERFLOW           (1 << 1)
+#define NI6527_CTRL_EDGE               (1 << 0)
+#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 Falling_Edge_Detection_Enable(x)       (0x020+(x))
@@ -273,9 +276,8 @@ static int ni6527_intr_cmd(struct comedi_device *dev,
 
        writeb(NI6527_CLR_IRQS,
               devpriv->mite->daq_io_addr + NI6527_CLR_REG);
-       writeb(FallingEdgeIntEnable | RisingEdgeIntEnable |
-              MasterInterruptEnable | EdgeIntEnable,
-              devpriv->mite->daq_io_addr + Master_Interrupt_Control);
+       writeb(NI6527_CTRL_ENABLE_IRQS,
+              devpriv->mite->daq_io_addr + NI6527_CTRL_REG);
 
        return 0;
 }
@@ -285,7 +287,8 @@ static int ni6527_intr_cancel(struct comedi_device *dev,
 {
        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;
 }
@@ -402,7 +405,8 @@ static int ni6527_auto_attach(struct comedi_device *dev,
 
        writeb(NI6527_CLR_IRQS | NI6527_CLR_RESET_FILT,
               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,
                          IRQF_SHARED, dev->board_name, dev);
@@ -419,8 +423,8 @@ static void ni6527_detach(struct comedi_device *dev)
        struct ni6527_private *devpriv = dev->private;
 
        if (devpriv && devpriv->mite && devpriv->mite->daq_io_addr)
-               writeb(0x00,
-                      devpriv->mite->daq_io_addr + Master_Interrupt_Control);
+               writeb(NI6527_CTRL_DISABLE_IRQS,
+                      devpriv->mite->daq_io_addr + NI6527_CTRL_REG);
        if (dev->irq)
                free_irq(dev->irq, dev);
        if (devpriv && devpriv->mite) {