]> Pileus Git - ~andy/linux/commit
iio: Add data_available callback for buffers
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 25 Nov 2013 14:56:00 +0000 (14:56 +0000)
committerJonathan Cameron <jic23@kernel.org>
Tue, 3 Dec 2013 20:22:28 +0000 (20:22 +0000)
commit647cc7b9be861e01723a3183f5d06729a1613a97
treeee1dfdc4fc2f51b8af65bf5e5de09c9be1969bb7
parent112b0b79b2e7a552e8afe19fdddbacef734649f8
iio: Add data_available callback for buffers

This patch adds a new data_available() callback to the iio_buffer_access_funcs
struct. The callback is used to indicate whether data is available in the buffer
for reading. It is meant to replace the stufftoread flag from the iio_buffer
struct. The reasoning for this is that the buffer implementation usually can
determine whether data is available rather easily based on its state, on the
other hand it can be rather tricky to update the stufftoread flag in a race free
way.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/industrialio-buffer.c
include/linux/iio/buffer.h