iio: core: wrap iio device & buffer into struct for character devices
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Mon, 15 Feb 2021 10:40:35 +0000 (12:40 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 11 Mar 2021 20:47:04 +0000 (20:47 +0000)
commitbe24dcb113675f72c2b95c96a55d8aae4964cdc6
treed697011f27a6b8c3c9761a61f53a81365b48fe7f
parent4991f3ea2aec5dd8c5abdb40a360258dd71eddf4
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>
drivers/iio/iio_core.h
drivers/iio/industrialio-buffer.c
drivers/iio/industrialio-core.c