From: H Hartley Sweeten Date: Thu, 20 Nov 2014 22:10:54 +0000 (-0700) Subject: staging: comedi: adv_pci1724: define the sync output control/status reg X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=14356535fbf9d4be3c94f6afa6e46768f0e07197;p=deliverable%2Flinux.git staging: comedi: adv_pci1724: define the sync output control/status reg Define the bits for the synchronous output control/status register and remove the enum. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/adv_pci1724.c b/drivers/staging/comedi/drivers/adv_pci1724.c index 91e57c8fd3bb..f4c42eb031fc 100644 --- a/drivers/staging/comedi/drivers/adv_pci1724.c +++ b/drivers/staging/comedi/drivers/adv_pci1724.c @@ -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];