summaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/comedi_fops.c
diff options
context:
space:
mode:
authorSpencer E. Olson2018-09-19 18:51:03 +0200
committerGreg Kroah-Hartman2018-10-09 15:27:47 +0200
commit832f33366c771855951313a9bab4926f2a0d37a1 (patch)
treea19bafeeef43d6dc0f5ef8ed3d52a7486531d5af /drivers/staging/comedi/comedi_fops.c
parentstaging:rtl8192u: Correct comparison with NULL - Style (diff)
downloadkernel-qcow2-linux-832f33366c771855951313a9bab4926f2a0d37a1.tar.gz
kernel-qcow2-linux-832f33366c771855951313a9bab4926f2a0d37a1.tar.xz
kernel-qcow2-linux-832f33366c771855951313a9bab4926f2a0d37a1.zip
staging: comedi: add facility to directly query subdevice timing constraints
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>
Diffstat (limited to 'drivers/staging/comedi/comedi_fops.c')
-rw-r--r--drivers/staging/comedi/comedi_fops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index e18b61cdbdeb..548baa790507 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -1216,6 +1216,10 @@ static int check_insn_config_length(struct comedi_insn *insn,
if (insn->n == 6)
return 0;
break;
+ case INSN_CONFIG_GET_CMD_TIMING_CONSTRAINTS:
+ if (insn->n >= 4)
+ return 0;
+ break;
/*
* by default we allow the insn since we don't have checks for
* all possible cases yet