OSDN Git Service

staging: comedi: dt282x: convert 'dabits' boardinfo to 'ao_maxdata'
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 20 Jun 2014 20:12:38 +0000 (13:12 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2014 00:08:18 +0000 (20:08 -0400)
commit58c8c47fda4aa37ec946ff7ad1a42b875b03da74
treef52f457403e12690954f8ca67f2afafa35dd2dc5
parentd839495b64d0ec599e1d2cc74ce3705043c2dae4
staging: comedi: dt282x: convert 'dabits' boardinfo to 'ao_maxdata'

This member of the boardinfo is the number of bits in the analog output data.
Convert this member into the subdevice 'maxdata', (1 << board->dabits) - 1,
to avoid needing to do the calculation.

Use the subdevice 'maxdata' in the driver instead of using the boardinfo and
use the comedi_offset_munge() helper to convert the two's complement data to
the offset binary form that the comedi core expects.

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