staging: comedi: addi_apci_2032: use comedi_async 'scans_done' to detect EOA
Remove the private data member 'stop_count' and use the comedi_async 'scans_done' member to detect the end-of-acquisition. 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:
parent
1dacbe5b26
commit
d1c87ceb44
1 changed files with 5 additions and 12 deletions
|
@ -47,7 +47,6 @@
|
||||||
|
|
||||||
struct apci2032_int_private {
|
struct apci2032_int_private {
|
||||||
spinlock_t spinlock;
|
spinlock_t spinlock;
|
||||||
unsigned int stop_count;
|
|
||||||
bool active;
|
bool active;
|
||||||
unsigned char enabled_isns;
|
unsigned char enabled_isns;
|
||||||
};
|
};
|
||||||
|
@ -148,7 +147,6 @@ static int apci2032_int_cmd(struct comedi_device *dev,
|
||||||
spin_lock_irqsave(&subpriv->spinlock, flags);
|
spin_lock_irqsave(&subpriv->spinlock, flags);
|
||||||
|
|
||||||
subpriv->enabled_isns = enabled_isns;
|
subpriv->enabled_isns = enabled_isns;
|
||||||
subpriv->stop_count = cmd->stop_arg;
|
|
||||||
subpriv->active = true;
|
subpriv->active = true;
|
||||||
outl(enabled_isns, dev->iobase + APCI2032_INT_CTRL_REG);
|
outl(enabled_isns, dev->iobase + APCI2032_INT_CTRL_REG);
|
||||||
|
|
||||||
|
@ -211,17 +209,12 @@ static irqreturn_t apci2032_interrupt(int irq, void *d)
|
||||||
bits |= (1 << i);
|
bits |= (1 << i);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (comedi_buf_write_samples(s, &bits, 1)) {
|
comedi_buf_write_samples(s, &bits, 1);
|
||||||
|
|
||||||
if (cmd->stop_src == TRIG_COUNT &&
|
if (cmd->stop_src == TRIG_COUNT &&
|
||||||
subpriv->stop_count > 0) {
|
s->async->scans_done >= cmd->stop_arg)
|
||||||
subpriv->stop_count--;
|
|
||||||
if (subpriv->stop_count == 0) {
|
|
||||||
/* end of acquisition */
|
|
||||||
s->async->events |= COMEDI_CB_EOA;
|
s->async->events |= COMEDI_CB_EOA;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
spin_unlock(&subpriv->spinlock);
|
spin_unlock(&subpriv->spinlock);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue