diff options
| author | Lars-Peter Clausen <lars@metafoo.de> | 2015-10-13 12:10:26 -0400 |
|---|---|---|
| committer | Jonathan Cameron <jic23@kernel.org> | 2015-10-25 09:51:11 -0400 |
| commit | b440655b896b2d5a2fb5f918801fb0e281a537cd (patch) | |
| tree | 7a576b45c21d5856bc189c2e5aaa099a5a74723f /include/linux/iio | |
| parent | 4a60535726d90bfad16b5c52dcffaeede9fb84a9 (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.h | 8 |
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 @@ | |||
| 18 | struct iio_buffer; | 18 | struct iio_buffer; |
| 19 | 19 | ||
| 20 | /** | 20 | /** |
| 21 | * INDIO_BUFFER_FLAG_FIXED_WATERMARK - Watermark level of the buffer can not be | ||
| 22 | * configured. It has a fixed value which will be buffer specific. | ||
| 23 | */ | ||
| 24 | #define INDIO_BUFFER_FLAG_FIXED_WATERMARK BIT(0) | ||
| 25 | |||
| 26 | /** | ||
| 21 | * struct iio_buffer_access_funcs - access functions for buffers. | 27 | * struct iio_buffer_access_funcs - access functions for buffers. |
| 22 | * @store_to: actually store stuff to the buffer | 28 | * @store_to: actually store stuff to the buffer |
| 23 | * @read_first_n: try to get a specified number of bytes (must exist) | 29 | * @read_first_n: try to get a specified number of bytes (must exist) |
| @@ -30,6 +36,7 @@ struct iio_buffer; | |||
| 30 | * @release: called when the last reference to the buffer is dropped, | 36 | * @release: called when the last reference to the buffer is dropped, |
| 31 | * should free all resources allocated by the buffer. | 37 | * should free all resources allocated by the buffer. |
| 32 | * @modes: Supported operating modes by this buffer type | 38 | * @modes: Supported operating modes by this buffer type |
| 39 | * @flags: A bitmask combination of INDIO_BUFFER_FLAG_* | ||
| 33 | * | 40 | * |
| 34 | * The purpose of this structure is to make the buffer element | 41 | * The purpose of this structure is to make the buffer element |
| 35 | * modular as event for a given driver, different usecases may require | 42 | * modular as event for a given driver, different usecases may require |
| @@ -54,6 +61,7 @@ struct iio_buffer_access_funcs { | |||
| 54 | void (*release)(struct iio_buffer *buffer); | 61 | void (*release)(struct iio_buffer *buffer); |
| 55 | 62 | ||
| 56 | unsigned int modes; | 63 | unsigned int modes; |
| 64 | unsigned int flags; | ||
| 57 | }; | 65 | }; |
| 58 | 66 | ||
| 59 | /** | 67 | /** |
