linux/drivers/staging
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
..
android Staging drivers patches for 3.20-rc1 2015-02-15 11:30:39 -08:00
board Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2015-02-19 10:36:45 -08:00
clocking-wizard
comedi staging: comedi: adv_pci1710: fix AI INSN_READ for non-zero channel 2015-03-01 19:25:59 -08:00
dgap
dgnc
emxx_udc Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2015-02-19 10:36:45 -08:00
fbtft
ft1000 staging: ft1000: fix braces warning 2015-02-07 17:37:52 +08:00
fwserial
gdm72xx
gdm724x
goldfish
gs_fpgaboot
i2o
iio First round of fixes for IIO in the 4.0 cycle. Note a followup 2015-02-28 07:15:09 -08:00
lustre switch ll_lookup_finish_locks() and ll_revalidate_it_finish() to inode 2015-02-17 22:14:37 -05:00
media Staging drivers patches for 3.20-rc1 2015-02-15 11:30:39 -08:00
mt29f_spinand
netlogic
nvec
octeon
octeon-usb
olpc_dcon
ozwpan
panel
rtl8188eu staging: rtl8188eu: core: switch with redundant cases 2015-02-07 17:37:52 +08:00
rtl8192e
rtl8192u
rtl8712 staging: rtl8712: Do coding style cleanup 2015-02-07 17:39:50 +08:00
rtl8723au Staging drivers patches for 3.20-rc1 2015-02-15 11:30:39 -08:00
rts5208
skein
slicoss
sm7xxfb staging: sm7xxfb: fix remaining CamelCase 2015-02-07 17:37:52 +08:00
speakup Staging drivers patches for 3.20-rc1 2015-02-15 11:30:39 -08:00
ste_rmi4
unisys
vme
vt6655
vt6656
wlan-ng Staging drivers patches for 3.20-rc1 2015-02-15 11:30:39 -08:00
xgifb
Kconfig Staging drivers patches for 3.20-rc1 2015-02-15 11:30:39 -08:00
Makefile Staging drivers patches for 3.20-rc1 2015-02-15 11:30:39 -08:00
staging.c