staging: comedi: addi_apci_1500: tidy up PCI Bar 2 register map
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 3 Dec 2014 18:25:40 +0000 (11:25 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Jan 2015 00:54:35 +0000 (16:54 -0800)
Move the PCI Bar 1 register map defines to the main driver source file.
For aesthetics, rename the defines.

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/addi-data/hwdrv_apci1500.c
drivers/staging/comedi/drivers/addi_apci_1500.c

index 7eb7d9ecd7a5084f0eba4a44f93671bfb58b0c7a..a8887689e1fcd4756cdc0d6669e2211af0a3651e 100644 (file)
 
 /* DIGITAL INPUT-OUTPUT DEFINE */
 
-#define APCI1500_DIGITAL_OP            2
-#define APCI1500_DIGITAL_IP            0
 #define APCI1500_AND                   2
 #define APCI1500_OR                    4
 #define APCI1500_OR_PRIORITY           6
-#define APCI1500_CLK_SELECT            0
 #define COUNTER1                       0
 #define COUNTER2                       1
 #define COUNTER3                       2
@@ -600,7 +597,7 @@ static int apci1500_di_insn_bits(struct comedi_device *dev,
 {
        struct apci1500_private *devpriv = dev->private;
 
-       data[1] = inw(devpriv->addon + APCI1500_DIGITAL_IP);
+       data[1] = inw(devpriv->addon + APCI1500_DI_REG);
 
        return insn->n;
 }
@@ -641,7 +638,7 @@ static int apci1500_do_write(struct comedi_device *dev,
        if (data[3] == 0) {
                if (data[1] == 0) {
                        data[0] = (data[0] << ui_NoOfChannel) | ui_Temp;
-                       outw(data[0], devpriv->addon + APCI1500_DIGITAL_OP);
+                       outw(data[0], devpriv->addon + APCI1500_DO_REG);
                } else {
                        if (data[1] == 1) {
                                switch (ui_NoOfChannel) {
@@ -675,8 +672,7 @@ static int apci1500_do_write(struct comedi_device *dev,
 
                                }
 
-                               outw(data[0],
-                                    devpriv->addon + APCI1500_DIGITAL_OP);
+                               outw(data[0], devpriv->addon + APCI1500_DO_REG);
                        } else {
                                dev_warn(dev->class_dev,
                                        "Specified channel not supported\n");
@@ -694,8 +690,7 @@ static int apci1500_do_write(struct comedi_device *dev,
                                        (data[0] << ui_NoOfChannel) ^
                                        0xffffffff;
                                data[0] = data[0] & ui_Temp;
-                               outw(data[0],
-                                    devpriv->addon + APCI1500_DIGITAL_OP);
+                               outw(data[0], devpriv->addon + APCI1500_DO_REG);
                        } else {
                                if (data[1] == 1) {
                                        switch (ui_NoOfChannel) {
@@ -749,8 +744,8 @@ static int apci1500_do_write(struct comedi_device *dev,
 
                                        }
 
-                                       outw(data[0], devpriv->addon +
-                                            APCI1500_DIGITAL_OP);
+                                       outw(data[0],
+                                            devpriv->addon + APCI1500_DO_REG);
                                } else {
                                        dev_warn(dev->class_dev,
                                                "Specified channel not supported\n");
@@ -793,7 +788,7 @@ static int apci1500_timer_config(struct comedi_device *dev,
 
        /* Selection of the input clock */
        if (data[0] == 0 || data[0] == 1 || data[0] == 2) {
-               outw(data[0], devpriv->addon + APCI1500_CLK_SELECT);
+               outw(data[0], devpriv->addon + APCI1500_CLK_SEL_REG);
        } else {
                if (data[0] != 3) {
                        dev_warn(dev->class_dev,
@@ -1625,7 +1620,7 @@ static int apci1500_reset(struct comedi_device *dev)
        z8536_reset(dev);
 
        /* reset all the digital outputs */
-       outw(0x0, devpriv->addon + APCI1500_DIGITAL_OP);
+       outw(0x0, devpriv->addon + APCI1500_DO_REG);
 
        /* Deactivates all interrupts */
        z8536_write(dev, 0x00, APCI1500_RW_MASTER_INTERRUPT_CONTROL);
index 9cb80e031c101179cafe480a38441c838f2fafbd..6892c0a72ce05ff0da25f9cc029a5f4415887c43 100644 (file)
 #define APCI1500_Z8536_PORTA_REG       0x02
 #define APCI1500_Z8536_CTRL_REG                0x03
 
+/*
+ * PCI Bar 2 Register map (devpriv->addon)
+ */
+#define APCI1500_CLK_SEL_REG           0x00
+#define APCI1500_DI_REG                        0x00
+#define APCI1500_DO_REG                        0x02
+
 struct apci1500_private {
        unsigned long amcc;
        unsigned long addon;