staging: comedi: addi_apci_2032: use channel list
When setting up asynchronous commands for the special interrupt subdevice, use the channel list to decide which interrupt sources to enable. Set the maximum length of the channel list to be the same as the number of channels (2). Normally, the channel list would include channel 0, channel 1 or both. When reading the scan data in the interrupt routine, the readings from each channel in the channel list will be packed into a single unsigned short data value. Make each bit in this value correspond to an index in the channel list. Since all the channels in the channel list are read at the same time, insist that the scan end argument is the length of the channel list and that the conversion source is `TRIG_NOW`. Allocate some private data for the special interrupt subdevice to hold a spin-lock, the channels to be enabled and an indication of whether the command is still active. Stop the command if a buffer overflow occurs. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing
Please register or sign in to comment