diff options
| author | H Hartley Sweeten <[email protected]> | 2015-08-17 16:58:17 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2015-09-12 18:24:20 -0700 |
| commit | 8a5d6d2ee252dd76305c18f843f82ee7ee376371 (patch) | |
| tree | d803cdbbe84ebae9a5ff4d14271370790117d35c /drivers/staging/comedi | |
| parent | 15bccf2e5d7f5d1960c41962b2b628bd1b034ce2 (diff) | |
staging: comedi: s526: define the interrupt enable/status registers
These registers use the same bit defines. Define both of them and
the bits.
Signed-off-by: H Hartley Sweeten <[email protected]>
Reviewed-by: Ian Abbott <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/staging/comedi')
| -rw-r--r-- | drivers/staging/comedi/drivers/s526.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/staging/comedi/drivers/s526.c b/drivers/staging/comedi/drivers/s526.c index 5f8a5d3aa9f7..11a661b353ca 100644 --- a/drivers/staging/comedi/drivers/s526.c +++ b/drivers/staging/comedi/drivers/s526.c @@ -68,8 +68,14 @@ #define S526_AO_REG 0x08 #define S526_AI_REG 0x08 #define REG_DIO 0x0A -#define REG_IER 0x0C -#define REG_ISR 0x0E +#define S526_INT_ENA_REG 0x0c +#define S526_INT_STATUS_REG 0x0e +#define S526_INT_DIO(x) BIT(8 + ((x) & 0x7)) +#define S526_INT_EEPROM BIT(7) /* status only */ +#define S526_INT_CNTR(x) BIT(3 + (3 - ((x) & 0x3))) +#define S526_INT_AI BIT(2) +#define S526_INT_AO BIT(1) +#define S526_INT_TIMER BIT(0) #define REG_MSC 0x10 #define S526_GPCT_LSB_REG(x) (0x12 + ((x) * 8)) @@ -372,7 +378,6 @@ static int s526_gpct_winsn(struct comedi_device *dev, return insn->n; } -#define ISR_ADC_DONE 0x4 static int s526_ai_insn_config(struct comedi_device *dev, struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data) @@ -393,7 +398,7 @@ static int s526_ai_insn_config(struct comedi_device *dev, * INSN_READ handler. */ /* Enable ADC interrupt */ - outw(ISR_ADC_DONE, dev->iobase + REG_IER); + outw(S526_INT_AI, dev->iobase + S526_INT_ENA_REG); devpriv->ai_config = (data[0] & 0x3ff) << 5; if (data[1] > 0) devpriv->ai_config |= S526_AI_CTRL_DELAY;/* set the delay */ @@ -410,8 +415,8 @@ static int s526_ai_eoc(struct comedi_device *dev, { unsigned int status; - status = inw(dev->iobase + REG_ISR); - if (status & ISR_ADC_DONE) + status = inw(dev->iobase + S526_INT_STATUS_REG); + if (status & S526_INT_AI) return 0; return -EBUSY; } @@ -444,7 +449,7 @@ static int s526_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s, if (ret) return ret; - outw(ISR_ADC_DONE, dev->iobase + REG_ISR); + outw(S526_INT_AI, dev->iobase + S526_INT_STATUS_REG); d = inw(dev->iobase + S526_AI_REG); |