Re: driver w/o interrupt

So, perhaps the recommended practice for PCI cards is to not assign the 
ai_cmdtest and ai_cmd functions is the subdevice structure.  I have 
written my ai_rinsn, etc. to do polling (no interrupts required) so it 
sounds like it will work fine.

Bob

Nils Juergens wrote:

> The thing to keep in mind here is that with most drivers you loose command
> support without interrupts. So you don't have to implement command support to
> work without interrupts. But the insn-stuff should work without interrupts.
> 
> As an (isa-bases and thus easy to understand) example take a look at pcl818.c
> pcl818_ai_insn_read()
> 
> [snip]
> 1		/* clear INT (conversion end) flag */
> 2        	outb(0, dev->iobase+PCL818_CLRINT);
> 3
> 4		/* start conversion */
> 5		outb(0, dev->iobase+PCL818_AD_LO);
> 6
> 7        	timeout=100;
> 8        	while (timeout--) {
> 9			if (inb(dev->iobase + PCL818_STATUS) & 0x10)
> 10				goto conv_finish;
> 11			comedi_udelay(1);
> 12        	}
> 13        	comedi_error(dev,"A/D insn timeout");
> 14		/* clear INT (conversion end) flag */
> 15        	outb(0, dev->iobase+PCL818_CLRINT);
> 16        	return -EIO;
> [snip]
> 
> So basically the driver tells the DAC to start a conversion (line 5)
> And then it does an idle loop (lines 7-12) (with timeout) checking the INT
> flag (line 9) (which indicates an converstion event has completed). The flag
> is cleared before and after usage (lines 2 and 15).
> 
> hth,
> Nils
> 
> 
> _______________________________________________
> comedi mailing list
> comedi_at_comedi.org
> https://cvs.comedi.org/cgi-bin/mailman/listinfo/comedi

Received on 2004-06-28Z15:00:13