summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/iio.h
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2011-12-05 22:18:14 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2011-12-08 12:11:08 -0800
commit1612244f8a70dae6a7f266e78c5ba22a3db75780 (patch)
treef0d9442ba0c270ece1b96bcd2ddbd5c50dabd454 /drivers/staging/iio/iio.h
parent3771a0a88bd28cbf58e7e7dec3abb704ab61f5ec (diff)
staging:iio:buffer move setup ops from buffer instance to iio_dev
These callbacks should not be buffer instance specific. Hence move them out of the buffer. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/iio.h')
-rw-r--r--drivers/staging/iio/iio.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/staging/iio/iio.h b/drivers/staging/iio/iio.h
index 11c2f25cfaa..45b6d759c2e 100644
--- a/drivers/staging/iio/iio.h
+++ b/drivers/staging/iio/iio.h
@@ -272,6 +272,21 @@ struct iio_info {
};
/**
+ * struct iio_buffer_setup_ops - buffer setup related callbacks
+ * @preenable: [DRIVER] function to run prior to marking buffer enabled
+ * @postenable: [DRIVER] function to run after marking buffer enabled
+ * @predisable: [DRIVER] function to run prior to marking buffer
+ * disabled
+ * @postdisable: [DRIVER] function to run after marking buffer disabled
+ */
+struct iio_buffer_setup_ops {
+ int (*preenable)(struct iio_dev *);
+ int (*postenable)(struct iio_dev *);
+ int (*predisable)(struct iio_dev *);
+ int (*postdisable)(struct iio_dev *);
+};
+
+/**
* struct iio_dev - industrial I/O device
* @id: [INTERN] used to identify device internally
* @modes: [DRIVER] operating modes supported by device
@@ -324,6 +339,7 @@ struct iio_dev {
struct attribute_group chan_attr_group;
const char *name;
const struct iio_info *info;
+ const struct iio_buffer_setup_ops *setup_ops;
struct cdev chrdev;
#define IIO_MAX_GROUPS 6
const struct attribute_group *groups[IIO_MAX_GROUPS + 1];