staging: comedi: addi_apci_3120: remove analog output reset
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 20 Oct 2014 18:34:19 +0000 (11:34 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2014 07:58:36 +0000 (15:58 +0800)
The apci3120_reset() function is called at the end of the (*auto_attach) and
with the (*detach) is called to unload the driver. Part of this function
resets all the analog output channels to 0V.

There are two problems with this.
1) Only the APCI-3120 has analog outputs, the APCI-3001 does not.
2) The DA_READY bit in the status register needs to be checked before each
   write to update the analog outputs. It's unknown what the DA_READY bit
   does on the APCI-3001 board.

Just remove the analog output reset to avoid any problems.

Also, remove the unnecessary udelay() in apci3120_reset().

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/addi-data/hwdrv_apci3120.c

index b6c11fed957c4ca3402669719075c2d6a7ea7ae2..fbe17917cea1c274e386485de74495aacd869364 100644 (file)
@@ -40,8 +40,6 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
   +----------+-----------+------------------------------------------------+
 */
 
-#include <linux/delay.h>
-
 /*
  * ADDON RELATED ADDITIONS
  */
@@ -578,22 +576,6 @@ static int apci3120_reset(struct comedi_device *dev)
        devpriv->us_OutputRegister = 0;
        outw(devpriv->us_OutputRegister, dev->iobase + APCI3120_WR_ADDRESS);
 
-       /*
-        * Code to set the all anolog o/p channel to 0v 8191 is decimal
-        * value for zero(0 v)volt in bipolar mode(default)
-        */
-       outw(8191 | APCI3120_ANALOG_OP_CHANNEL_1, dev->iobase + APCI3120_ANALOG_OUTPUT_1);      /* channel 1 */
-       outw(8191 | APCI3120_ANALOG_OP_CHANNEL_2, dev->iobase + APCI3120_ANALOG_OUTPUT_1);      /* channel 2 */
-       outw(8191 | APCI3120_ANALOG_OP_CHANNEL_3, dev->iobase + APCI3120_ANALOG_OUTPUT_1);      /* channel 3 */
-       outw(8191 | APCI3120_ANALOG_OP_CHANNEL_4, dev->iobase + APCI3120_ANALOG_OUTPUT_1);      /* channel 4 */
-
-       outw(8191 | APCI3120_ANALOG_OP_CHANNEL_5, dev->iobase + APCI3120_ANALOG_OUTPUT_2);      /* channel 5 */
-       outw(8191 | APCI3120_ANALOG_OP_CHANNEL_6, dev->iobase + APCI3120_ANALOG_OUTPUT_2);      /* channel 6 */
-       outw(8191 | APCI3120_ANALOG_OP_CHANNEL_7, dev->iobase + APCI3120_ANALOG_OUTPUT_2);      /* channel 7 */
-       outw(8191 | APCI3120_ANALOG_OP_CHANNEL_8, dev->iobase + APCI3120_ANALOG_OUTPUT_2);      /* channel 8 */
-
-       udelay(10);
-
        inw(dev->iobase + 0);   /* make a dummy read */
        inb(dev->iobase + APCI3120_RESET_FIFO); /*  flush FIFO */
        inw(dev->iobase + APCI3120_RD_STATUS);  /*  flush A/D status register */
This page took 0.044276 seconds and 5 git commands to generate.