]> git.karo-electronics.de Git - linux-beck.git/commit
staging: comedi: comedi_test: handle partial scans in timer routine
authorIan Abbott <abbotti@mev.co.uk>
Tue, 27 Oct 2015 16:59:23 +0000 (16:59 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Oct 2015 23:58:36 +0000 (08:58 +0900)
commit1eb85ae8574eac40463ca3bfcef4608f7a374bd0
treec1ebf965bafc270fd2c3198527a5cc73e1e92770
parente0c6fe1294f4931af263f0386fb45943451e8b4f
staging: comedi: comedi_test: handle partial scans in timer routine

For asynchronous command handling on the analog input subdevice, a
kernel timer routine is used to generate the fake waveform data.  A
"scan" consists of a number of conversions separated in time by a
conversion period.  Successive scans are separated in time by a scan
period, which is at least the conversion period multiplied by the number
of conversions per scan.  Currently, the timer routine does not generate
any data until the end of a scan period, generating whole scans of data
at a time.  Change it to generate data at the end of each conversion
period, with an extra delay after the final conversion in each scan if
necessary.  Use new member `ai_convert_time` in the private data
structure `struct waveform_private` to keep track of when the next
conversion is due.  This replaces the old member `ai_last_scan_time`
which kept track of the time of the previous scan.

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