]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit569a015da8693317fd4a480c14a3759d0bdc6295
tree2f299810eb33d8937dcdbd47d97bd83d962e992b
parent3b5fe1321e068eb83100d6e38d29e4aa16225c87
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