staging: comedi: me4000: clear the ME4000_AI_CTRL_REG in me4000_reset()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 5 Aug 2015 17:45:13 +0000 (10:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Aug 2015 22:03:30 +0000 (15:03 -0700)
Reset the analog input control register after ensuring that any active
conversions have been stopped. This mimics what the ai subdevice (*cancel)
does.

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

index b3d871b2b6a1958efb161f50e95ddf0f336e773a..3d4a9c841192bf547fe25bc8c5885c9a44458027 100644 (file)
@@ -414,6 +414,9 @@ static void me4000_reset(struct comedi_device *dev)
        outl(ME4000_AI_CTRL_IMMEDIATE_STOP | ME4000_AI_CTRL_STOP,
             dev->iobase + ME4000_AI_CTRL_REG);
 
+       /* Clear the analog input control register */
+       outl(0x0, dev->iobase + ME4000_AI_CTRL_REG);
+
        /* Set both stop bits in the analog output control register */
        val = ME4000_AO_CTRL_IMMEDIATE_STOP | ME4000_AO_CTRL_STOP;
        for (chan = 0; chan < 4; chan++)