staging: comedi: pcl726: tidy up pcl726_ao_insn()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 25 Sep 2013 22:35:50 +0000 (15:35 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Sep 2013 16:32:18 +0000 (09:32 -0700)
commit1821e389ab651c63bc0d9370780be81c19a7c90c
treebd7c50f192b45b77431fae777da180ae1068e29f
parentb4f58e1f68ae9192d6c3a7dffa09ac2f2ec41fe0
staging: comedi: pcl726: tidy up pcl726_ao_insn()

For aesthetics, rename the function to help with greps.

The offset binary value from the core should be saved for read back.
Move the saving of the value in the private data so it occurs before
the value is possibly munged for bipolar outputs.

Use the comedi_offset_munge() helper to munge the offset binary value
to two's complement for bipolar outputs.

According to the November 2011 users manual, the write order must be
MSB them LSB. Update the comment.

Modify the register map defines to handle the channel offset calculation.

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