Staging: comedi: pcl818: Correct AI scan counting and channel checks
authorIan Abbott <abbotti@mev.co.uk>
Wed, 20 Jan 2010 13:04:46 +0000 (13:04 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 4 Mar 2010 00:42:47 +0000 (16:42 -0800)
commitb3559cb1aa5f863e1ce9b94b518be7ddf6680e45
tree76a55c0276395056cf6aabffb03346fd41b0ad54
parent13de4f000ec491b16a820e4ed59de2c98b7807be
Staging: comedi: pcl818: Correct AI scan counting and channel checks

For AI commands, the scan counter should be updated after every
scan.  It was being updated after every sample except for DMA mode
where it was being updated after every repeated segment of the
channel list.

Also AI commands with multiple channels were being terminated with
an error prematurely except in DMA mode.  This was because the
driver was comparing channel numbers received from the hardware
(combined with the sample value) with the expected channel numbers
to check for a "channel dropout".  This test was failing
incorrectly because the driver was not keeping the current position
within the (repeated segment of the) channel list up to date.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/comedi/drivers/pcl818.c