aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/iio
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2011-08-30 12:32:44 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-09-06 15:59:09 -0700
commit7ae8cf6275589a9ebb733eb5bdd093859ba1be36 (patch)
tree1d13f77c8237f113ff0aa1bb0ace8ced093b8436 /drivers/staging/iio
parenta710cc77db9785993cddecc966a662cb772b3ad9 (diff)
staging: iio: chrdev.h rationalization.
Push some functions out of header and include this where it is needed in other headers only. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r--drivers/staging/iio/chrdev.h32
-rw-r--r--drivers/staging/iio/iio.h2
-rw-r--r--drivers/staging/iio/industrialio-core.c32
-rw-r--r--drivers/staging/iio/ring_generic.h1
4 files changed, 34 insertions, 33 deletions
diff --git a/drivers/staging/iio/chrdev.h b/drivers/staging/iio/chrdev.h
index 3e31ee6220e..8a229e7c2eb 100644
--- a/drivers/staging/iio/chrdev.h
+++ b/drivers/staging/iio/chrdev.h
@@ -9,7 +9,6 @@
#ifndef _IIO_CHRDEV_H_
#define _IIO_CHRDEV_H_
-struct iio_dev;
/**
* struct iio_handler - Structure used to specify file operations
@@ -41,35 +40,4 @@ struct iio_event_data {
s64 timestamp;
};
-/**
- * struct iio_detected_event_list - list element for events that have occurred
- * @list: linked list header
- * @ev: the event itself
- */
-struct iio_detected_event_list {
- struct list_head list;
- struct iio_event_data ev;
-};
-
-/**
- * struct iio_event_interface - chrdev interface for an event line
- * @dev: device assocated with event interface
- * @handler: fileoperations and related control for the chrdev
- * @wait: wait queue to allow blocking reads of events
- * @event_list_lock: mutex to protect the list of detected events
- * @det_events: list of detected events
- * @max_events: maximum number of events before new ones are dropped
- * @current_events: number of events in detected list
- */
-struct iio_event_interface {
- struct device dev;
- struct iio_handler handler;
- wait_queue_head_t wait;
- struct mutex event_list_lock;
- struct list_head det_events;
- int max_events;
- int current_events;
- struct list_head dev_attr_list;
-};
-
#endif
diff --git a/drivers/staging/iio/iio.h b/drivers/staging/iio/iio.h
index 753f769736e..cfa148091ba 100644
--- a/drivers/staging/iio/iio.h
+++ b/drivers/staging/iio/iio.h
@@ -15,7 +15,6 @@
#include <linux/cdev.h>
#include <linux/irq.h>
#include "sysfs.h"
-#include "chrdev.h"
/* IIO TODO LIST */
/*
@@ -178,6 +177,7 @@ static inline s64 iio_get_time_ns(void)
#define IIO_VAL_INT_PLUS_NANO 3
struct iio_trigger; /* forward declaration */
+struct iio_dev;
/**
* struct iio_info - constant information about device
diff --git a/drivers/staging/iio/industrialio-core.c b/drivers/staging/iio/industrialio-core.c
index ed8a6df5bf4..8a21c5e7807 100644
--- a/drivers/staging/iio/industrialio-core.c
+++ b/drivers/staging/iio/industrialio-core.c
@@ -24,6 +24,7 @@
#include "iio.h"
#include "iio_core.h"
#include "iio_core_trigger.h"
+#include "chrdev.h"
#define IIO_ID_PREFIX "device"
#define IIO_ID_FORMAT IIO_ID_PREFIX "%d"
@@ -117,6 +118,37 @@ static void iio_free_ida_val(struct ida *this_ida, int id)
spin_unlock(&iio_ida_lock);
}
+/**
+ * struct iio_detected_event_list - list element for events that have occurred
+ * @list: linked list header
+ * @ev: the event itself
+ */
+struct iio_detected_event_list {
+ struct list_head list;
+ struct iio_event_data ev;
+};
+
+/**
+ * struct iio_event_interface - chrdev interface for an event line
+ * @dev: device assocated with event interface
+ * @handler: fileoperations and related control for the chrdev
+ * @wait: wait queue to allow blocking reads of events
+ * @event_list_lock: mutex to protect the list of detected events
+ * @det_events: list of detected events
+ * @max_events: maximum number of events before new ones are dropped
+ * @current_events: number of events in detected list
+ */
+struct iio_event_interface {
+ struct device dev;
+ struct iio_handler handler;
+ wait_queue_head_t wait;
+ struct mutex event_list_lock;
+ struct list_head det_events;
+ int max_events;
+ int current_events;
+ struct list_head dev_attr_list;
+};
+
int iio_push_event(struct iio_dev *dev_info,
int ev_line,
int ev_code,
diff --git a/drivers/staging/iio/ring_generic.h b/drivers/staging/iio/ring_generic.h
index 3f26f7175b6..d103262dc5b 100644
--- a/drivers/staging/iio/ring_generic.h
+++ b/drivers/staging/iio/ring_generic.h
@@ -10,6 +10,7 @@
#ifndef _IIO_RING_GENERIC_H_
#define _IIO_RING_GENERIC_H_
#include "iio.h"
+#include "chrdev.h"
#ifdef CONFIG_IIO_RING_BUFFER