[PATCH 00/53] staging: comedi: addi_apci_3xxx: cleanup driver
Ian Abbott
abbotti at mev.co.uk
Thu Jun 27 13:10:27 UTC 2013
[Originally posted 2013-06-17. Reposting to new driverdev-devel list.]
On 2013-06-13 00:03, H Hartley Sweeten wrote:
> Separate this driver from the addi-data "common" code so the bloat
> can be removed.
>
> Cleanup all the subdevice support functions and fix the analog input
> subdevice so it works correctly with the comedi core.
>
> Remove all the cruft.
Looks good. The only thing I'd maybe do is add a check that the channel
number is valid in differential (AREF_DIFF) mode. Some boards allow all
AI channels to be used in differential mode and others only allow the
first half of the channels. (These cases are distinguishable from the
subdevice flags.) A function could be added to check the 'aref' code
and channel number encoded in the 'chanspec' value are valid. This
could be called from apci3xxx_ai_setup() and from apci3xxx_ai_cmdtest()
if cmd->chanlist is non-NULL (cmd->chanlist is allowed to be NULL for
the COMEDI_CMDTEST ioctl). (Presumably the hardware would still read
*something* in differential mode for the invalid channels, and maybe the
user of the hardware should be aware of the limitation, but it seems
better to return an error.)
Reviewed-by: Ian Abbott <abbotti at mev.co.uk>
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti at mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
More information about the devel
mailing list