diff options
author | Matt Ranostay <mranostay@gmail.com> | 2016-09-03 02:36:15 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-09-03 10:31:55 -0400 |
commit | c8cdf70890d89c07c9e890b103106d58999f0ce4 (patch) | |
tree | c96f5fa74ac061a3151b1099119a584c55a18a85 /include/linux/iio | |
parent | a5c8b11a361065db028721c62aa880bfe0736aa6 (diff) |
iio: trigger: allow immutable triggers to be assigned
There are times when an assigned trigger to a device shouldn't ever
change after intialization.
Examples of this being used is when an provider device has a trigger
that is assigned to an ADC, which uses it populate data into a callback
buffer.
Signed-off-by: Matt Ranostay <matt@ranostay.consulting>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'include/linux/iio')
-rw-r--r-- | include/linux/iio/iio.h | 2 | ||||
-rw-r--r-- | include/linux/iio/trigger.h | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 854e2dad1e0d..786952cd509f 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
@@ -483,6 +483,7 @@ struct iio_buffer_setup_ops { | |||
483 | * @scan_timestamp: [INTERN] set if any buffers have requested timestamp | 483 | * @scan_timestamp: [INTERN] set if any buffers have requested timestamp |
484 | * @scan_index_timestamp:[INTERN] cache of the index to the timestamp | 484 | * @scan_index_timestamp:[INTERN] cache of the index to the timestamp |
485 | * @trig: [INTERN] current device trigger (buffer modes) | 485 | * @trig: [INTERN] current device trigger (buffer modes) |
486 | * @trig_readonly [INTERN] mark the current trigger immutable | ||
486 | * @pollfunc: [DRIVER] function run on trigger being received | 487 | * @pollfunc: [DRIVER] function run on trigger being received |
487 | * @pollfunc_event: [DRIVER] function run on events trigger being received | 488 | * @pollfunc_event: [DRIVER] function run on events trigger being received |
488 | * @channels: [DRIVER] channel specification structure table | 489 | * @channels: [DRIVER] channel specification structure table |
@@ -523,6 +524,7 @@ struct iio_dev { | |||
523 | bool scan_timestamp; | 524 | bool scan_timestamp; |
524 | unsigned scan_index_timestamp; | 525 | unsigned scan_index_timestamp; |
525 | struct iio_trigger *trig; | 526 | struct iio_trigger *trig; |
527 | bool trig_readonly; | ||
526 | struct iio_poll_func *pollfunc; | 528 | struct iio_poll_func *pollfunc; |
527 | struct iio_poll_func *pollfunc_event; | 529 | struct iio_poll_func *pollfunc_event; |
528 | 530 | ||
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h index 1c9e028e0d4a..a122bdd4076c 100644 --- a/include/linux/iio/trigger.h +++ b/include/linux/iio/trigger.h | |||
@@ -132,6 +132,15 @@ int iio_trigger_register(struct iio_trigger *trig_info); | |||
132 | void iio_trigger_unregister(struct iio_trigger *trig_info); | 132 | void iio_trigger_unregister(struct iio_trigger *trig_info); |
133 | 133 | ||
134 | /** | 134 | /** |
135 | * iio_trigger_set_immutable() - set an immutable trigger on destination | ||
136 | * | ||
137 | * @indio_dev - IIO device structure containing the device | ||
138 | * @trig - trigger to assign to device | ||
139 | * | ||
140 | **/ | ||
141 | int iio_trigger_set_immutable(struct iio_dev *indio_dev, struct iio_trigger *trig); | ||
142 | |||
143 | /** | ||
135 | * iio_trigger_poll() - called on a trigger occurring | 144 | * iio_trigger_poll() - called on a trigger occurring |
136 | * @trig: trigger which occurred | 145 | * @trig: trigger which occurred |
137 | * | 146 | * |