From 5962b84a08e1561545f2b8a0164e209fffd0e2ec Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Wed, 25 Oct 2006 15:33:06 +0000 Subject: [PATCH] Only try to initialize pfi output select registers if it's an m-series board. Initialize pfi do register. --- comedi/drivers/ni_mio_common.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 3ab9b050..4003c982 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -3227,6 +3227,12 @@ static int ni_E_init(comedi_device *dev,comedi_devconfig *it) if(boardtype.reg_type == ni_reg_m_series) { s->n_chan = 16; + ni_writew(s->state, M_Offset_PFI_DO); + unsigned i; + for(i = 0; i < NUM_PFI_OUTPUT_SELECT_REGS; ++i) + { + ni_writew(devpriv->pfi_output_select_reg[i], M_Offset_PFI_Output_Select(i + 1)); + } }else { s->n_chan = 10; @@ -3235,11 +3241,7 @@ static int ni_E_init(comedi_device *dev,comedi_devconfig *it) s->insn_bits = ni_pfi_insn_bits; s->insn_config = ni_pfi_insn_config; ni_set_bits(dev, IO_Bidirection_Pin_Register, ~0, 0); - unsigned i; - for(i = 0; i < NUM_PFI_OUTPUT_SELECT_REGS; ++i) - { - ni_writew(devpriv->pfi_output_select_reg[i], M_Offset_PFI_Output_Select(i + 1)); - } + /* cs5529 calibration adc */ s = dev->subdevices + 8; if(boardtype.reg_type & ni_reg_67xx_mask) -- 2.26.2