staging: comedi: addi_apci_1564: define the APCI1564_DI_IRQ_REG bits

Define the bits in this register. Remove the old defines in hwdrv_apci1564.c.

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:
H Hartley Sweeten 2015-08-07 11:45:06 -07:00 committed by Greg Kroah-Hartman
parent dbaa1490f9
commit 9f750d15a1
2 changed files with 10 additions and 18 deletions

View File

@ -1,11 +1,3 @@
/* Digital Input IRQ Function Selection */
#define APCI1564_DI_INT_OR (0 << 1)
#define APCI1564_DI_INT_AND (1 << 1)
/* Digital Input Interrupt Enable Disable. */
#define APCI1564_DI_INT_ENABLE 0x4
#define APCI1564_DI_INT_DISABLE 0xfffffffb
static int apci1564_timer_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,

View File

@ -79,6 +79,8 @@
#define APCI1564_DI_INT_MODE2_REG 0x08
#define APCI1564_DI_INT_STATUS_REG 0x0c
#define APCI1564_DI_IRQ_REG 0x10
#define APCI1564_DI_IRQ_ENA BIT(2)
#define APCI1564_DI_IRQ_MODE BIT(1) /* 1=AND, 0=OR */
#define APCI1564_DO_REG 0x14
#define APCI1564_DO_INT_CTRL_REG 0x18
#define APCI1564_DO_INT_CTRL_CC_INT_ENA BIT(1)
@ -164,9 +166,9 @@ static irqreturn_t apci1564_interrupt(int irq, void *d)
unsigned int chan;
status = inl(dev->iobase + APCI1564_DI_IRQ_REG);
if (status & APCI1564_DI_INT_ENABLE) {
if (status & APCI1564_DI_IRQ_ENA) {
/* disable the interrupt */
outl(status & APCI1564_DI_INT_DISABLE,
outl(status & ~APCI1564_DI_IRQ_ENA,
dev->iobase + APCI1564_DI_IRQ_REG);
s->state = inl(dev->iobase + APCI1564_DI_INT_STATUS_REG) &
@ -305,11 +307,9 @@ static int apci1564_cos_insn_config(struct comedi_device *dev,
outl(0x0, dev->iobase + APCI1564_DI_INT_MODE2_REG);
break;
case COMEDI_DIGITAL_TRIG_ENABLE_EDGES:
if (devpriv->ctrl != (APCI1564_DI_INT_ENABLE |
APCI1564_DI_INT_OR)) {
if (devpriv->ctrl != APCI1564_DI_IRQ_ENA) {
/* switching to 'OR' mode */
devpriv->ctrl = APCI1564_DI_INT_ENABLE |
APCI1564_DI_INT_OR;
devpriv->ctrl = APCI1564_DI_IRQ_ENA;
/* wipe old channels */
devpriv->mode1 = 0;
devpriv->mode2 = 0;
@ -323,11 +323,11 @@ static int apci1564_cos_insn_config(struct comedi_device *dev,
devpriv->mode2 |= data[5] << shift;
break;
case COMEDI_DIGITAL_TRIG_ENABLE_LEVELS:
if (devpriv->ctrl != (APCI1564_DI_INT_ENABLE |
APCI1564_DI_INT_AND)) {
if (devpriv->ctrl != (APCI1564_DI_IRQ_ENA |
APCI1564_DI_IRQ_MODE)) {
/* switching to 'AND' mode */
devpriv->ctrl = APCI1564_DI_INT_ENABLE |
APCI1564_DI_INT_AND;
devpriv->ctrl = APCI1564_DI_IRQ_ENA |
APCI1564_DI_IRQ_MODE;
/* wipe old channels */
devpriv->mode1 = 0;
devpriv->mode2 = 0;