linux/drivers/staging/comedi
Ian Abbott abe46b8932 staging: comedi: adv_pci1710: fix AI INSN_READ for non-zero channel
Reading of analog input channels by the `INSN_READ` comedi instruction
is broken for all except channel 0.  `pci171x_ai_insn_read()` calls
`pci171x_ai_read_sample()` with the wrong value for the third parameter.
It is supposed to be the current index in a channel list (which is
always of length 1 in this case, so the index should be 0), but instead
it is passing the actual channel number.  `pci171x_ai_read_sample()`
checks the channel number encoded in the raw sample value read from the
hardware matches the channel number stored in the specified index of the
previously set up channel list and returns `-ENODATA` if it doesn't
match.  Since the index should always be 0 in this case, the match will
fail unless the channel number is also 0.  Fix it by passing 0 as the
channel index.

Note that when the bug first appeared, it was `pci171x_ai_dropout()`
that was called with the wrong parameter value.  `pci171x_ai_dropout()`
got replaced with `pci171x_ai_read_sample()` in commit 7fd2dae250
("staging: comedi: adv_pci1710: introduce pci171x_ai_read_sample()").

Fixes: 16c7eb6047 ("staging: comedi: adv_pci1710: always enable PCI171x_PARANOIDCHECK code")
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Cc: stable <stable@vger.kernel.org> # 3.16+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-01 19:25:59 -08:00
..
drivers staging: comedi: adv_pci1710: fix AI INSN_READ for non-zero channel 2015-03-01 19:25:59 -08:00
kcomedilib Staging: comedi: kcomedilib: Fixed a typo 2015-01-17 14:33:24 -08:00
comedi_buf.c staging: comedi: comedidev.h: add 'scans_done' member to comedi_async 2014-11-05 14:59:46 -08:00
comedi_compat32.c staging: comedi: comedi_compat32.c: absorb raw_ioctl() 2015-01-28 11:19:34 -08:00
comedi_compat32.h staging: comedi: comedi_compat32.h: reformat copyright comment 2015-01-28 11:19:34 -08:00
comedi_fops.c staging: comedi: comedi_fops.c: reformat remaining block comments 2015-02-07 17:04:22 +08:00
comedi_internal.h staging: comedi: comedi_internal.h: checkpatch.pl --strict cleanup 2014-07-18 16:10:39 -07:00
comedi_pci.c staging: comedi: split out PCI support into new module 2014-11-07 09:24:33 -08:00
comedi_pcmcia.c staging: comedi: comedi_pcmcia.c: include new "comedi_pcmcia.h" header 2015-02-07 17:05:50 +08:00
comedi_pcmcia.h staging: comedi: comedi_pcmcia.h: move PCMCIA stuff out of comedidev.h 2015-02-07 17:05:51 +08:00
comedi_usb.c staging: comedi: comedi_usb.c: include new "comedi_usb.h" header 2015-01-28 11:18:50 -08:00
comedi_usb.h staging: comedi: comedi_usb.h: move USB stuff out of comedidev.h 2015-01-28 11:18:51 -08:00
comedi.h staging: comedi: add ioctls to set per-file read and write subdevice 2014-11-05 14:52:18 -08:00
comedidev.h staging: comedi: comedi_pcmcia.h: move PCMCIA stuff out of comedidev.h 2015-02-07 17:05:51 +08:00
comedilib.h
drivers.c staging: comedi: comedidev.h: add namespace to the subdevice "runflags" 2015-01-25 19:59:09 +08:00
Kconfig staging: comedi: ni_labpc_isadma: use comedi_isdma module 2015-01-17 14:32:55 -08:00
Makefile staging: comedi: split out PCI support into new module 2014-11-07 09:24:33 -08:00
proc.c
range.c staging: comedi: range.c: reformat copyright comment 2015-02-07 17:04:22 +08:00
TODO staging: comedi: TODO: remove item "reserve major number" 2014-05-28 14:18:11 -07:00