staging: comedi: me4000: simplify analog input range programming
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 5 Aug 2015 17:44:51 +0000 (10:44 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Aug 2015 22:03:28 +0000 (15:03 -0700)
commit245bd462440ca5914286c71051fdc5af506e76cb
tree7a75fc5f72117ef356a82b4ae8bc1c5a0dbc6f3c
parent271f5aa04be0ff3d0c6fc8ccc31a6b0d3294461b
staging: comedi: me4000: simplify analog input range programming

The comedi_lrange table for the analog inputs is inverted compared
to the values that need to be written to the ME4000_AI_CHANNEL_LIST_REG
to select the range.

Create a macro, ME4000_AI_LIST_RANGE(), to handle the inversion. Remove
the old defines and simplify the code a bit.

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/me4000.c
This page took 0.025068 seconds and 5 git commands to generate.