+----------+-----------+------------------------------------------------+
 */
 
-/* Card Specific information */
-#define APCI3501_ADDRESS_RANGE         255
-
-#define APCI3501_DIGITAL_IP            0x50
-#define APCI3501_DIGITAL_OP            0x40
-#define APCI3501_ANALOG_OUTPUT         0x00
-
 /* Analog Output related Defines */
-#define APCI3501_AO_VOLT_MODE          0
-#define APCI3501_AO_PROG               4
-#define APCI3501_AO_TRIG_SCS           8
-#define UNIPOLAR                       0
-#define BIPOLAR                                1
 #define MODE0                          0
 #define MODE1                          1
 
 {
        struct apci3501_private *devpriv = dev->private;
 
-       outl(data[0],
-               dev->iobase + APCI3501_ANALOG_OUTPUT +
-               APCI3501_AO_VOLT_MODE);
+       outl(data[0], dev->iobase + APCI3501_AO_CTRL_STATUS_REG);
 
        if (data[0]) {
                devpriv->b_InterruptMode = MODE1;
                printk("\nIn WriteAnalogOutput :: Not Valid Channel\n");
        }                       /*  end if((ul_Channel_no<0)||(ul_Channel_no>7)) */
 
-       ul_DAC_Ready = inl(dev->iobase + APCI3501_ANALOG_OUTPUT);
+       ul_DAC_Ready = inl(dev->iobase + APCI3501_AO_CTRL_STATUS_REG);
 
        while (ul_DAC_Ready == 0) {
-               ul_DAC_Ready = inl(dev->iobase + APCI3501_ANALOG_OUTPUT);
+               ul_DAC_Ready = inl(dev->iobase + APCI3501_AO_CTRL_STATUS_REG);
                ul_DAC_Ready = (ul_DAC_Ready >> 8) & 1;
        }
 
                        (unsigned int) ((unsigned int) (ul_Channel_no & 0xFF) |
                        (unsigned int) ((*data << 0x8) & 0x7FFFFF00L) |
                        (unsigned int) (ul_Polarity));
-               outl(ul_Command1,
-                       dev->iobase + APCI3501_ANALOG_OUTPUT +
-                       APCI3501_AO_PROG);
+               outl(ul_Command1, dev->iobase + APCI3501_AO_DATA_REG);
        }
 
        return insn->n;
 
 #include "comedi_fc.h"
 #include "amcc_s5933.h"
 
+/*
+ * PCI bar 1 register I/O map
+ */
+#define APCI3501_AO_CTRL_STATUS_REG            0x00
+#define APCI3501_AO_CTRL_BIPOLAR               (1 << 0)
+#define APCI3501_AO_STATUS_READY               (1 << 8)
+#define APCI3501_AO_DATA_REG                   0x04
+#define APCI3501_AO_TRIG_SCS_REG               0x08
+#define APCI3501_DO_REG                                0x40
+#define APCI3501_DI_REG                                0x50
+
 struct apci3501_private {
        int i_IobaseAmcc;
        struct task_struct *tsk_Current;
                                 struct comedi_insn *insn,
                                 unsigned int *data)
 {
-       data[1] = inl(dev->iobase + APCI3501_DIGITAL_IP) & 0x3;
+       data[1] = inl(dev->iobase + APCI3501_DI_REG) & 0x3;
 
        return insn->n;
 }
        unsigned int mask = data[0];
        unsigned int bits = data[1];
 
-       s->state = inl(dev->iobase + APCI3501_DIGITAL_OP);
+       s->state = inl(dev->iobase + APCI3501_DO_REG);
        if (mask) {
                s->state &= ~mask;
                s->state |= (bits & mask);
 
-               outl(s->state, dev->iobase + APCI3501_DIGITAL_OP);
+               outl(s->state, dev->iobase + APCI3501_DO_REG);
        }
 
        data[1] = s->state;
        int i_Count = 0, i_temp = 0;
        unsigned int ul_Command1 = 0, ul_Polarity, ul_DAC_Ready = 0;
 
-       outl(0x0, dev->iobase + APCI3501_DIGITAL_OP);
-       outl(1, dev->iobase + APCI3501_ANALOG_OUTPUT +
-               APCI3501_AO_VOLT_MODE);
+       outl(0x0, dev->iobase + APCI3501_DO_REG);
+       outl(1, dev->iobase + APCI3501_AO_CTRL_STATUS_REG);
 
        ul_Polarity = 0x80000000;
 
        for (i_Count = 0; i_Count <= 7; i_Count++) {
-               ul_DAC_Ready = inl(dev->iobase + APCI3501_ANALOG_OUTPUT);
+               ul_DAC_Ready = inl(dev->iobase + APCI3501_AO_CTRL_STATUS_REG);
 
                while (ul_DAC_Ready == 0) {
                        ul_DAC_Ready =
-                               inl(dev->iobase + APCI3501_ANALOG_OUTPUT);
+                               inl(dev->iobase + APCI3501_AO_CTRL_STATUS_REG);
                        ul_DAC_Ready = (ul_DAC_Ready >> 8) & 1;
                }
 
                                (unsigned int) ((unsigned int) (i_Count & 0xFF) |
                                (unsigned int) ((i_temp << 0x8) & 0x7FFFFF00L) |
                                (unsigned int) (ul_Polarity));
-                       outl(ul_Command1,
-                               dev->iobase + APCI3501_ANALOG_OUTPUT +
-                               APCI3501_AO_PROG);
+                       outl(ul_Command1, dev->iobase + APCI3501_AO_DATA_REG);
                }
        }