mirror of
https://github.com/torvalds/linux.git
synced 2024-11-05 03:21:32 +00:00
abe46b8932
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 |
||
---|---|---|
.. | ||
drivers | ||
kcomedilib | ||
comedi_buf.c | ||
comedi_compat32.c | ||
comedi_compat32.h | ||
comedi_fops.c | ||
comedi_internal.h | ||
comedi_pci.c | ||
comedi_pcmcia.c | ||
comedi_pcmcia.h | ||
comedi_usb.c | ||
comedi_usb.h | ||
comedi.h | ||
comedidev.h | ||
comedilib.h | ||
drivers.c | ||
Kconfig | ||
Makefile | ||
proc.c | ||
range.c | ||
TODO |