From: Frank Mori Hess Date: Fri, 12 Sep 2003 00:34:07 +0000 (+0000) Subject: clear/set adc enable bit during ai cmd setup, so that start triggers X-Git-Tag: r0_7_69~219 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e218018d97239839ad60250f3d2a979d9f46f8af;p=comedi.git clear/set adc enable bit during ai cmd setup, so that start triggers work --- diff --git a/comedi/drivers/cb_pcidas64.c b/comedi/drivers/cb_pcidas64.c index c78f23d1..8eec86a4 100644 --- a/comedi/drivers/cb_pcidas64.c +++ b/comedi/drivers/cb_pcidas64.c @@ -2116,14 +2116,14 @@ static void disable_ai_pacing( comedi_device *dev ) disable_ai_interrupts( dev ); - /* disable pacing, triggering, etc */ - writew( ADC_ENABLE_BIT | ADC_DMA_DISABLE_BIT | ADC_SOFT_GATE_BITS | ADC_GATE_LEVEL_BIT, - priv(dev)->main_iobase + ADC_CONTROL0_REG ); - comedi_spin_lock_irqsave( &dev->spinlock, flags ); priv(dev)->adc_control1_bits &= ~SW_GATE_BIT; writew( priv(dev)->adc_control1_bits, priv(dev)->main_iobase + ADC_CONTROL1_REG ); comedi_spin_unlock_irqrestore( &dev->spinlock, flags ); + + /* disable pacing, triggering, etc */ + writew( ADC_DMA_DISABLE_BIT | ADC_SOFT_GATE_BITS | ADC_GATE_LEVEL_BIT, + priv(dev)->main_iobase + ADC_CONTROL0_REG ); } static void disable_ai_interrupts( comedi_device *dev ) @@ -2376,6 +2376,11 @@ static int ai_cmd(comedi_device *dev,comedi_subdevice *s) disable_ai_pacing( dev ); + /* adc must be enabled or loading of channel queue becomes + * unreliable */ + writew( ADC_ENABLE_BIT | ADC_DMA_DISABLE_BIT | ADC_SOFT_GATE_BITS | + ADC_GATE_LEVEL_BIT, priv(dev)->main_iobase + ADC_CONTROL0_REG ); + // make sure internal calibration source is turned off writew(0, priv(dev)->main_iobase + CALIBRATION_REG);