staging: comedi: adv_pci1710: refactor ai range programming
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 13 Nov 2015 18:11:07 +0000 (11:11 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Dec 2015 22:56:30 +0000 (14:56 -0800)
commit7603900fc7b41c71753d69487930eda707048b9d
tree2f299810eb33d8937dcdbd47d97bd83d962e992b
parent19cbb8fb798f9e391df2876ea9522fbd6be88358
staging: comedi: adv_pci1710: refactor ai range programming

The gain codes used to program the analog output range are currently
stored in const char arrays. The values look a bit "magic" and it's
not clear how they associate with the comedi_lrange without looking
through user manuals.

Refactor the ai range programming to clarify the driver and remove
the magic numbers. Also, refine the bits in the range register that
set the differential and unipolar modes.

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/adv_pci1710.c