]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: comedi: adv_pci1724: define the sync output control/status reg
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Thu, 20 Nov 2014 22:10:54 +0000 (15:10 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Nov 2014 23:36:41 +0000 (15:36 -0800)
Define the bits for the synchronous output control/status register and
remove the enum.

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/adv_pci1724.c

index 91e57c8fd3bbc17dd90dd98c73b132951989782d..f4c42eb031fcdf4afd1d6b72cd9da832e767924f 100644 (file)
@@ -68,16 +68,13 @@ supported PCI devices are configured as comedi devices automatically.
 #define PCI1724_DAC_CTRL_MODE_NORMAL   (3 << 14)
 #define PCI1724_DAC_CTRL_MODE_MASK     (3 << 14)
 #define PCI1724_DAC_CTRL_DATA(x)       (((x) & 0x3fff) << 0)
-#define PCI1724_SYNC_OUTPUT_REG                0x04
+#define PCI1724_SYNC_CTRL_REG          0x04
+#define PCI1724_SYNC_CTRL_DACSTAT      (1 << 1)
+#define PCI1724_SYNC_CTRL_SYN          (1 << 0)
 #define PCI1724_EEPROM_CTRL_REG                0x08
 #define PCI1724_SYNC_OUTPUT_TRIG_REG   0x0c
 #define PCI1724_BOARD_ID_REG           0x10
 
-enum sync_output_contents {
-       SYNC_MODE = 0x1,
-       DAC_BUSY = 0x2, /* dac state machine is not ready */
-};
-
 enum sync_output_trigger_contents {
        SYNC_TRIGGER_BITS = 0x0 /* any value works */
 };
@@ -102,8 +99,8 @@ static int adv_pci1724_dac_idle(struct comedi_device *dev,
 {
        unsigned int status;
 
-       status = inl(dev->iobase + PCI1724_SYNC_OUTPUT_REG);
-       if ((status & DAC_BUSY) == 0)
+       status = inl(dev->iobase + PCI1724_SYNC_CTRL_REG);
+       if ((status & PCI1724_SYNC_CTRL_DACSTAT) == 0)
                return 0;
        return -EBUSY;
 }
@@ -122,7 +119,7 @@ static int adv_pci1724_insn_write(struct comedi_device *dev,
        ctrl = PCI1724_DAC_CTRL_GX(chan) | PCI1724_DAC_CTRL_CX(chan) | mode;
 
        /* turn off synchronous mode */
-       outl(0, dev->iobase + PCI1724_SYNC_OUTPUT_REG);
+       outl(0, dev->iobase + PCI1724_SYNC_CTRL_REG);
 
        for (i = 0; i < insn->n; ++i) {
                unsigned int val = data[i];