staging: comedi: pcl818: introduce pcl818_ai_write_sample()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 20 Jan 2015 19:06:03 +0000 (12:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 25 Jan 2015 11:59:10 +0000 (19:59 +0800)
commitd615416de6157812e6d7b732991ece884fc6c59e
treea353a3acbd1afd9584df04281afac1f0c8a24e3c
parent3e6cb74f5632e1ac2b4209b4d2c64fca43e2838b
staging: comedi: pcl818: introduce pcl818_ai_write_sample()

This driver can acquire analog input samples during the async command with
DMA, by using the FIFO, or sample-by-sample using the End-Of-Conversion
interrupt. All three methods do the following sequence:

  1) check for channel dropout
  2) add the sample to the async buffer
  3) advance the channel dropout detection and detect the end of the command

Merge this sequence into a new helper function.

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