summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2016-06-08 18:26:39 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-06-18 04:02:56 (GMT)
commitff9842b651c501a2f13295035c5eb48d4b8e49b3 (patch)
treeabd2157d16dc4d15b3fb07928b2bbbf5e86a5b3e /drivers/staging/comedi
parent931987a0c6da7404f64e650fa3fd2d5659c61280 (diff)
downloadlinux-ff9842b651c501a2f13295035c5eb48d4b8e49b3.tar.xz
staging: comedi: addi_apci_1564: use comedi_handle_event() for timer
The timer subdevice can generate an interrupt. Currently send_sig() is used to let the task know when the interrupt occurs. Use the dev->read_subdev and comedi_handle_events() instead. 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>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/drivers/addi_apci_1564.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/staging/comedi/drivers/addi_apci_1564.c b/drivers/staging/comedi/drivers/addi_apci_1564.c
index 9350f59..45c1558 100644
--- a/drivers/staging/comedi/drivers/addi_apci_1564.c
+++ b/drivers/staging/comedi/drivers/addi_apci_1564.c
@@ -117,6 +117,7 @@
* the state of the interrupt capable inputs.
*/
#define APCI1564_EVENT_COS BIT(31)
+#define APCI1564_EVENT_TIMER BIT(30)
#define APCI1564_EVENT_MASK 0xfff0000f /* all but [19:4] */
struct apci1564_private {
@@ -189,15 +190,12 @@ static irqreturn_t apci1564_interrupt(int irq, void *d)
}
status = inl(devpriv->timer + ADDI_TCW_IRQ_REG);
- if (status & 0x01) {
- /* Disable Timer Interrupt */
+ if (status & ADDI_TCW_IRQ) {
+ s->state |= APCI1564_EVENT_TIMER;
+
+ /* clear the interrupt */
ctrl = inl(devpriv->timer + ADDI_TCW_CTRL_REG);
outl(0x0, devpriv->timer + ADDI_TCW_CTRL_REG);
-
- /* Send a signal to from kernel to user space */
- send_sig(SIGIO, devpriv->tsk_current, 0);
-
- /* Enable Timer Interrupt */
outl(ctrl, devpriv->timer + ADDI_TCW_CTRL_REG);
}