diff options
author | Alexandru Ardelean <alexandru.ardelean@analog.com> | 2021-02-15 12:40:35 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-03-11 20:47:04 +0000 |
commit | be24dcb113675f72c2b95c96a55d8aae4964cdc6 (patch) | |
tree | d697011f27a6b8c3c9761a61f53a81365b48fe7f /drivers/iio/iio_core.h | |
parent | 4991f3ea2aec5dd8c5abdb40a360258dd71eddf4 (diff) |
iio: core: wrap iio device & buffer into struct for character devices
In order to keep backwards compatibility with the current chardev
mechanism, and in order to add support for multiple buffers per IIO device,
we need to pass both the IIO device & IIO buffer to the chardev.
This is particularly needed for the iio_buffer_read_outer() function, where
we need to pass another buffer object than 'indio_dev->buffer'.
Since we'll also open some chardevs via anon inodes, we can pass extra
buffers in that function by assigning another object to the
iio_dev_buffer_pair object.
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20210215104043.91251-17-alexandru.ardelean@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/iio_core.h')
-rw-r--r-- | drivers/iio/iio_core.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/iio/iio_core.h b/drivers/iio/iio_core.h index 731f5170d5b9..87868fff7d37 100644 --- a/drivers/iio/iio_core.h +++ b/drivers/iio/iio_core.h @@ -18,6 +18,11 @@ struct iio_dev; extern struct device_type iio_device_type; +struct iio_dev_buffer_pair { + struct iio_dev *indio_dev; + struct iio_buffer *buffer; +}; + #define IIO_IOCTL_UNHANDLED 1 struct iio_ioctl_handler { struct list_head entry; |