Use new signal routing capability for all comedi command *_src == TRIG_EXT
options. This new interface allows the user specify signals and terminals
as TRIG_EXT sources using a very consistent naming convention. Furthermore,
the interface allows backwards compatibility to prior behavior of
specifying register-level (or near register-level) values as *_arg options
when *_src == TRIG_EXT.
Annotates and updates tables of register values to reflect this new
implementation status.
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>
Adds interface and associated unittests for accessing/looking-up/validating
the new ni routing table information.
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>
See README for a thorough discussion of this content.
Adds tables of all register values for routing various signals to various
terminals on National Instruments hardware. This information is directly
compared to and taken from register-level programming documentation and/or
register-level programming examples as provided by National Instruments.
Furthermore, this information was mostly compared (favorably) to the
register values already used in the comedi drivers for NI hardware.
Adds tables of valid routes for many devices. This information is not
consistent from device to device, nor entirely consistent within device
families. One additional major challenge is that this information does not
seem to be obtainable in any programmatic fashion, neither through the
proprietary NIDAQmx(-base) c-libraries, nor with register level
programming, _nor_ through any documentation. In fact, the only consistent
source of this information is through the proprietary NI-MAX software,
which currently only runs on Windows platforms. A further challenge is
that this information cannot be exported from NI-MAX, except by screenshot.
The collection and maintenance of this information is somewhat tedious and
requires frequent re-examination and comparison of NI-MAX and/or the
NI-MHDDK documentation (register programming information) and NI-MHDDK
examples. Tools are added with this patch to facilitate generating CSV
files from the data tables. These CSV files can be used with a spreadsheet
program to provide better visual comparision with screenshots gathered from
NI-MAX. Tools are also added to regenerate the data tables from CSV
content--this greatly enhances updating data tables with large changes
(such as when adding devices).
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>
Adds interface for configuring options that are global to all sub-devices.
For now, only options to configure device-globally identified signal routes
have been defined.
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>
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>
Adds a framework for unittests for comedi drivers. It was certainly
possible to write some unit tests before and test various aspects of a
particular driver, but this framework makes this a bit easier and hopefully
inspires more unittest modules to be written.
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>
Adds implementation of the new INSN_CONFIG_GET_CMD_TIMING_CONSTRAINTS
instruction.
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>
Adds implementation of the new INSN_CONFIG_GET_CMD_TIMING_CONSTRAINTS
instruction. This patch also adds data for this implementation, based on
spec sheets from NI.
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>
Adds implementation of the new INSN_CONFIG_GET_CMD_TIMING_CONSTRAINTS
instruction. This patch also adds data for digital subdevices that are
streaming capable (within the ni_mio_* family). Mostly, only the m-series
devices are capable of digital streaming.
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>
Adds facility to directly query the hardware speed limits of subdevices,
in particular for scan_begin and convert signals. This information can be
critical for integrating comedi with other hardware modules, and also
comedi modules together with software where software requires specific
timing capabilities in order to properly coordinate multiple devices.
Currently, comedi_command_test almost satisfies this need, but really only
for when *_src == TRIG_TIMER. For *_src == TRIG_EXT, comedi_command_test
does not help at all. For many subdevices, one might simply use
*_src==TRIG_TIMER in command_test in order to determine these limits. For
other subdevices, this tactic does not work since *_src == TRIG_TIMER might
not be valid. There is also the possibility that the timing limits are
different between the TRIG_TIMER and TRIG_EXT modes.
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>
Correct code to remote comparison with NULL, this clears the resulting
checkpatch issue.
This is a coding style change which should not impact runtime code
execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Correct the alignment of a function, this clears checkpatch issue.
This is a simple coding style change which should not impact runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the unnecessary line continuation character to clear checkpatch
issue.
This is a simple coding style change which should not impact runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add missing blank lines after declarations. This clears the resulting
checkpatch issue.
This is a simple coding style change which should not impact runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Rewrite code block to correct the indentation of code. This clears the
resulting checkpatch issue.
This is a coding style change which should not impact runtime code
execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add spaces around '+' operator to clear the checkpatch issue.
This is a coding style change which should have no impact on runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the extra blank lines to clear checkpatch issue.
This is a simple coding style change which should have no impact
on runtime code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Rewrite function call to clear the checkpatch issue with lines ending
with a '(' character.
This is a coding style change which should have no impact on runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove commented out #include directive.
Additionally shorted a block comment to clear the checkpatch issue
with line length.
These are coding style changes which should have no impact on runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add the missing SPDX-License-Identifier tag to file to clear the
checkpatch issue.
This is a coding style change which should have no impact on runtime
code execution.
Signed-off-by: John Whitmore <johnfwhitmore@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Previously, connection.h was only required for the definition of
VCHI_CONNECTION_T, but now all usages of it are gone. Remove this unused
header.
After connection.h is gone, message.h and vchi_cfg_internal.h are no
longer referenced by anything either. Drop them as well.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove two parameters which are never used and all where all callers
just pass in dummy values anyway.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
These types are not used anywhere, remove them.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
There is no definition for this unused function, so drop its prototype.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
These fields are only initialized with constants and never read. Drop
them.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The connection field of SERVICE_CREATION_T is assigned to but its value
is never read. Drop the field and the resulting no longer needed code
from bcm2835-audio and bcm2835-camera.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
These functions do nothing besides returning NULL and are unused.
Just drop them.
Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixes two problems introduced as early as
commit 03aef4b6dc ("Staging: comedi: add ni_mio_common code"):
(1) Ensures that the last four bits of NISTC_RTSI_TRIGB_OUT_REG register is
not unduly overwritten on e-series devices. On e-series devices, the
first three of the last four bits are reserved. The last bit defines
the output selection of the RGOUT0 pin, otherwise known as
RTSI_Sub_Selection. For m-series devices, these last four bits are
indeed used as the output selection of the RTSI7 pin (and the
RTSI_Sub_Selection bit for the RGOUT0 pin is moved to the
RTSI_Trig_Direction register.
(2) Allows all 4 RTSI_BRD lines to be treated as valid sources for RTSI
lines.
This patch also cleans up the ni_get_rtsi_routing command for readability.
Fixes: 03aef4b6dc ("Staging: comedi: add ni_mio_common code")
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>
Add spaces around '|', '>>' and '/' to follow kernel coding style.
Reported by checkpatch.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The variable AntCombination is initialized to 2 and never changed.
So the else if path is never used. Remove the dead code and the
variable AntCombination.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove spaces and/or replace tabs with spaces in some declarations
in rtw_mlme_ext.h.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The strings in the use of struct action_handler are constant.
Change the type of field str from 'char *' to 'const char *'.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The strings in the uses of struct mlme_handler are constant.
Change the type of field str from 'char *' to 'const char *'.
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change the type of MCS_rate_1R from unsigned char to const u8.
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Rewrite if tests to clear a 'line over 80 characters' and
'Comparisons should place the constant on the right side of the test'
checkpatch warning.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cleanup array declaration to clear two 'line over 80 characters'
checkpatch warnings and improve readability.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Line break array declaration to clear a 'line over 80 characters'
checkpatch warning. For consistency replace 0x0 with 0x00.
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add blank line after declaration.
Reported by checkpatch.
Signed-off-by: Jaakko Tyynismaa <jaakko.tyynismaa@hotmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Clang warns:
drivers/staging/emxx_udc/emxx_udc.c:1373:37: warning: variable
'device_desc' is not needed and will not be emitted
[-Wunneeded-internal-declaration]
static struct usb_device_descriptor device_desc = {
^
1 warning generated.
This definition hasn't been attached to anything since the driver was
introduced in commit 33aa8d45a4 ("staging: emxx_udc: Add Emma Mobile
USB Gadget driver") and neither GCC nor Clang emit any reference to the
variable in the final assembly. The only reason GCC doesn't warn about
this variable being unused is the sizeof function.
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Clang warns when multiple pairs of parentheses are used for a single
conditional statement.
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:3351:20: warning:
equality comparison with extraneous parentheses [-Wparentheses-equality]
The commented code is pointless since _HW_STATE_AP_ is handled right
below this block.
Link: https://github.com/ClangBuiltLinux/linux/issues/168
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes #if 0 code blocks and usages of
functions defined in the #if 0 blocks in dbg.h.
Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes #if 0 code blocks and usages of
functions defined in the #if 0 blocks in dbg.c
Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch removes #if 0 code blocks and usages of
functions defined in the #if 0 blocks in sd.c.
Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Clang warns when multiple pairs of parentheses are used for a single
conditional statement.
drivers/staging/rtlwifi/phydm/phydm_adc_sampling.c:558:33: warning:
equality comparison with extraneous parentheses [-Wparentheses-equality]
} else if ((is_enable_la_mode == 1)) {
~~~~~~~~~~~~~~~~~~^~~~
drivers/staging/rtlwifi/phydm/phydm_adc_sampling.c:558:33: note: remove
extraneous parentheses around the comparison to silence this warning
} else if ((is_enable_la_mode == 1)) {
~ ^ ~
drivers/staging/rtlwifi/phydm/phydm_adc_sampling.c:558:33: note: use '='
to turn this equality comparison into an assignment
} else if ((is_enable_la_mode == 1)) {
^~
=
1 warning generated.
Link: https://github.com/ClangBuiltLinux/linux/issues/172
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Access current function name using __func__.
Use %s and __func__ instead of function name.
Use of predefined identifier __func__ prevents typo error in function
name in print calls.
Issue found with checkpatch.pl
Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove space after cast to fix checkpatch issue.
CHECK: No space is necessary after a cast
Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
Reviewed-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Add blank line after function/struct/union/enum declarations to fix
checkpatch issue.
CHECK: Please use a blank line after function/struct/union/enum
declarations
Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
Reviewed-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Replace all occurrences of (1<<x) with BIT(x).
Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>