From 9e42b0e801a6b62b612e4bd5dab28477035bb419 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Sun, 26 Jun 2005 17:53:37 +0000 Subject: [PATCH] some tweaks to try and support ao commands on pci boards without ao fifos. --- comedi/drivers/ni_mio_common.c | 10 ++++++++-- comedi/drivers/ni_stc.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 502eaba0..56d7f074 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -2248,6 +2248,8 @@ static int ni_ao_cmd(comedi_device *dev,comedi_subdevice *s) AO_TMRDACWR_Pulse_Width; if( boardtype.ao_fifo_depth ) bits |= AO_FIFO_Enable; + else + bits |= AO_DMA_PIO_Control; win_out(bits, AO_Personal_Register); // enable sending of ao dma requests win_out(AO_AOFREQ_Enable, AO_Start_Select_Register); @@ -2373,7 +2375,7 @@ static int ni_ao_reset(comedi_device *dev,comedi_subdevice *s) win_out(AO_Configuration_Start,Joint_Reset_Register); win_out(AO_Disarm,AO_Command_1_Register); ni_set_bits(dev,Interrupt_B_Enable_Register,~0,0); - win_out(0x0010,AO_Personal_Register); + win_out(AO_BC_Source_Select, AO_Personal_Register); win_out(0x3f98,Interrupt_B_Ack_Register); win_out(AO_BC_Source_Select | AO_UPDATE_Pulse_Width | AO_TMRDACWR_Pulse_Width, AO_Personal_Register); @@ -2720,7 +2722,11 @@ static int ni_E_init(comedi_device *dev,comedi_devconfig *it) }else{ s->insn_write=ni_ao_insn_write; } - if(boardtype.ao_fifo_depth){ +#ifdef PCIDMA + if(boardtype.n_aochan){ +#else + if(boardtype.ao_fifo_depth){ +#endif s->do_cmd=ni_ao_cmd; s->do_cmdtest=ni_ao_cmdtest; s->len_chanlist = boardtype.n_aochan; diff --git a/comedi/drivers/ni_stc.h b/comedi/drivers/ni_stc.h index 8952dd05..aca5c49c 100644 --- a/comedi/drivers/ni_stc.h +++ b/comedi/drivers/ni_stc.h @@ -422,6 +422,7 @@ enum AO_Personal_Bits { AO_BC_Source_Select = 1 << 4, AO_UPDATE_Pulse_Width = 1 << 5, + AO_DMA_PIO_Control = 1 << 8, AO_AOFREQ_Polarity = 1 << 9, AO_FIFO_Enable = 1 << 10, AO_TMRDACWR_Pulse_Width = 1 << 12, -- 2.26.2