staging: comedi: addi_apci_1564: rewrite the timer subdevice support
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 8 Jun 2016 18:26:41 +0000 (11:26 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Jun 2016 04:02:56 +0000 (21:02 -0700)
commit05704ffafaea7b5176b4469d48487c86cba4861b
tree5b1bfcac6c6307957b109fae46800ae2aadcefee
parenta23b85a5ab9f19936ac673104f0e5b57a7ab13a1
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>
drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c
drivers/staging/comedi/drivers/addi_apci_1564.c