summaryrefslogtreecommitdiff
path: root/include/linux/iio
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-10-13 18:10:26 +0200
committerJonathan Cameron <jic23@kernel.org>2015-10-25 13:51:11 +0000
commitb440655b896b2d5a2fb5f918801fb0e281a537cd (patch)
tree7a576b45c21d5856bc189c2e5aaa099a5a74723f /include/linux/iio
parent4a60535726d90bfad16b5c52dcffaeede9fb84a9 (diff)
iio: Add support for indicating fixed watermarks
For buffers which have a fixed wake-up watermark the watermark attribute should be read-only. Add a new FIXED_WATERMARK flag to the struct iio_buffer_access_funcs, which can be set by a buffer implementation. 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.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h
index 1600c55828e0..4d99a53d1fe7 100644
--- a/include/linux/iio/buffer.h
+++ b/include/linux/iio/buffer.h
@@ -18,6 +18,12 @@
struct iio_buffer;
/**
+ * INDIO_BUFFER_FLAG_FIXED_WATERMARK - Watermark level of the buffer can not be
+ * configured. It has a fixed value which will be buffer specific.
+ */
+#define INDIO_BUFFER_FLAG_FIXED_WATERMARK BIT(0)
+
+/**
* struct iio_buffer_access_funcs - access functions for buffers.
* @store_to: actually store stuff to the buffer
* @read_first_n: try to get a specified number of bytes (must exist)
@@ -30,6 +36,7 @@ struct iio_buffer;
* @release: called when the last reference to the buffer is dropped,
* should free all resources allocated by the buffer.
* @modes: Supported operating modes by this buffer type
+ * @flags: A bitmask combination of INDIO_BUFFER_FLAG_*
*
* The purpose of this structure is to make the buffer element
* modular as event for a given driver, different usecases may require
@@ -54,6 +61,7 @@ struct iio_buffer_access_funcs {
void (*release)(struct iio_buffer *buffer);
unsigned int modes;
+ unsigned int flags;
};
/**