diff options
| author | Ian Abbott <abbotti@mev.co.uk> | 2013-09-26 10:16:37 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-26 09:34:44 -0700 |
| commit | b7ea391cc4edf5ebb62d6341285ac5da342213f4 (patch) | |
| tree | 56118ac8b4d4550963e333c6993215f581900594 | |
| parent | 1b0ef827d9edbc7e702ad50c363293d5cea6bb76 (diff) | |
staging: comedi: pcl711: add AI cancel handler
Comedi subdevices that support asynchronous commands should have a
'cancel' handler to stop an in-progress command. Add such a handler to
the pcl711 driver module. I think merely setting the acquisition mode
to "software-triggered" would be sufficient, but also clear the
interrupt status for good luck.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/comedi/drivers/pcl711.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/staging/comedi/drivers/pcl711.c b/drivers/staging/comedi/drivers/pcl711.c index eb800bef8852..939a11f4e3c8 100644 --- a/drivers/staging/comedi/drivers/pcl711.c +++ b/drivers/staging/comedi/drivers/pcl711.c @@ -189,6 +189,14 @@ static unsigned int pcl711_ai_get_sample(struct comedi_device *dev, return val & s->maxdata; } +static int pcl711_ai_cancel(struct comedi_device *dev, + struct comedi_subdevice *s) +{ + outb(PCL711_INT_STAT_CLR, dev->iobase + PCL711_INT_STAT_REG); + pcl711_ai_set_mode(dev, PCL711_MODE_SOFTTRIG); + return 0; +} + static irqreturn_t pcl711_interrupt(int irq, void *d) { struct comedi_device *dev = d; @@ -493,6 +501,7 @@ static int pcl711_attach(struct comedi_device *dev, struct comedi_devconfig *it) s->len_chanlist = 1; s->do_cmdtest = pcl711_ai_cmdtest; s->do_cmd = pcl711_ai_cmd; + s->cancel = pcl711_ai_cancel; } /* Analog Output subdevice */ |
