staging: comedi: ni_mio_common: make more bits in ao_cmd1 reg be stateful
Bits NISTC_AO_CMD1_DAC0_UPDATE_MODE and NISTC_AO_CMD1_DAC1_UPDATE_MODE are now saved in the local copy of the AO_CMD1 register. This is more appropriate than prior methods of setting these bits specifically _both_ in the ni_ao_cmd configuration function _and_ the ni_ao_inttrig trigger function. With this patch, the bits are only specifically called out now in the ni_ao_cmd configuration function. In the ni_ao_inttrig trigger function, only the UI_ARM, UC_ARM, BC_ARM bits of the ao_cmd1 register are specifically called out. Each of these bits is a strobe bit, while the DAC[0-1]_UPDATE_MODE bits are simple write bits. Signed-off-by: Spencer E. Olson <olsonse@umich.edu> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
5c93736c20
commit
d2a6c32a22
@ -2903,8 +2903,6 @@ static int ni_ao_inttrig(struct comedi_device *dev,
|
||||
ni_stc_writew(dev, NISTC_AO_CMD1_UI_ARM |
|
||||
NISTC_AO_CMD1_UC_ARM |
|
||||
NISTC_AO_CMD1_BC_ARM |
|
||||
NISTC_AO_CMD1_DAC1_UPDATE_MODE |
|
||||
NISTC_AO_CMD1_DAC0_UPDATE_MODE |
|
||||
devpriv->ao_cmd1,
|
||||
NISTC_AO_CMD1_REG);
|
||||
|
||||
@ -3081,9 +3079,11 @@ static int ni_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
|
||||
}
|
||||
ni_stc_writew(dev, devpriv->ao_mode1, NISTC_AO_MODE1_REG);
|
||||
|
||||
ni_stc_writew(dev, NISTC_AO_CMD1_DAC1_UPDATE_MODE |
|
||||
NISTC_AO_CMD1_DAC0_UPDATE_MODE,
|
||||
NISTC_AO_CMD1_REG);
|
||||
/* Configure DAQ-STC for Timed update mode */
|
||||
devpriv->ao_cmd1 |= NISTC_AO_CMD1_DAC1_UPDATE_MODE |
|
||||
NISTC_AO_CMD1_DAC0_UPDATE_MODE;
|
||||
/* We are not using UPDATE2-->don't have to set DACx_Source_Select */
|
||||
ni_stc_writew(dev, devpriv->ao_cmd1, NISTC_AO_CMD1_REG);
|
||||
|
||||
devpriv->ao_mode3 |= NISTC_AO_MODE3_STOP_ON_OVERRUN_ERR;
|
||||
ni_stc_writew(dev, devpriv->ao_mode3, NISTC_AO_MODE3_REG);
|
||||
|
Loading…
Reference in New Issue
Block a user