]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: adv_pci1710: support external analog output reference
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 13 Nov 2015 18:11:17 +0000 (11:11 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Dec 2015 22:56:30 +0000 (14:56 -0800)
commit6fd564282ef622d3e1bf9f8a0689b008eeabf8c5
treef3d19d3d5539624a1093f8b2d77cff76f531197d
parent9628ef97dfa394d7f7a676b5738ae89aa0944f8e
staging: comedi: adv_pci1710: support external analog output reference

The analog outputs can use an external reference to create the D/A output
range. Add an entry to the comedi_lrange table for it and modify the
(*insn_write) to support it.

Note that the D/A output range is 0 to +Vref with a -Vref. The comedi_lrange
does not include the sign of the range. It simmply allows the user to convert
between the 12-bit samples values (0x0000 - 0x0fff) and a physical value (0.0
to 1.0) using the comedilib comedi_to_phys() and comedi_from_phys() functions.
A physical value of 0.0 would actually be 0V with a -Vref and -V with a +Vref
and 1.0 would be +V with a -Vref and 0V with a -Vref. Ths user will need to
work this out but at least they can now use the external reference.

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