]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: dt2814: Clear stale AI data before operation
authorIan Abbott <abbotti@mev.co.uk>
Mon, 1 Mar 2021 16:57:52 +0000 (16:57 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Mar 2021 08:25:31 +0000 (09:25 +0100)
commit27c0a89417c7f3aaa795734971478c35fccf7925
treef4c8f5c28f3fdb988ff41f598c29b7a17e604829
parentafa6c439d9cccec3ce6e8db9c3aa19ce7ed97986
staging: comedi: dt2814: Clear stale AI data before operation

When performing a Comedi read instruction or setting up an asynchronous
command on the AI subdevice, clear any stale data on the A/D registers
by waiting for the Status register's BUSY bit to clear (if set) and then
if the FINISH or ERR bit is set, reading the A/D Data register twice to
clear the stale data.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://lore.kernel.org/r/20210301165757.243065-2-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/dt2814.c