staging:iio: spit trigger.h into provider and consumer parts.
authorJonathan Cameron <jic23@cam.ac.uk>
Wed, 24 Aug 2011 16:28:39 +0000 (17:28 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 24 Aug 2011 21:23:43 +0000 (14:23 -0700)
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
20 files changed:
drivers/staging/iio/accel/adis16201_ring.c
drivers/staging/iio/accel/adis16203_ring.c
drivers/staging/iio/accel/adis16204_ring.c
drivers/staging/iio/accel/adis16209_ring.c
drivers/staging/iio/accel/adis16240_ring.c
drivers/staging/iio/accel/lis3l02dq_ring.c
drivers/staging/iio/adc/ad7192.c
drivers/staging/iio/adc/ad7298_ring.c
drivers/staging/iio/adc/ad7476_ring.c
drivers/staging/iio/adc/ad7606_ring.c
drivers/staging/iio/adc/ad7793.c
drivers/staging/iio/adc/ad7887_ring.c
drivers/staging/iio/adc/ad799x_ring.c
drivers/staging/iio/adc/max1363_ring.c
drivers/staging/iio/gyro/adis16260_ring.c
drivers/staging/iio/imu/adis16400_ring.c
drivers/staging/iio/industrialio-trigger.c
drivers/staging/iio/meter/ade7758_ring.c
drivers/staging/iio/trigger.h
drivers/staging/iio/trigger_consumer.h [new file with mode: 0644]

index 880c4901b0f402c0dc24d60da2504f7eab93ee1f..4b433c53e5c5e890b1dc0b4d0e8ea2d5cffa6627 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "../iio.h"
 #include "../ring_sw.h"
-#include "../trigger.h"
+#include "../trigger_consumer.h"
 #include "adis16201.h"
 
 
index 4398fd90a17dbf0191e208c98cba8e7aa745b1d9..993e239f9426bf15bfb18621bc43ebbac01f496c 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "../iio.h"
 #include "../ring_sw.h"
-#include "../trigger.h"
+#include "../trigger_consumer.h"
 #include "adis16203.h"
 
 /**
index 385e3503f96ea1fa7509f15f0d19a2350c430aaa..847f43858f50d89a458b1f81f0cab9e49a8db984 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "../iio.h"
 #include "../ring_sw.h"
-#include "../trigger.h"
+#include "../trigger_consumer.h"
 #include "adis16204.h"
 
 /**
index 1652f15afa4fbd534af555385f2ff5897c29e3ad..f889fe72f33af94f3394c3cc5d90054aa7c7eee7 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "../iio.h"
 #include "../ring_sw.h"
-#include "../trigger.h"
+#include "../trigger_consumer.h"
 #include "adis16209.h"
 
 /**
index 9d4ba15e1381dd426c4ed7ff5fe974d331c7c1c0..051ba643d3403d6ea984616a58ea67efaa5ff11e 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "../iio.h"
 #include "../ring_sw.h"
-#include "../trigger.h"
+#include "../trigger_consumer.h"
 #include "adis16240.h"
 
 /**
index 7f7dca46ecab27b1121a1388543fbcabb32f0747..5c6fe13408b1c80e6116e1ddeaf9a83c8a370ab8 100644 (file)
@@ -9,6 +9,7 @@
 #include "../ring_sw.h"
 #include "../kfifo_buf.h"
 #include "../trigger.h"
+#include "../trigger_consumer.h"
 #include "lis3l02dq.h"
 
 /**
index fd3790828789e275c47e7c1932ef5331ee9bf099..adf6d95dd34fca099880363605e699c929e7f8f6 100644 (file)
@@ -22,6 +22,7 @@
 #include "../ring_generic.h"
 #include "../ring_sw.h"
 #include "../trigger.h"
+#include "../trigger_consumer.h"
 
 #include "ad7192.h"
 
index 5b87926ca7d467a1b5c0adfee6cb7923baf190f4..741818c0b8290b2426fdf111e92e827779b4b628 100644 (file)
@@ -14,7 +14,7 @@
 #include "../iio.h"
 #include "../ring_generic.h"
 #include "../ring_sw.h"
-#include "../trigger.h"
+#include "../trigger_consumer.h"
 
 #include "ad7298.h"
 
index 41d6b8d59dd54d2993373f3ce4119d2682b583fc..b109afb8984625a4b8c0eb366802f6e47bfaab8c 100644 (file)
@@ -16,7 +16,7 @@
 #include "../iio.h"
 #include "../ring_generic.h"
 #include "../ring_sw.h"
-#include "../trigger.h"
+#include "../trigger_consumer.h"
 
 #include "ad7476.h"
 
index 1c563ec22ac5673d7b112c8e808cab746135dead..e6424300c8e72379e12da36551cea225b232738b 100644 (file)
@@ -14,7 +14,7 @@
 #include "../iio.h"
 #include "../ring_generic.h"
 #include "../ring_sw.h"
-#include "../trigger.h"
+#include "../trigger_consumer.h"
 
 #include "ad7606.h"
 
index 8a5857c0d80e1af43c50b1e22b44e902f97d17c3..1bcb3ebb1bc6765119052081aab9fbbf69e1447d 100644 (file)
@@ -22,6 +22,7 @@
 #include "../ring_generic.h"
 #include "../ring_sw.h"
 #include "../trigger.h"
+#include "../trigger_consumer.h"
 
 #include "ad7793.h"
 
index cc39eee6b9c0a7b6a1180632f53f5781d7be0114..6b3daf41e0c69828d5c2495fc34dce9aec1aeea2 100644 (file)
@@ -15,7 +15,7 @@
 #include "../iio.h"
 #include "../ring_generic.h"
 #include "../ring_sw.h"
-#include "../trigger.h"
+#include "../trigger_consumer.h"
 
 #include "ad7887.h"
 
index e268a61269ed93b7ea041d1ea431d5210c641500..8f1fc52560f1473caa25a584f04c29074c1d1d88 100644 (file)
@@ -19,7 +19,7 @@
 #include "../iio.h"
 #include "../ring_generic.h"
 #include "../ring_sw.h"
-#include "../trigger.h"
+#include "../trigger_consumer.h"
 
 #include "ad799x.h"
 
index d4db91d6e06c340b5451ddece77e04a78a12a0a8..be601e07639db4983129c8523364676c1a9354a0 100644 (file)
@@ -17,7 +17,7 @@
 #include "../iio.h"
 #include "../ring_generic.h"
 #include "../ring_sw.h"
-#include "../trigger.h"
+#include "../trigger_consumer.h"
 
 #include "max1363.h"
 
index 36f72c32d35e57267c3deee3f8b1a67f26f5bb1c..10f8a666226b47b5f2408a36a5878718572324c2 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "../iio.h"
 #include "../ring_sw.h"
-#include "../trigger.h"
+#include "../trigger_consumer.h"
 #include "adis16260.h"
 
 /**
index 56385d3baeba88852b4e251da3fdc2535737b271..3fc24037db29f35129fdec3f7f02548e224d92fe 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "../iio.h"
 #include "../ring_sw.h"
-#include "../trigger.h"
+#include "../trigger_consumer.h"
 #include "adis16400.h"
 
 /**
index 8fafeb8a8b8ac5d1a5325e3c297bec8fb857c89c..1013442e22848a423d6d051f0c4e996b3b5b04e8 100644 (file)
@@ -19,6 +19,7 @@
 #include "trigger.h"
 #include "iio_core.h"
 #include "iio_core_trigger.h"
+#include "trigger_consumer.h"
 
 /* RFC - Question of approach
  * Make the common case (single sensor single trigger)
index 2dec53220ef1497dbc6053f32acf7102ba48ee88..1e2a09643a350e16765f23fd9b499b1bdd6ba6f4 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "../iio.h"
 #include "../ring_sw.h"
-#include "../trigger.h"
+#include "../trigger_consumer.h"
 #include "ade7758.h"
 
 /**
index 010da1ddde38059cdc8c0f95978cc4557f18a38e..56f8bafa3a3be474979bcddc606b1c2a597ff1b4 100644 (file)
@@ -73,29 +73,6 @@ struct iio_trigger {
        struct mutex                    pool_lock;
 };
 
-/**
- * struct iio_poll_func - poll function pair
- *
- * @indio_dev:                 data specific to device (passed into poll func)
- * @h:                         the function that is actually run on trigger
- * @thread:                    threaded interrupt part
- * @type:                      the type of interrupt (basically if oneshot)
- * @name:                      name used to identify the trigger consumer.
- * @irq:                       the corresponding irq as allocated from the
- *                             trigger pool
- * @timestamp:                 some devices need a timestamp grabbed as soon
- *                             as possible after the trigger - hence handler
- *                             passes it via here.
- **/
-struct iio_poll_func {
-       struct iio_dev *indio_dev;
-       irqreturn_t (*h)(int irq, void *p);
-       irqreturn_t (*thread)(int irq, void *p);
-       int type;
-       char *name;
-       int irq;
-       s64 timestamp;
-};
 
 static inline struct iio_trigger *to_iio_trigger(struct device *d)
 {
@@ -151,7 +128,7 @@ int iio_trigger_dettach_poll_func(struct iio_trigger *trig,
  **/
 void iio_trigger_poll(struct iio_trigger *trig, s64 time);
 void iio_trigger_poll_chained(struct iio_trigger *trig, s64 time);
-void iio_trigger_notify_done(struct iio_trigger *trig);
+
 
 irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private);
 
@@ -176,23 +153,6 @@ static inline void iio_trigger_put_irq(struct iio_trigger *trig, int irq)
        mutex_unlock(&trig->pool_lock);
 };
 
-struct iio_poll_func
-*iio_alloc_pollfunc(irqreturn_t (*h)(int irq, void *p),
-                   irqreturn_t (*thread)(int irq, void *p),
-                   int type,
-                   struct iio_dev *indio_dev,
-                   const char *fmt,
-                   ...);
-void iio_dealloc_pollfunc(struct iio_poll_func *pf);
-irqreturn_t iio_pollfunc_store_time(int irq, void *p);
-
-/*
- * Two functions for common case where all that happens is a pollfunc
- * is attached and detached from a trigger
- */
-int iio_triggered_ring_postenable(struct iio_dev *indio_dev);
-int iio_triggered_ring_predisable(struct iio_dev *indio_dev);
-
 struct iio_trigger *iio_allocate_trigger(const char *fmt, ...)
        __attribute__((format(printf, 1, 2)));
 void iio_free_trigger(struct iio_trigger *trig);
diff --git a/drivers/staging/iio/trigger_consumer.h b/drivers/staging/iio/trigger_consumer.h
new file mode 100644 (file)
index 0000000..418e0bd
--- /dev/null
@@ -0,0 +1,52 @@
+/* The industrial I/O core, trigger consumer functions
+ *
+ * Copyright (c) 2008-2011 Jonathan Cameron
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ */
+
+/**
+ * struct iio_poll_func - poll function pair
+ *
+ * @indio_dev:                 data specific to device (passed into poll func)
+ * @h:                         the function that is actually run on trigger
+ * @thread:                    threaded interrupt part
+ * @type:                      the type of interrupt (basically if oneshot)
+ * @name:                      name used to identify the trigger consumer.
+ * @irq:                       the corresponding irq as allocated from the
+ *                             trigger pool
+ * @timestamp:                 some devices need a timestamp grabbed as soon
+ *                             as possible after the trigger - hence handler
+ *                             passes it via here.
+ **/
+struct iio_poll_func {
+       struct iio_dev *indio_dev;
+       irqreturn_t (*h)(int irq, void *p);
+       irqreturn_t (*thread)(int irq, void *p);
+       int type;
+       char *name;
+       int irq;
+       s64 timestamp;
+};
+
+
+struct iio_poll_func
+*iio_alloc_pollfunc(irqreturn_t (*h)(int irq, void *p),
+                   irqreturn_t (*thread)(int irq, void *p),
+                   int type,
+                   struct iio_dev *indio_dev,
+                   const char *fmt,
+                   ...);
+void iio_dealloc_pollfunc(struct iio_poll_func *pf);
+irqreturn_t iio_pollfunc_store_time(int irq, void *p);
+
+void iio_trigger_notify_done(struct iio_trigger *trig);
+
+/*
+ * Two functions for common case where all that happens is a pollfunc
+ * is attached and detached from a trigger
+ */
+int iio_triggered_ring_postenable(struct iio_dev *indio_dev);
+int iio_triggered_ring_predisable(struct iio_dev *indio_dev);