staging: comedi: ni_65xx: don't invert outputs by default
staging: comedi: ni_65xx: don't invert outputs by default

This driver currently inverts the outputs for the DO (digital output)
subdevice for some of the boards it supports, indicated by the
`invert_outputs` member in the board-specific data being initialized to
1.  It seems this driver shouldn't really be inverting outputs for these
boards at all, but has done so since the driver was first written back
in October 2006.  I've had confirmation that for the PCI-6515 at least,
the output voltage levels are opposite to the values set by the user
program.

The driver by Jon Grierson originally supported only PCI-6514 and
PXI-6514 (and was originally called "ni_6514").  The driver was based on
"ni_6527", which is where the inversion of outputs appears to have come
from.  Over a period of a few days, the driver was enhanced by Frank
Mori Hess to support other boards.  Some of these plainly didn't require
inverted outputs and some guesswork was used to decide which boards
should have inverted outputs.  Some of the boards in question are
described in the manual as having "Sink Outputs" and others are
described as having "Source Outputs", but this does not correspond in
any way with which boards are marked as having inverted outputs, so the
criterion that Frank used is a bit of a mystery!

Change the driver so it doesn't invert the outputs of these by boards by
default, but add a module parameter, "legacy_invert_outputs", that can
be set to 'true' to restore the old behaviour.  Also rename the
`invert_outputs` member of `struct ni_65xx_board` to `legacy_invert`.

Signed-off-by: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs