summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2012-11-14 11:22:55 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-15 00:25:08 (GMT)
commit206cb10816d3b1ee38761b387106973df52c4315 (patch)
tree68857d46b1c586b2b9ef0806472ff831ce1ddeb0 /drivers/staging/comedi
parentb0a2b6d8ac9ce5d27c9086a196d8f44194561979 (diff)
downloadlinux-fsl-qoriq-206cb10816d3b1ee38761b387106973df52c4315.tar.xz
staging: comedi: define operations for INSN_CONFIG_DIGITAL_TRIG
The 'addi_apci_1032' driver recently started supporting the `INSN_CONFIG_DIGITAL_TRIG` configuration instruction, but as no other drivers were using it before, there was no existing practice of how the instruction should look. Define the format to be something a bit more configurable. In particular, a subdevice might have more than one trigger requiring an ID and/or `COMEDI_EV_...` flags to disambiguate them, a trigger might have more than 32 inputs, and a trigger might need several `INSN_CONFIG_DIGITAL_TRIG` configuration instructions to configure completely (if there are more than 32 inputs or if it uses a combination of edge-triggered and level-triggered inputs). Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/comedi.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/staging/comedi/comedi.h b/drivers/staging/comedi/comedi.h
index 3cbd2cd..c8a8ca1 100644
--- a/drivers/staging/comedi/comedi.h
+++ b/drivers/staging/comedi/comedi.h
@@ -283,6 +283,44 @@ enum configuration_ids {
INSN_CONFIG_PWM_GET_H_BRIDGE = 5004
};
+/*
+ * Settings for INSN_CONFIG_DIGITAL_TRIG:
+ * data[0] = INSN_CONFIG_DIGITAL_TRIG
+ * data[1] = trigger ID
+ * data[2] = configuration operation
+ * data[3] = configuration parameter 1
+ * data[4] = configuration parameter 2
+ * data[5] = configuration parameter 3
+ *
+ * operation parameter 1 parameter 2 parameter 3
+ * --------------------------------- ----------- ----------- -----------
+ * COMEDI_DIGITAL_TRIG_DISABLE
+ * COMEDI_DIGITAL_TRIG_ENABLE_EDGES left-shift rising-edges falling-edges
+ * COMEDI_DIGITAL_TRIG_ENABLE_LEVELS left-shift high-levels low-levels
+ *
+ * COMEDI_DIGITAL_TRIG_DISABLE returns the trigger to its default, inactive,
+ * unconfigured state.
+ *
+ * COMEDI_DIGITAL_TRIG_ENABLE_EDGES sets the rising and/or falling edge inputs
+ * that each can fire the trigger.
+ *
+ * COMEDI_DIGITAL_TRIG_ENABLE_LEVELS sets a combination of high and/or low
+ * level inputs that can fire the trigger.
+ *
+ * "left-shift" is useful if the trigger has more than 32 inputs to specify the
+ * first input for this configuration.
+ *
+ * Some sequences of INSN_CONFIG_DIGITAL_TRIG instructions may have a (partly)
+ * accumulative effect, depending on the low-level driver. This is useful
+ * when setting up a trigger that has more than 32 inputs or has a combination
+ * of edge and level triggered inputs.
+ */
+enum comedi_digital_trig_op {
+ COMEDI_DIGITAL_TRIG_DISABLE = 0,
+ COMEDI_DIGITAL_TRIG_ENABLE_EDGES = 1,
+ COMEDI_DIGITAL_TRIG_ENABLE_LEVELS = 2
+};
+
enum comedi_io_direction {
COMEDI_INPUT = 0,
COMEDI_OUTPUT = 1,