From: H Hartley Sweeten Date: Fri, 5 Sep 2014 16:25:36 +0000 (-0700) Subject: staging: comedi: adl_pci9118: don't reset digital outputs X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=304e2be17e9f1675516e90a7e38cc40769567d4b;p=deliverable%2Flinux.git staging: comedi: adl_pci9118: don't reset digital outputs Currently this driver resets the digital output channels to a low state when the driver is attached and detached. Since the digital output state can be read, initialize the subdevice state when the driver is attached and don't reset them. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c index a9fd34306676..c758a467aad4 100644 --- a/drivers/staging/comedi/drivers/adl_pci9118.c +++ b/drivers/staging/comedi/drivers/adl_pci9118.c @@ -1706,7 +1706,6 @@ static int pci9118_reset(struct comedi_device *dev) outl(devpriv->ao_data[0], dev->iobase + PCI9118_AO_REG(0)); outl(devpriv->ao_data[1], dev->iobase + PCI9118_AO_REG(1)); - outl(0, dev->iobase + PCI9118_DIO_REG); /* reset digi outs to L */ udelay(10); inl(dev->iobase + PCI9118_AI_FIFO_REG); pci9118_ai_reset_fifo(dev); @@ -1907,6 +1906,9 @@ static int pci9118_common_attach(struct comedi_device *dev, int disable_irq, s->range_table = &range_digital; s->insn_bits = pci9118_do_insn_bits; + /* get the current state of the digital outputs */ + s->state = inl(dev->iobase + PCI9118_DIO_REG) >> 4; + devpriv->ai_maskharderr = 0x10a; /* default measure crash condition */ if (hw_err_mask) /* disable some requested */