mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-02 01:06:46 +09:00
staging: comedi: rti800: swap val and mask when reading ai data
The (mask & val) operation when reading the high 4-bits of the analog data looks strange. Change it to (val & mask). Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c7c1161dfd
commit
aac49c3417
@@ -217,7 +217,7 @@ static int rti800_ai_insn_read(struct comedi_device *dev,
|
||||
return ret;
|
||||
|
||||
data[i] = inb(dev->iobase + RTI800_ADCLO);
|
||||
data[i] |= (0xf & inb(dev->iobase + RTI800_ADCHI)) << 8;
|
||||
data[i] |= (inb(dev->iobase + RTI800_ADCHI) & 0xf) << 8;
|
||||
|
||||
if (devpriv->adc_2comp)
|
||||
data[i] ^= 0x800;
|
||||
|
||||
Reference in New Issue
Block a user