]> 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)
commitb4acfa8a6e07dfd680d3d159836616708dd80e5f
treef4c8f5c28f3fdb988ff41f598c29b7a17e604829
parentee9a0ad0b260495fb423d3d91f624b77a590a396
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