staging: comedi: add abstracted NI signal/terminal named constants
authorSpencer E. Olson <olsonse@umich.edu>
Wed, 3 Oct 2018 20:56:01 +0000 (14:56 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Oct 2018 13:32:07 +0000 (15:32 +0200)
commit5912827dfe78a0befae8a5e44f419eaf3deced72
tree9bb4ea5d0ad70a042b43eb96fce6fc56eb95d2ea
parent040e9e4dfa14de632824b9368462c1bd20d05733
staging: comedi: add abstracted NI signal/terminal named constants

This change adds abstracted constants for National Instruments
terminal/signal names.

Some background:
  There have been significant confusions over the past many years for users
  when trying to understand how to connect to/from signals and terminals on
  NI hardware using comedi.  The major reason for this is that the actual
  register values were exposed and required to be used by users.  Several
  major reasons exist why this caused major confusion for users:

  1) The register values are _NOT_ in user documentation, but rather in
    arcane locations, such as a few register programming manuals that are
    increasingly hard to find and the NI-MHDDK (comments in in example
    code).  There is no one place to find the various valid values of the
    registers.

  2) The register values are _NOT_ completely consistent.  There is no way
    to gain any sense of intuition of which values, or even enums one
    should use for various registers.  There was some attempt in prior use
    of comedi to name enums such that a user might know which enums should
    be used for varying purposes, but the end-user had to gain a knowledge
    of register values to correctly wield this approach.

  3) The names for signals and registers found in the various register
    level programming manuals and vendor-provided documentation are _not_
    even close to the same names that are in the end-user documentation.

Similar confusion, albeit less, plagued NI's previous version of their own
proprietary drivers.  Earlier than 2003, NI greatly simplified the
situation for users by releasing a new API that abstracted the names of
signals/terminals to a common and intuitive set of names.  In addition,
this new API provided a much more common interface to use for most of NI
hardware.

The names added here mirror the names chosen and well documented by NI.
These names are exposed to the user via the comedilib user library.  By
keeping the names in this format, in spite of the use of CamelScript,
maintenance will be greatly eased and confusion for users _and_ comedi
developers will be greatly reduced.

Signed-off-by: Spencer E. Olson <olsonse@umich.edu>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/comedi.h