Staging: comedi: ni_65xx.c: fix output inversion problem.

When reading DO subdevice with inverted outputs invert the values read
back from the ports to match the inversion of values written.

Signed-off-by: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Ian Abbott and committed by
Greg Kroah-Hartman
078a10df 2b49d7c4

+6
+6
drivers/staging/comedi/drivers/ni_65xx.c
··· 457 port_read_bits = 458 readb(private(dev)->mite->daq_io_addr + Port_Data(port)); 459 /* printk("read 0x%x from port %i\n", port_read_bits, port); */ 460 if (bitshift > 0) { 461 port_read_bits <<= bitshift; 462 } else {
··· 457 port_read_bits = 458 readb(private(dev)->mite->daq_io_addr + Port_Data(port)); 459 /* printk("read 0x%x from port %i\n", port_read_bits, port); */ 460 + if (s->type == COMEDI_SUBD_DO && board(dev)->invert_outputs) { 461 + /* Outputs inverted, so invert value read back from 462 + * DO subdevice. (Does not apply to boards with DIO 463 + * subdevice.) */ 464 + port_read_bits ^= 0xFF; 465 + } 466 if (bitshift > 0) { 467 port_read_bits <<= bitshift; 468 } else {