]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: dt2811: simplify analog output range options
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 4 May 2016 19:47:16 +0000 (12:47 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Jun 2016 03:44:04 +0000 (20:44 -0700)
commitdfef93f0018c193c08588dada104ff2386d9c94a
tree083a9a6bfd3d2f009e11c7be2a6731280cc7dd10
parent9871c583fbb44981e09ee89dc62b72e014b4e36d
staging: comedi: dt2811: simplify analog output range options

The D/A ranges are not programmable. Currently this driver uses some
configuration options to select the comedi_lrange for each channel.
This is a bit messy and it requires the user to make sure the correct
option value is used.

The range information isn't used by the driver. The user space library
uses it to convert between raw data values and physical units. If the
user passed an incorrect option when attaching the driver the conversion
will be incorrect.

Simplify the analog output ranges by providing a range_table that
contains all the possible output ranges. The user can then select the
correct range when converting values.

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