]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: dmm32at: introduce dmm32_ai_get_sample()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 11 Nov 2014 23:55:19 +0000 (16:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Nov 2014 23:33:23 +0000 (15:33 -0800)
commit6fde75f38e2f4d39d02ff964e20c7e4578ca6b6f
tree4a38ce58e7940271e301c6ee3b5298650e716b28
parent27661c1b36c938f5e495dd2f298ba36a8c87ece0
staging: comedi: dmm32at: introduce dmm32_ai_get_sample()

Introduce a helper function to read the two's complement analog input
sample from the hardware and munge it to the offset binary (unsigned)
format that comedi expects. Use the comedi_offset_munge() helper to
munge the data.

Use the new helper in the analog input (*insn_read) and in the interrupt
handler for the async command.

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