Commit 90f39b9f authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7a925496
...@@ -1132,8 +1132,7 @@ static int das1800_ao_insn_write(struct comedi_device *dev, ...@@ -1132,8 +1132,7 @@ static int das1800_ao_insn_write(struct comedi_device *dev,
unsigned short output; unsigned short output;
unsigned long irq_flags; unsigned long irq_flags;
/* card expects two's complement data */ output = comedi_offset_munge(s, data[0]);
output = data[0] - (1 << (board->resolution - 1));
/* if the write is to the 'update' channel, we need to remember its value */ /* if the write is to the 'update' channel, we need to remember its value */
if (chan == update_chan) if (chan == update_chan)
devpriv->ao_update_bits = output; devpriv->ao_update_bits = output;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment