mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
staging: comedi: das1800: use comedi_offset_munge() for analog output
The analog outputs expect 2's complement data. For aesthetics, use the helper function to handle the munging instead of depending on the boardinfo 'resolution'. 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>
This commit is contained in:
parent
7a9254962b
commit
90f39b9f99
1 changed files with 1 additions and 2 deletions
|
|
@ -1132,8 +1132,7 @@ static int das1800_ao_insn_write(struct comedi_device *dev,
|
|||
unsigned short output;
|
||||
unsigned long irq_flags;
|
||||
|
||||
/* card expects two's complement data */
|
||||
output = data[0] - (1 << (board->resolution - 1));
|
||||
output = comedi_offset_munge(s, data[0]);
|
||||
/* if the write is to the 'update' channel, we need to remember its value */
|
||||
if (chan == update_chan)
|
||||
devpriv->ao_update_bits = output;
|
||||
|
|
|
|||
Loading…
Reference in a new issue