staging: comedi: addi_apci_1564: rewrite the timer subdevice support
The support functions for the timer subdevice are broken.
1) The (*insn_write) assumes that insn->n is always 2 (data[1] is used)
2) The (*insn_read) assumes that insn->n is always 2 (data can be returned in
data[0] and data[1]).
3) The (*insn_config) does not follow the API. It assumes insn->n is always 4
(data[1], data[2] and data[3] are used). It also doesn't use data[0] to
determine what the config "instruction" is.
Rewrite the code to follow the comedi API and add the missing comedi driver
comment block.
The new implementation is based on the (minimal) datasheet I have from
ADDI-DATA.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>