From 9e06f290038efef973b4f41dcfac10e3f0223ea0 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Thu, 25 Oct 2001 22:11:19 +0000 Subject: [PATCH] fixed a bunch of insn_bits functions --- comedi/drivers/adl_pci9118.c | 2 +- comedi/drivers/adv_pci1710.c | 2 +- comedi/drivers/das1800.c | 7 ------- comedi/drivers/dt2811.c | 4 +++- comedi/drivers/multiq3.c | 2 ++ comedi/drivers/pcl726.c | 4 +++- comedi/drivers/pcl818.c | 4 +++- comedi/drivers/rti800.c | 2 ++ comedi/drivers/skel.c | 10 +++++++--- 9 files changed, 22 insertions(+), 15 deletions(-) diff --git a/comedi/drivers/adl_pci9118.c b/comedi/drivers/adl_pci9118.c index cf644ab3..e5e7dce5 100644 --- a/comedi/drivers/adl_pci9118.c +++ b/comedi/drivers/adl_pci9118.c @@ -773,7 +773,7 @@ int pci9118_insn_bits_do(comedi_device *dev,comedi_subdevice *s, comedi_insn *in s->state |= (data[0]&data[1]); outl(s->state & 0x0f, dev->iobase + PCI9118_DO); } - data[1] = inl(dev->iobase + PCI9118_DI) & 0x0f; + data[1] = s->state; return 2; } diff --git a/comedi/drivers/adv_pci1710.c b/comedi/drivers/adv_pci1710.c index e6e92a5f..de8170f1 100644 --- a/comedi/drivers/adv_pci1710.c +++ b/comedi/drivers/adv_pci1710.c @@ -431,7 +431,7 @@ int pci171x_insn_bits_do(comedi_device *dev,comedi_subdevice *s, comedi_insn *in s->state |= (data[0]&data[1]); outw(s->state, dev->iobase + PCI171x_DO); } - data[1] = inw(dev->iobase + PCI171x_DI); + data[1] = s->state; return 2; } diff --git a/comedi/drivers/das1800.c b/comedi/drivers/das1800.c index a3ac1e19..a19f897e 100644 --- a/comedi/drivers/das1800.c +++ b/comedi/drivers/das1800.c @@ -1236,13 +1236,6 @@ static int das1800_ai_do_cmdtest(comedi_device *dev,comedi_subdevice *s,comedi_c switch(cmd->stop_src) { - case TRIG_EXT: - if(cmd->stop_arg) - { - cmd->stop_arg = 0; - err++; - } - break; case TRIG_COUNT: if(!cmd->stop_arg) { diff --git a/comedi/drivers/dt2811.c b/comedi/drivers/dt2811.c index ff40026d..e5b9138f 100644 --- a/comedi/drivers/dt2811.c +++ b/comedi/drivers/dt2811.c @@ -560,9 +560,11 @@ static int dt2811_do_insn_bits(comedi_device *dev,comedi_subdevice *s, if(insn->n!=2)return -EINVAL; s->state &= ~data[0]; - s->state |= data[1]; + s->state |= data[0] & data[1]; outb(s->state, dev->iobase + DT2811_DIO); + data[1] = s->state; + return 2; } diff --git a/comedi/drivers/multiq3.c b/comedi/drivers/multiq3.c index 366f43b5..48dff42b 100644 --- a/comedi/drivers/multiq3.c +++ b/comedi/drivers/multiq3.c @@ -191,6 +191,8 @@ static int multiq3_do_insn_bits(comedi_device *dev, comedi_subdevice *s, s->state |= (data[0]&data[1]); outw(s->state, dev->iobase + MULTIQ3_DIGOUT_PORT); + data[1] = s->state; + return 2; } diff --git a/comedi/drivers/pcl726.c b/comedi/drivers/pcl726.c index 09b4fd24..5fb0a054 100644 --- a/comedi/drivers/pcl726.c +++ b/comedi/drivers/pcl726.c @@ -243,7 +243,9 @@ static int pcl726_do_insn_bits(comedi_device *dev,comedi_subdevice *s, outb(s->state&0xff,dev->iobase+this_board->do_lo); if(data[1]&0xff00) outb((s->state>>8),dev->iobase+this_board->do_hi); - + + data[1] = s->state; + return 2; } diff --git a/comedi/drivers/pcl818.c b/comedi/drivers/pcl818.c index 164b2920..6a0f31c0 100644 --- a/comedi/drivers/pcl818.c +++ b/comedi/drivers/pcl818.c @@ -476,10 +476,12 @@ static int pcl818_do_insn_bits(comedi_device *dev, comedi_subdevice *s, outb(s->state & 0xff, dev->iobase + PCL818_DO_LO); outb((s->state >> 8), dev->iobase + PCL818_DO_HI); + data[1] = s->state; + return 2; } -/* +/* ============================================================================== analog input interrupt mode 1 & 3, 818 cards one sample per interrupt version diff --git a/comedi/drivers/rti800.c b/comedi/drivers/rti800.c index 159c7bda..38f681d7 100644 --- a/comedi/drivers/rti800.c +++ b/comedi/drivers/rti800.c @@ -276,6 +276,8 @@ static int rti800_do_insn_bits(comedi_device *dev,comedi_subdevice *s, outb(s->state ^ 0xff, dev->iobase + RTI800_DO); } + data[1] = s->state; + return 2; } diff --git a/comedi/drivers/skel.c b/comedi/drivers/skel.c index 24ce509f..2751470a 100644 --- a/comedi/drivers/skel.c +++ b/comedi/drivers/skel.c @@ -513,9 +513,13 @@ static int skel_dio_insn_bits(comedi_device *dev,comedi_subdevice *s, /* Write out the new digital output lines */ //outw(s->state,dev->iobase + SKEL_DIO); } + /* on return, data[1] contains the value of the digital - * input lines. */ + * input and output lines. */ //data[1]=inw(dev->iobase + SKEL_DIO); + /* or we could just return the software copy of the output values if + * it was a purely digital output subdevice */ + //data[1]=s->state; return 2; } @@ -529,9 +533,9 @@ static int skel_dio_insn_config(comedi_device *dev,comedi_subdevice *s, /* The input or output configuration of each digital line is * configured by a special insn_config instruction. chanspec - * contains the channel to be changed, and data[0] contains the + * contains the channel to be changed, and data[0] contains the * value COMEDI_INPUT or COMEDI_OUTPUT. */ - + if(data[0]==COMEDI_OUTPUT){ s->io_bits |= 1<