]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: pcmad: properly handle analog input encoding configuration
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 5 Jun 2013 22:38:37 +0000 (15:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Jun 2013 19:01:35 +0000 (12:01 -0700)
commit7db5163912544fda5505572ddbb6a81fcebed072
tree6e3dea959d0b450ceb5a8e3d618b8a30682b140b
parent2803706302fffc79d22ed0ea5c705ea001e586e3
staging: comedi: pcmad: properly handle analog input encoding configuration

The comedi_config utility is used to attach to this board. One of the
configuration options passed by the user sets the analog input encoding
for straight binary or two's complement data. The hardware produces
straight binary data when jumpered for 5V unipolar inputs and two's
complement data when jumpered for +-10V bipolar inputs.

Use the configuration option to correctly set the comedi_subdevice
range_table.

We can then use a helper function to determine what the range is when
reading the analog inputs. This allows removing the 'twos_comp' variable
from the private data (which was actually never used).

Since the private data is now empty, remove it completely.

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>
drivers/staging/comedi/drivers/pcmad.c