summaryrefslogtreecommitdiffstats
path: root/include/linux/iio
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-05-29 12:14:21 -0400
committerJonathan Cameron <jic23@kernel.org>2015-06-01 06:31:12 -0400
commit225d59adf1c899176cce0fc80e42b1d1c12f109f (patch)
treeb308359c7f30aa5b542bae15a956d91edf7b987a /include/linux/iio
parent629bc02331f7aae6ef775fb4c15e6d8aa58722f1 (diff)
iio: Specify supported modes for buffers
For each buffer type specify the supported device modes for this buffer. This allows us for devices which support multiple different operating modes to pick the correct operating mode based on the modes supported by the attached buffers. It also prevents that buffers with conflicting modes are attached to a device at the same time or that a buffer with a non-supported mode is attached to a device (e.g. in-kernel callback buffer to a device only supporting hardware mode). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'include/linux/iio')
-rw-r--r--include/linux/iio/buffer.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h
index eb8622b78ec9..1600c55828e0 100644
--- a/include/linux/iio/buffer.h
+++ b/include/linux/iio/buffer.h
@@ -29,6 +29,7 @@ struct iio_buffer;
29 * @set_length: set number of datums in buffer 29 * @set_length: set number of datums in buffer
30 * @release: called when the last reference to the buffer is dropped, 30 * @release: called when the last reference to the buffer is dropped,
31 * should free all resources allocated by the buffer. 31 * should free all resources allocated by the buffer.
32 * @modes: Supported operating modes by this buffer type
32 * 33 *
33 * The purpose of this structure is to make the buffer element 34 * The purpose of this structure is to make the buffer element
34 * modular as event for a given driver, different usecases may require 35 * modular as event for a given driver, different usecases may require
@@ -51,6 +52,8 @@ struct iio_buffer_access_funcs {
51 int (*set_length)(struct iio_buffer *buffer, int length); 52 int (*set_length)(struct iio_buffer *buffer, int length);
52 53
53 void (*release)(struct iio_buffer *buffer); 54 void (*release)(struct iio_buffer *buffer);
55
56 unsigned int modes;
54}; 57};
55 58
56/** 59/**