[PATCH 3.10 25/40] staging: comedi: ni_daq_700: add mux settling delay

Greg Kroah-Hartman
2014-06-09T22:48:56Z

From: Ian Abbott <abbotti@mev.co.uk>

commit ffed54dced86723f352323f15789d9ad6bee25e1 upstream.

I got a patch from the original author, Fred Brooks, to add a small
settling delay after setting the AI channel multiplexor. The lack of
delay resulted in unstable or scrambled data on faster processors.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reported-by: Fred Brooks <nsaspook@nsaspook.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
drivers/staging/comedi/drivers/ni_daq_700.c | 2 ++
1 file changed, 2 insertions(+)

--- a/drivers/staging/comedi/drivers/ni_daq_700.c
+++ b/drivers/staging/comedi/drivers/ni_daq_700.c
@@ -127,6 +127,8 @@ static int daq700_ai_rinsn(struct comedi
/* write channel to multiplexer */
/* set mask scan bit high to disable scanning */
outb(chan | 0x80, dev->iobase + CMD_R1);
+ /* mux needs 2us to really settle [Fred Brooks]. */
+ udelay(2);

/* convert n samples */
for (n = 0; n < insn->n; n++) {