From 9f750d15a1d8387605745c89c21cf46d4ddd4cd0 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Fri, 7 Aug 2015 11:45:06 -0700 Subject: [PATCH] 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- .../comedi/drivers/addi-data/hwdrv_apci1564.c | 8 -------- drivers/staging/comedi/drivers/addi_apci_1564.c | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c index 42a87b7..0fd7705 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c @@ -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, diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c index 2664bfa..ae8446e 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1564.c +++ b/drivers/staging/comedi/drivers/addi_apci_1564.c @@ -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; -- 2.7.4