]> git.karo-electronics.de Git - linux-beck.git/commit
staging: comedi: addi_apci_3120: remove unipolar range from analog outputs
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 20 Oct 2014 18:34:11 +0000 (11:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2014 07:58:35 +0000 (15:58 +0800)
commit12d984ed512aa20b46ba16abf3c4f64c6a893fe7
treedc8ce4869d6176b6cabdc5a870e98a6f330bb82b
parent99940229e58b98c30c7d570d36cd77ed9cf29d90
staging: comedi: addi_apci_3120: remove unipolar range from analog outputs

The analog outputs of the APCI-3120 have a 14-bit bipolar range and use straight
binary values (0x0000 = -10V to 0x3fff = +10V) to set the outputs. This driver
tries to fake a unipolar range by munging the comedi data values to only output
0V to +10V signals (0x0000 to 0x1fff values are munged to 0x2000 - 0x3fff).

This causes problems with the comedilib API functions that convert between comedi
values and physical values. It's also possible for the user to pass a data value
that would get munged and actually change the wrong channel.

Fix this by change the subdevice range_table to range_bipolar10 and remove the
munging in apci3120_ao_insn_write().

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/addi-data/hwdrv_apci3120.c
drivers/staging/comedi/drivers/addi_apci_3120.c