]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: addi_apci_2032: use channel list
authorIan Abbott <abbotti@mev.co.uk>
Mon, 3 Dec 2012 18:15:45 +0000 (18:15 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jan 2013 22:10:02 +0000 (14:10 -0800)
commitccc0e89e8c7dc60e54ca9ea73c3bceb8e03cffb6
treeb823db8754d98a932d18a991145a6334a2cdac57
parent70dacd8204be8a6d94b61ef74c37e89978561d38
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>
drivers/staging/comedi/drivers/addi_apci_2032.c