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>