summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/industrialio-trigger.c
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2011-08-24 17:28:41 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-24 14:23:44 -0700
commit208b813c04ef7e628783cc62eeb1a140ae25bd19 (patch)
tree744b5bd0dbf4c88b9a889580536fb958377179c1 /drivers/staging/iio/industrialio-trigger.c
parentcb6c89a094df3823a1797b880e5dfda2fbfcd584 (diff)
downloadop-kernel-dev-208b813c04ef7e628783cc62eeb1a140ae25bd19.zip
op-kernel-dev-208b813c04ef7e628783cc62eeb1a140ae25bd19.tar.gz
staging:iio:trigger push functions that don't need to be generaly available down into the core.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/industrialio-trigger.c')
-rw-r--r--drivers/staging/iio/industrialio-trigger.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/drivers/staging/iio/industrialio-trigger.c b/drivers/staging/iio/industrialio-trigger.c
index 72ea106..f1ece86 100644
--- a/drivers/staging/iio/industrialio-trigger.c
+++ b/drivers/staging/iio/industrialio-trigger.c
@@ -215,6 +215,26 @@ void iio_trigger_notify_done(struct iio_trigger *trig)
EXPORT_SYMBOL(iio_trigger_notify_done);
/* Trigger Consumer related functions */
+static int iio_trigger_get_irq(struct iio_trigger *trig)
+{
+ int ret;
+ mutex_lock(&trig->pool_lock);
+ ret = bitmap_find_free_region(trig->pool,
+ CONFIG_IIO_CONSUMERS_PER_TRIGGER,
+ ilog2(1));
+ mutex_unlock(&trig->pool_lock);
+ if (ret >= 0)
+ ret += trig->subirq_base;
+
+ return ret;
+}
+
+static void iio_trigger_put_irq(struct iio_trigger *trig, int irq)
+{
+ mutex_lock(&trig->pool_lock);
+ clear_bit(irq - trig->subirq_base, trig->pool);
+ mutex_unlock(&trig->pool_lock);
+}
/* Complexity in here. With certain triggers (datardy) an acknowledgement
* may be needed if the pollfuncs do not include the data read for the
@@ -223,8 +243,8 @@ EXPORT_SYMBOL(iio_trigger_notify_done);
* the relevant function is in there may be the best option.
*/
/* Worth protecting against double additions?*/
-int iio_trigger_attach_poll_func(struct iio_trigger *trig,
- struct iio_poll_func *pf)
+static int iio_trigger_attach_poll_func(struct iio_trigger *trig,
+ struct iio_poll_func *pf)
{
int ret = 0;
bool notinuse
@@ -241,10 +261,9 @@ int iio_trigger_attach_poll_func(struct iio_trigger *trig,
return ret;
}
-EXPORT_SYMBOL(iio_trigger_attach_poll_func);
-int iio_trigger_dettach_poll_func(struct iio_trigger *trig,
- struct iio_poll_func *pf)
+static int iio_trigger_dettach_poll_func(struct iio_trigger *trig,
+ struct iio_poll_func *pf)
{
int ret = 0;
bool no_other_users
@@ -263,7 +282,6 @@ int iio_trigger_dettach_poll_func(struct iio_trigger *trig,
error_ret:
return ret;
}
-EXPORT_SYMBOL(iio_trigger_dettach_poll_func);
irqreturn_t iio_pollfunc_store_time(int irq, void *p)
{
OpenPOWER on IntegriCloud