mirror of https://gitee.com/openkylin/linux.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 <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
83d94bcc8e
commit
14356535fb
|
@ -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_NORMAL (3 << 14)
|
||||||
#define PCI1724_DAC_CTRL_MODE_MASK (3 << 14)
|
#define PCI1724_DAC_CTRL_MODE_MASK (3 << 14)
|
||||||
#define PCI1724_DAC_CTRL_DATA(x) (((x) & 0x3fff) << 0)
|
#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_EEPROM_CTRL_REG 0x08
|
||||||
#define PCI1724_SYNC_OUTPUT_TRIG_REG 0x0c
|
#define PCI1724_SYNC_OUTPUT_TRIG_REG 0x0c
|
||||||
#define PCI1724_BOARD_ID_REG 0x10
|
#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 {
|
enum sync_output_trigger_contents {
|
||||||
SYNC_TRIGGER_BITS = 0x0 /* any value works */
|
SYNC_TRIGGER_BITS = 0x0 /* any value works */
|
||||||
};
|
};
|
||||||
|
@ -102,8 +99,8 @@ static int adv_pci1724_dac_idle(struct comedi_device *dev,
|
||||||
{
|
{
|
||||||
unsigned int status;
|
unsigned int status;
|
||||||
|
|
||||||
status = inl(dev->iobase + PCI1724_SYNC_OUTPUT_REG);
|
status = inl(dev->iobase + PCI1724_SYNC_CTRL_REG);
|
||||||
if ((status & DAC_BUSY) == 0)
|
if ((status & PCI1724_SYNC_CTRL_DACSTAT) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
return -EBUSY;
|
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;
|
ctrl = PCI1724_DAC_CTRL_GX(chan) | PCI1724_DAC_CTRL_CX(chan) | mode;
|
||||||
|
|
||||||
/* turn off synchronous 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) {
|
for (i = 0; i < insn->n; ++i) {
|
||||||
unsigned int val = data[i];
|
unsigned int val = data[i];
|
||||||
|
|
Loading…
Reference in New Issue