staging:iio: spit trigger.h into provider and consumer parts.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
6aea1c364c
commit
3f72395ee5
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "../iio.h"
|
||||
#include "../ring_sw.h"
|
||||
#include "../trigger.h"
|
||||
#include "../trigger_consumer.h"
|
||||
#include "adis16201.h"
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "../iio.h"
|
||||
#include "../ring_sw.h"
|
||||
#include "../trigger.h"
|
||||
#include "../trigger_consumer.h"
|
||||
#include "adis16203.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "../iio.h"
|
||||
#include "../ring_sw.h"
|
||||
#include "../trigger.h"
|
||||
#include "../trigger_consumer.h"
|
||||
#include "adis16204.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "../iio.h"
|
||||
#include "../ring_sw.h"
|
||||
#include "../trigger.h"
|
||||
#include "../trigger_consumer.h"
|
||||
#include "adis16209.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "../iio.h"
|
||||
#include "../ring_sw.h"
|
||||
#include "../trigger.h"
|
||||
#include "../trigger_consumer.h"
|
||||
#include "adis16240.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "../ring_sw.h"
|
||||
#include "../kfifo_buf.h"
|
||||
#include "../trigger.h"
|
||||
#include "../trigger_consumer.h"
|
||||
#include "lis3l02dq.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "../ring_generic.h"
|
||||
#include "../ring_sw.h"
|
||||
#include "../trigger.h"
|
||||
#include "../trigger_consumer.h"
|
||||
|
||||
#include "ad7192.h"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "../ring_generic.h"
|
||||
#include "../ring_sw.h"
|
||||
#include "../trigger.h"
|
||||
#include "../trigger_consumer.h"
|
||||
|
||||
#include "ad7793.h"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "../iio.h"
|
||||
#include "../ring_sw.h"
|
||||
#include "../trigger.h"
|
||||
#include "../trigger_consumer.h"
|
||||
#include "adis16260.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include "../iio.h"
|
||||
#include "../ring_sw.h"
|
||||
#include "../trigger.h"
|
||||
#include "../trigger_consumer.h"
|
||||
#include "adis16400.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include "../iio.h"
|
||||
#include "../ring_sw.h"
|
||||
#include "../trigger.h"
|
||||
#include "../trigger_consumer.h"
|
||||
#include "ade7758.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
Loading…
Reference in New Issue