This sequence of patches change the addi_apci_2032 driver's special interrupt subdevice (which appears to the application as a digital input subdevice) to behave similarly to that of the amplc_dio200 driver. The subdevice supports two interrupt sources whose status can be read, so make it a two-channel, digital input subdevice. When setting up the asynchronous command to handle interrupts, use the command's channel list to determine which interrupt sources to enable. When a valid interrupt occurs, all (both) channels are read at the same time. The channel list has limited length and the channels are only 1 bit wide channel is 1 bit wide so pack the data read for the whole channel list into a single unsigned short value where bit 0 is for the channel at index 0 of the channel list, etc. Make the insn_bits handler read the live interrupt source status register to make it independent of the asynchronous command handler. I don't think the interrupt source status register value it reads depends on the interrupt control register value written (as there is also an overall interrupt status in a different register), but this should be checked. Make sure the hardware is in a suitable state before the interrupt handler is registered and do some sanity checking in the interrupt handler to make sure the private device data has been fully initialized. 2) staging: comedi: addi_apci_2032: correct interrupt subdevice 3) staging: comedi: addi_apci_2032: set COMEDI_CB_OVERFLOW 4) staging: comedi: addi_apci_2032: make insn_bits read live data 5) staging: comedi: addi_apci_2032: only disable triggered interrupts 6) staging: comedi: addi_apci_2032: use channel list 7) staging: comedi: addi_apci_2032: always initialize interrupt subdevice 8) staging: comedi: addi_apci_2032: support stop_src == TRIG_COUNT drivers/staging/comedi/drivers/addi_apci_2032.c | 172 +++++++++++++++++++----- 1 file changed, 141 insertions(+), 31 deletions(-) _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel