staging: comedi: dt282x: fix Analog Input se/diff channel configuration
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 20 Jun 2014 20:12:55 +0000 (13:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2014 00:08:20 +0000 (20:08 -0400)
commitd5aa6b7c31d8f9667e743a8bb2a6677caf78cd31
tree3df3f18dcb2c798833fefe0402ec3ada516aa808
parent810c8a88b660b1a06bd9b8b7b0fa00c990c4e734
staging: comedi: dt282x: fix Analog Input se/diff channel configuration

Most of the boards supported by this driver can do either single-ended or
differential Analog Input but there are a couple that can only do one or
the other. On the boards that can do both the type of input is set with
jumpers on the board.

The 'it->options[4]' passed by the user during the board (*attach) is used
to determine how the Analog Inputs are configured. This is used to set
the subdevice flags and number of channels correctly.

Fix the check of this option so that it only applies when the board can
actually do differential input. Also, default to differential inputs if
that is the only mode the board supports.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/dt282x.c