]> git.openfabrics.org - ~emulex/infiniband.git/commit
staging: comedi: pcl812: factor out the common "next ai chan" code
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 4 Mar 2014 18:29:36 +0000 (11:29 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 01:06:12 +0000 (17:06 -0800)
commitdb702b7858abd08ecd99bec1544eb519801330aa
treea54c10ee8c1d2ae8777e7fd3502e3949fae276b3
parent8429504a575ded74c6267361592879cedfb7b860
staging: comedi: pcl812: factor out the common "next ai chan" code

The DMA and EOC interrupt handlers all have common code that bumps the
counters in the private data that keep track of what channel is being
sampled next and when all the data has been sampled.

Factor this common code into a helper function.

Don't clear the events in the driver. The comedi core will clear the events
at the end of the comedi_event().

Make sure the COMEDI_CB_BLOCK event is set when advancing to the next
channel so that when the comedi_event() is finally called the core will
wake the async_queue to return the analog input data.

Also, make sure the COMEDI_CB_EOS event is set at the completion of each
scan.

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>
drivers/staging/comedi/drivers/pcl812.c