diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-01-23 12:46:22 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-25 12:00:31 -0800 |
commit | 9798df7269a44fb148d1815542abb844b0dac435 (patch) | |
tree | 54220fa2b9306433955be816444c2df17b9a4e7e /drivers/staging/comedi/drivers/addi_apci_3501.c | |
parent | 6ff35881e882f744a4a9954fbf838296a36fe7c2 (diff) | |
download | linux-rt-9798df7269a44fb148d1815542abb844b0dac435.tar.gz |
staging: comedi: addi_apci_3501: define the timer i/o registers
Create, and use, defines for the i/o registers used with the timer
subdevice.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/addi_apci_3501.c')
-rw-r--r-- | drivers/staging/comedi/drivers/addi_apci_3501.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/staging/comedi/drivers/addi_apci_3501.c b/drivers/staging/comedi/drivers/addi_apci_3501.c index 72292ab13e34..0fdcbe2d5b69 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3501.c +++ b/drivers/staging/comedi/drivers/addi_apci_3501.c @@ -44,6 +44,14 @@ #define APCI3501_AO_DATA_VAL(x) ((x) << 8) #define APCI3501_AO_DATA_BIPOLAR (1 << 31) #define APCI3501_AO_TRIG_SCS_REG 0x08 +#define APCI3501_TIMER_SYNC_REG 0x20 +#define APCI3501_TIMER_RELOAD_REG 0x24 +#define APCI3501_TIMER_TIMEBASE_REG 0x28 +#define APCI3501_TIMER_CTRL_REG 0x2c +#define APCI3501_TIMER_STATUS_REG 0x30 +#define APCI3501_TIMER_IRQ_REG 0x34 +#define APCI3501_TIMER_WARN_RELOAD_REG 0x38 +#define APCI3501_TIMER_WARN_TIMEBASE_REG 0x3c #define APCI3501_DO_REG 0x40 #define APCI3501_DI_REG 0x50 @@ -268,17 +276,11 @@ static irqreturn_t apci3501_interrupt(int irq, void *d) int i_temp; /* Disable Interrupt */ - ul_Command1 = - inl(dev->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG); - + ul_Command1 = inl(dev->iobase + APCI3501_TIMER_CTRL_REG); ul_Command1 = (ul_Command1 & 0xFFFFF9FDul); - outl(ul_Command1, - dev->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG); - - ui_Timer_AOWatchdog = - inl(dev->iobase + APCI3501_WATCHDOG + - APCI3501_TCW_IRQ) & 0x1; + outl(ul_Command1, dev->iobase + APCI3501_TIMER_CTRL_REG); + ui_Timer_AOWatchdog = inl(dev->iobase + APCI3501_TIMER_IRQ_REG) & 0x1; if ((!ui_Timer_AOWatchdog)) { comedi_error(dev, "IRQ from unknown source"); return IRQ_NONE; @@ -286,13 +288,10 @@ static irqreturn_t apci3501_interrupt(int irq, void *d) /* Enable Interrupt Send a signal to from kernel to user space */ send_sig(SIGIO, devpriv->tsk_Current, 0); - ul_Command1 = - inl(dev->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG); + ul_Command1 = inl(dev->iobase + APCI3501_TIMER_CTRL_REG); ul_Command1 = ((ul_Command1 & 0xFFFFF9FDul) | 1 << 1); - outl(ul_Command1, - dev->iobase + APCI3501_WATCHDOG + APCI3501_TCW_PROG); - i_temp = inl(dev->iobase + APCI3501_WATCHDOG + - APCI3501_TCW_TRIG_STATUS) & 0x1; + outl(ul_Command1, dev->iobase + APCI3501_TIMER_CTRL_REG); + i_temp = inl(dev->iobase + APCI3501_TIMER_STATUS_REG) & 0x1; return IRQ_HANDLED; } |