summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/ring_generic.h
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2011-05-18 14:40:51 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-05-19 16:06:11 -0700
commit1d892719e70e477156f62e060e0805d991d450e5 (patch)
tree8793a50433e13d0df508c2cb91006ee2d28452d8 /drivers/staging/iio/ring_generic.h
parent32890b983086136fef8721363a2d3860f337ad53 (diff)
downloadop-kernel-dev-1d892719e70e477156f62e060e0805d991d450e5.zip
op-kernel-dev-1d892719e70e477156f62e060e0805d991d450e5.tar.gz
staging:iio: allow channels to be set up using a table of iio_channel_spec structures.
V8: Add missing address in IIO_CHAN macro. Spotted by Michael Hennerich. V7: Document additions to iio_dev structure. V6: Fixup the docs for iio_chan_spec structure. V5: Actually have the macro handle the _input type channels (oops) V4: Add ability to do, _input and modified channel naming in a coherent fashion. Scrap all the messy IIO_CHAN_* macros and move to only one. V3: Added more types - intensity and light. V2: Various fixes - some thanks to Arnd. Bug fix for unregistering of event attr group Changed iio_read_channel_info to have two part value - use for raw value read as well. constify the channelspec structures raw write support for calibbias and similar Additional strings for buidling attribute names. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/ring_generic.h')
-rw-r--r--drivers/staging/iio/ring_generic.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/staging/iio/ring_generic.h b/drivers/staging/iio/ring_generic.h
index 780c6aa..ada51c2 100644
--- a/drivers/staging/iio/ring_generic.h
+++ b/drivers/staging/iio/ring_generic.h
@@ -140,6 +140,8 @@ struct iio_ring_buffer {
int (*predisable)(struct iio_dev *);
int (*postdisable)(struct iio_dev *);
+ struct list_head scan_el_dev_attr_list;
+ struct list_head scan_el_en_attr_list;
};
/**
@@ -177,6 +179,7 @@ struct iio_scan_el {
struct device_attribute dev_attr;
unsigned int number;
unsigned int label;
+ struct list_head l;
int (*set_state)(struct iio_scan_el *scanel,
struct iio_dev *dev_info,
@@ -430,6 +433,14 @@ static inline void iio_put_ring_buffer(struct iio_ring_buffer *ring)
**/
int iio_ring_buffer_register(struct iio_ring_buffer *ring, int id);
+/** iio_ring_buffer_register_ex() - register the buffer with IIO core
+ * @ring: the buffer to be registered
+ * @id: the id of the buffer (typically 0)
+ **/
+int iio_ring_buffer_register_ex(struct iio_ring_buffer *ring, int id,
+ const struct iio_chan_spec *channels,
+ int num_channels);
+
/**
* iio_ring_buffer_unregister() - unregister the buffer from IIO core
* @ring: the buffer to be unregistered
@@ -481,6 +492,15 @@ static inline int iio_ring_buffer_register(struct iio_ring_buffer *ring, int id)
{
return 0;
};
+
+static inline int iio_ring_buffer_register_ex(struct iio_ring_buffer *ring,
+ int id,
+ struct iio_chan_spec *channels,
+ int num_channels)
+{
+ return 0;
+}
+
static inline void iio_ring_buffer_unregister(struct iio_ring_buffer *ring)
{};
OpenPOWER on IntegriCloud