]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
staging: comedi: das1800: clarify step 4 of the ai (*do_cmdtest)
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 8 Apr 2016 19:41:58 +0000 (12:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Apr 2016 05:16:10 +0000 (22:16 -0700)
commit7d5fa05cc41bba07908661de9790ad9291777ba6
tree494ec3e80b260089ce8120b7a169ac81e0f4dd67
parentcf9eaee0edaf77d46be528f6293c08deb7b646e8
staging: comedi: das1800: clarify step 4 of the ai (*do_cmdtest)

This step of the (*do_cmdtest) fixes the timing arguments when the
cmd->convert_src is TRIG_TIMER. The code is compact but it's a bit
hard to understand the "burst mode" vs. "non burst mode" (i.e. paced)
timing.

Clarify the fixup by splitting it into separate functions to check
the arguments based on if the command is doing 'paced' or 'burst'
timing. Add some comments to clarify the fixups.

This also fixes a minor issue with the 'burst' timing. When the
cmd->scan_begin_src is also TRIG_TIMER the pacer clock is used to
start each scan. The cmd->scan_begin_arg specifies the scan time.
The minimum (not maximum) value for this time must be large enough
for the 'burst' conversion time to sample all the channels.

The current 'max' check limits the scan time to the minimum time
(i.e. the max conversion speed).

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