staging: comedi: pcl818: factor out the common "next ai chan" code
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 4 Mar 2014 18:29:38 +0000 (11:29 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 01:06:12 +0000 (17:06 -0800)
commit6d5b78584f8fabfa8f359af1e44d64aba8264155
treeda9ba5cd62a10bd5b44fecb85a4b024d31c1ff52
parent0f8837bc80dda193535a47776c19e433f24b75de
staging: comedi: pcl818: factor out the common "next ai chan" code

The DMA, FIFO, 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.

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/pcl818.c