]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: adq12b: fix ctreg (ai channel/range) programming
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 28 May 2014 23:34:47 +0000 (16:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jun 2014 21:34:44 +0000 (14:34 -0700)
commit3b38a494273bf85e2fe5d0c81a59b2bf3f234add
tree786d8130103b95f1e659bbf7c678b00e2c99a037
parent281d86f359ebccd9e56c594ed9941554f76e094f
staging: comedi: adq12b: fix ctreg (ai channel/range) programming

This driver only updates the ctreg (ai channel/range) register if the
desired channel or range has changed since the last analog input read
operation. It does this becuase the hardware requires an udelay to
allow the multiplexor to settle. Unfortunatly the current code never
updates the 'last_channel' and 'last_range' in the private data so
the ctreg gets updated every time.

Fix this and simplify it a bit by just storing the last ctreg value
in the private data.

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